You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-15Lines changed: 49 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Authorize.Net PHP SDK
14
14
* TLS 1.2 capable versions of libcurl and OpenSSL (or its equivalent)
15
15
16
16
### 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.
18
18
19
19
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:
We recommend using [`Composer`](http://getcomposer.org)*(note we never recommend you
44
46
override the new secure-http default setting)*. Don't forget to require its autoloader
45
47
in your script or bootstrap file:
@@ -53,7 +55,6 @@ require 'vendor/autoload.php';
53
55
{
54
56
"require": {
55
57
"php": ">=5.6",
56
-
"ext-curl": "*",
57
58
"authorizenet/authorizenet": "~1.9"
58
59
}
59
60
}
@@ -69,11 +70,18 @@ You can run composer locally or on another system to build the directory, then c
69
70
`vendor` directory to the desired system.
70
71
71
72
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.
74
76
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/).
75
77
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:
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.
98
106
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:
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
+
103
140
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)
106
141
107
142
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:
0 commit comments