Skip to content

Commit 3f5f771

Browse files
authored
Update README.md
Add note on TLS 1.2 with sample code for testing
1 parent 3f43da8 commit 3f5f771

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,22 @@ Proprietary, see the provided `license.md`.
1515
- cURL PHP Extension
1616
- JSON PHP Extension
1717
- SimpleXML PHP Extension
18-
- An Authorize.Net Merchant Account or Sandbox Account. You can get a
19-
free sandbox account at http://developer.authorize.net/hello_world/sandbox/
18+
- An Authorize.Net Merchant account or Sandbox account (You can get a
19+
free sandbox account at http://developer.authorize.net/hello_world/sandbox/).
20+
- TLS 1.2 capable versions of libcurl and OpenSSL (or its equivalent)
21+
22+
### TLS 1.2
23+
The Authorize.Net APIs only support connections using TLS 1.2. 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.
24+
25+
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:
26+
```php
27+
<?php
28+
$ch = curl_init('https://apitest.authorize.net/xml/v1/request.api');
29+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
30+
curl_setopt($ch, CURLOPT_VERBOSE, true);
31+
$data = curl_exec($ch);
32+
curl_close($ch);
33+
```
2034

2135

2236
## Autoloading
@@ -50,8 +64,8 @@ You can run composer locally or on another system to build the directory, then c
5064

5165

5266
## Authentication
53-
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.
54-
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/).
67+
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.
68+
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/).
5569

5670
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.
5771

@@ -73,6 +87,7 @@ $request = new AnetAPI\CreateTransactionRequest();
7387
$request->setMerchantAuthentication($merchantAuthentication);
7488
```
7589
...
90+
7691
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.
7792

7893

0 commit comments

Comments
 (0)