|
1 | 1 | Authorize.Net PHP SDK |
2 | 2 | ====================== |
3 | 3 |
|
4 | | -[] |
5 | | -(https://travis-ci.org/AuthorizeNet/sdk-php) |
| 4 | +[](https://travis-ci.org/AuthorizeNet/sdk-php) |
6 | 5 | [](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-php/?branch=master) |
7 | 6 | [](https://packagist.org/packages/authorizenet/authorizenet) |
8 | 7 |
|
@@ -44,37 +43,28 @@ Alternatively, we provide a custom `SPL` autoloader: |
44 | 43 | require 'path/to/anet_php_sdk/autoload.php'; |
45 | 44 | ``` |
46 | 45 |
|
47 | | -**Issue with PHP 7:** *You may get below error when run the composer update with PHP 7. To get rid of this error, use `composer update --ignore-platform-reqs`* |
48 | | -```php |
49 | | -Problem 1 |
50 | | - - Installation request for authorizenet/authorizenet 1.8.6.2 -> satisfiable |
51 | | -by authorizenet/authorizenet[1.8.6.2]. |
52 | | - - authorizenet/authorizenet 1.8.6.2 requires php ~5.3 -> your PHP version (7 |
53 | | -.0.3RC1) or value of "config.platform.php" in composer.json does not satisfy that requirement. |
54 | | -``` |
55 | | - |
56 | 46 | ## Authentication |
57 | 47 | 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. |
58 | 48 | If you need a sandbox account you can sign up for one really easily [`here`](https://developer.authorize.net/sandbox/). |
59 | 49 |
|
60 | 50 | 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. |
61 | 51 |
|
62 | 52 | ... |
63 | | -````php |
| 53 | +```php |
64 | 54 | use net\authorize\api\contract\v1 as AnetAPI; |
65 | | -```` |
| 55 | +``` |
66 | 56 | ... |
67 | | -````php |
| 57 | +```php |
68 | 58 | $merchantAuthentication = new AnetAPI\MerchantAuthenticationType(); |
69 | 59 | $merchantAuthentication->setName("YOURLOGIN"); |
70 | 60 | $merchantAuthentication->setTransactionKey("YOURKEY"); |
71 | | -```` |
| 61 | +``` |
72 | 62 | ... |
73 | 63 |
|
74 | | -````php |
| 64 | +```php |
75 | 65 | $request = new AnetAPI\CreateTransactionRequest(); |
76 | 66 | $request->setMerchantAuthentication($merchantAuthentication); |
77 | | -```` |
| 67 | +``` |
78 | 68 | ... |
79 | 69 |
|
80 | 70 | ## Usage Examples |
@@ -158,7 +148,7 @@ The default log file `phplog` gets generated in the current folder. The subseque |
158 | 148 | - Logging using formatting `$logger->debugFormat("Integer: %d, Float: %f, Xml-Request: %s\n", array(100, 1.29f, $xmlRequest));` |
159 | 149 |
|
160 | 150 | ### Customizing Sensitive Tags |
161 | | -A local copy of [AuthorizedNetSensitiveTagsConfig.json](/lib/net/authorize/util/ANetSensitiveFields.php) gets generated when code invoking the logger first gets executed. The local file can later be edited by developer to re-configure what is masked and what is visible (*Do not edit the json in sdk*). |
| 151 | +A local copy of [AuthorizedNetSensitiveTagsConfig.json](/lib/net/authorize/util/ANetSensitiveFields.php) gets generated when code invoking the logger first gets executed. The local file can later be edited by developer to re-configure what is masked and what is visible. (*Do not edit the json in sdk*). |
162 | 152 | - For each element of the `sensitiveTags` array, |
163 | 153 | - `tagName` field corresponds to the name of the property in object, or xml-tag that should be hidden entirely ( *XXXX* shown if no replacement specified ) or masked (e.g. showing the last 4 digits of credit card number). |
164 | 154 | - `pattern`[<sup>[Note]</sup>](#regex-note) and `replacement`[<sup>[Note]</sup>](#regex-note) can be left `""`, if the default is to be used (as defined in [Log.php](/lib/net/authorize/util/Log.php)). `pattern` gives the regex to identify, while `replacement` defines the visible part. |
|
0 commit comments