Skip to content

Commit 56516af

Browse files
committed
standardize readme format and info across repos
1 parent cec6aa5 commit 56516af

1 file changed

Lines changed: 49 additions & 15 deletions

File tree

README.md

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Authorize.Net PHP SDK
1414
* TLS 1.2 capable versions of libcurl and OpenSSL (or its equivalent)
1515

1616
### TLS 1.2
17-
The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. This PHP SDK communicates with the Authorize.Net API using `libcurl` and `OpenSSL` (or equivalent crypto library). It's important to make sure you have new enough versions of these components to support TLS 1.2. Additionally, it's very important to keep these components up to date going forward to mitigate the risk of any security flaws that may be discovered in these libraries.
17+
The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. This SDK communicates with the Authorize.Net API using `libcurl` and `OpenSSL` (or equivalent crypto library). It's important to make sure you have new enough versions of these components to support TLS 1.2. Additionally, it's very important to keep these components up to date going forward to mitigate the risk of any security flaws that may be discovered in these libraries.
1818

1919
To test whether your current installation is capable of communicating to our servers using TLS 1.2, run the following PHP code and examine the output for the TLS version:
2020
```php
@@ -38,8 +38,10 @@ $json = json_decode($data);
3838
echo "Connection uses " . $json->tls_version ."\n";
3939
```
4040

41+
42+
## Installation
4143

42-
## Autoloading
44+
### Autoloading
4345
We recommend using [`Composer`](http://getcomposer.org) *(note we never recommend you
4446
override the new secure-http default setting)*. Don't forget to require its autoloader
4547
in your script or bootstrap file:
@@ -53,7 +55,6 @@ require 'vendor/autoload.php';
5355
{
5456
"require": {
5557
"php": ">=5.6",
56-
"ext-curl": "*",
5758
"authorizenet/authorizenet": "~1.9"
5859
}
5960
}
@@ -69,11 +70,18 @@ You can run composer locally or on another system to build the directory, then c
6970
`vendor` directory to the desired system.
7071

7172

72-
## Authentication
73-
To authenticate with the Authorize.Net API you will need to retrieve your API Login ID and Transaction Key from the [Merchant Interface](https://account.authorize.net/). You can find these details in the Settings section.
73+
## Registration & Configuration
74+
75+
Use of this SDK and the Authorize.Net APIs requires having an account on our system. You can find these details in the Settings section.
7476
If you don't currently have a production Authorize.Net account and need a sandbox account for testing, you can easily sign up for one [here](https://developer.authorize.net/sandbox/).
7577

76-
Once you have your keys simply load them into the appropriate variables in your code, as per the below sample code dealing with the authentication part of the flow.
78+
### Authentication
79+
80+
To authenticate with the Authorize.Net API you will need to use your account's API Login ID and Transaction Key. If you don't have these values, you can obtain them from our Merchant Interface site. Access the Merchant Interface for production accounts at (https://account.authorize.net/) or sandbox accounts at (https://sandbox.authorize.net).
81+
82+
Once you have your keys simply load them into the appropriate variables in your code, as per the below sample code dealing with the authentication part of the API request.
83+
84+
#### To set your API credentials for an API request:
7785

7886
...
7987
```php
@@ -96,20 +104,42 @@ $request->setMerchantAuthentication($merchantAuthentication);
96104

97105
You should never include your Login ID and Transaction Key directly in a PHP file that's in a publically accessible portion of your website. A better practice would be to define these in a constants file, and then reference those constants in the appropriate place in your code.
98106

107+
### Switching between the sandbox environment and the production environment
108+
109+
Authorize.Net maintains a complete sandbox environment for testing and development purposes. This sandbox environment is an exact duplicate of our production environment with the transaction authorization and settlement process simulated. By default, this SDK is configured to communicate with the sandbox environment. To switch to the production environment, replace the environment constant in the execute method. For example:
110+
```php
111+
// For PRODUCTION use
112+
$response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION);
113+
```
114+
115+
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
116+
99117

100118
## SDK Usage Examples and Sample Code
101-
Apart from this README, we have comprehensive sample code for all common uses of our API:
102-
- [Github Sample Code Repositories](https://github.com/AuthorizeNet/sample-code-php)
119+
To get started using this SDK, it's highly recommended to download our sample code repository:
120+
* [Authorize.Net PHP Sample Code Repository (on GitHub)](https://github.com/AuthorizeNet/sample-code-php)
121+
122+
In that respository, we have comprehensive sample code for all common uses of our API:
123+
124+
Additionally, you can find details and examples of how our API is structured in our API Reference Guide:
125+
* [Developer Center API Reference](http://developer.authorize.net/api/reference/index.html)
126+
127+
The API Reference Guide provides examples of what information is needed for a particular request and how that information would be formatted. Using those examples, you can easily determine what methods would be necessary to include that information in a request using this SDK.
128+
129+
130+
131+
132+
133+
134+
135+
136+
137+
138+
139+
103140

104-
Additionally, you can find details and examples of using the SDK in our API Reference Guide:
105-
- [Developer Center API Reference](http://developer.authorize.net/api/reference/index.html)
106141

107142

108-
### Setting Production Environment
109-
To change from the sandbox environment to the production environment, replace the environment constant in the execute method. For example, in the method above:
110-
```php
111-
$response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::PRODUCTION);
112-
```
113143

114144

115145
## Logging
@@ -182,3 +212,7 @@ vendor/bin/phpdoc -t doc/api/ -d lib
182212
## License
183213

184214
This repository is destributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file.
215+
216+
217+
218+
## Testing Guide?

0 commit comments

Comments
 (0)