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
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.
43
43
If you need a sandbox account you can sign up for one really easily [`here`](https://developer.authorize.net/sandbox/).
44
44
45
-
Once you have your keys simply plug them into the appropriate variables as per the samples below.
45
+
Once you have your keys simply plug them into the appropriate variables, as per the below code dealing with the authentication part of the flow.
*Users of previous SDK model please note: The SDK is moving towards using a new model. This model allows us to maintain SDKs better by being more responsive to API changes. (To determine if a code is using the old model or new, a prominent difference is the usage of controllers, which is used only with the new model.) Refer the [old README](README_OLD.md) for samples of the old model.*
53
62
54
-
See below for basic usage examples. View the `tests/` folder for more examples of
55
-
each API. Additional documentation is in the `docs/` folder.
63
+
Apart from this README, you can find details and examples of using the SDK in the following places:
64
+
-[Developer Center Reference](http://developer.authorize.net/api/reference/index.html)
Integration tests for the AuthorizeNet SDK are in the `tests` directory. These tests
208
-
are mainly for SDK development. However, you can also browse through them to find
209
-
more usage examples for the various APIs.
210
-
211
-
- Run `composer update --dev` to load the `PHPUnit` test library.
212
-
- Copy the `phpunit.xml.dist` file to `phpunit.xml` and enter your merchant
213
-
credentials in the constant fields.
214
-
- Run `vendor/bin/phpunit` to run the test suite.
215
-
216
-
*You'll probably want to disable emails on your sandbox account.*
217
-
218
-
### Test Credit Card Numbers
219
-
220
-
| Card Type | Card Number |
221
-
|----------------------------|------------------|
222
-
| American Express Test Card | 370000000000002 |
223
-
| Discover Test Card | 6011000000000012 |
224
-
| Visa Test Card | 4007000000027 |
225
-
| Second Visa Test Card | 4012888818888 |
226
-
| JCB | 3088000000000017 |
227
-
| Diners Club/ Carte Blanche | 38000000000006 |
228
-
229
-
*Set the expiration date to anytime in the future.*
230
-
231
-
## PHPDoc
232
-
233
-
Add PhpDocumentor to your composer.json and run `composer update --dev`:
234
-
```json
235
-
"require-dev": {
236
-
"phpdocumentor/phpdocumentor": "*"
120
+
else
121
+
{
122
+
echo "Charge Credit card Null response returned";
237
123
}
238
124
```
239
-
To autogenerate PHPDocs run:
240
-
```shell
241
-
vendor/bin/phpdoc -t doc/api/ -d lib
242
-
```
243
-
244
-
## New Model
245
-
246
-
We’re exploring a new model of maintaining the SDKs which allows us to be more responsive to API changes. This model is consistent across the different SDK languages, which is great for us, however we do not want to sacrifice your productivity by losing the inherent efficiencies in the PHP language or our object model. To this end we’re introducing the new model as purely “experimental” at this time and we would appreciate your feedback. Let us know what you really think! Here’s an example of a server side call with ApplePay data in the new model.
247
125
248
126
### Apple Pay Example
249
-
You'll need to introduce some new dependencies into composer.json
250
-
````json
251
-
{
252
-
253
-
"require": {
254
-
"php": ">=5.2.0",
255
-
"ext-curl": "*",
256
-
"authorizenet/authorizenet": "1.8.3",
257
-
"jms/serializer": "xsd2php-dev as 0.18.0"
258
-
},
259
-
"require-dev": {
260
-
"goetas/xsd2php": "2.*@dev",
261
-
"goetas/xsd-reader": "2.*@dev"
262
-
},
263
-
"repositories": [{
264
-
"type": "vcs",
265
-
"url": "https://github.com/goetas/serializer.git"
266
-
}]
267
-
268
-
}
269
-
````
270
-
271
-
Here's the PHP code :
272
127
273
128
````php
274
129
<?php
@@ -317,6 +172,42 @@ Here's the PHP code :
317
172
318
173
?>
319
174
````
320
-
### Visa Checkout Examples
321
-
"Check out" the Visa Checkout samples at https://github.com/AuthorizeNet/sample-code-php/tree/master/VisaCheckout
322
175
176
+
## Testing
177
+
178
+
Integration tests for the AuthorizeNet SDK are in the `tests` directory. These tests
179
+
are mainly for SDK development. However, you can also browse through them to find
180
+
more usage examples for the various APIs.
181
+
182
+
- Run `composer update --dev` to load the `PHPUnit` test library.
183
+
- Copy the `phpunit.xml.dist` file to `phpunit.xml` and enter your merchant
184
+
credentials in the constant fields.
185
+
- Run `vendor/bin/phpunit` to run the test suite.
186
+
187
+
*You'll probably want to disable emails on your sandbox account.*
188
+
189
+
### Test Credit Card Numbers
190
+
191
+
| Card Type | Card Number |
192
+
|----------------------------|------------------|
193
+
| American Express Test Card | 370000000000002 |
194
+
| Discover Test Card | 6011000000000012 |
195
+
| Visa Test Card | 4007000000027 |
196
+
| Second Visa Test Card | 4012888818888 |
197
+
| JCB | 3088000000000017 |
198
+
| Diners Club/ Carte Blanche | 38000000000006 |
199
+
200
+
*Set the expiration date to anytime in the future.*
201
+
202
+
## PHPDoc
203
+
204
+
Add PhpDocumentor to your composer.json and run `composer update --dev`:
0 commit comments