Skip to content

Commit 29d306f

Browse files
committed
standardize readme format and info across repos
1 parent 19745e6 commit 29d306f

1 file changed

Lines changed: 13 additions & 64 deletions

File tree

README.md

Lines changed: 13 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Authorize.Net PHP SDK
2-
======================
1+
#Authorize.Net PHP SDK
32

43
[![Travis](https://img.shields.io/travis/AuthorizeNet/sdk-php/master.svg)](https://travis-ci.org/AuthorizeNet/sdk-php)
54
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-php/?branch=master)
@@ -74,12 +73,10 @@ You can run composer locally or on another system to build the directory, then c
7473

7574

7675
## Registration & Configuration
77-
7876
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.
7977
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/).
8078

8179
### Authentication
82-
8380
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).
8481

8582
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.
@@ -107,7 +104,6 @@ $request->setMerchantAuthentication($merchantAuthentication);
107104
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.
108105

109106
### Switching between the sandbox environment and the production environment
110-
111107
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:
112108
```php
113109
// For PRODUCTION use
@@ -129,33 +125,32 @@ Additionally, you can find details and examples of how our API is structured in
129125
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.
130126

131127

128+
## Building & Testing the SDK
129+
Integration tests for the AuthorizeNet SDK are in the `tests` directory. These tests
130+
are mainly for SDK development. However, you can also browse through them to find
131+
more usage examples for the various APIs.
132132

133+
- Run `composer update --dev` to load the `PHPUnit` test library.
134+
- Copy the `phpunit.xml.dist` file to `phpunit.xml` and enter your merchant
135+
credentials in the constant fields.
136+
- Run `vendor/bin/phpunit` to run the test suite.
133137

138+
*You'll probably want to disable emails on your sandbox account.*
134139

135-
136-
137-
140+
### Testing Guide
141+
For additional help in testing your own code, Authorize.Net maintains a [comprehensive testing guide](http://developer.authorize.net/hello_world/testing_guide/) that includes test credit card numbers to use and special triggers to generate certain responses from the sandbox environment.
138142

139143

140-
141-
142-
143-
144-
145-
146-
147144
## Logging
148145
The SDK generates a log with masking for sensitive data like credit card, expiration dates. The provided levels for logging are
149146
`debug`, `info`, `warn`, `error`. Add ````use \net\authorize\util\LogFactory;````. Logger can be initialized using `$logger = LogFactory::getLog(get_class($this));`
150147
The default log file `phplog` gets generated in the current folder. The subsequent logs are appended to the same file, unless the execution folder is changed, and a new log file is generated.
151148

152-
153149
### Usage Examples
154150
- Logging a string message `$logger->debug("Sending 'XML' Request type");`
155151
- Logging xml strings `$logger->debug($xmlRequest);`
156152
- Logging using formatting `$logger->debugFormat("Integer: %d, Float: %f, Xml-Request: %s\n", array(100, 1.29f, $xmlRequest));`
157153

158-
159154
### Customizing Sensitive Tags
160155
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 the SDK*).
161156
- For each element of the `sensitiveTags` array,
@@ -170,51 +165,5 @@ A local copy of [AuthorizedNetSensitiveTagsConfig.json](/lib/net/authorize/util/
170165
**For any regex, no starting or ending '/' or any other delimiter should be defined. The '/' delimiter and unicode flag is added in the code.**
171166

172167

173-
## Testing
174-
Integration tests for the AuthorizeNet SDK are in the `tests` directory. These tests
175-
are mainly for SDK development. However, you can also browse through them to find
176-
more usage examples for the various APIs.
177-
178-
- Run `composer update --dev` to load the `PHPUnit` test library.
179-
- Copy the `phpunit.xml.dist` file to `phpunit.xml` and enter your merchant
180-
credentials in the constant fields.
181-
- Run `vendor/bin/phpunit` to run the test suite.
182-
183-
*You'll probably want to disable emails on your sandbox account.*
184-
185-
186-
### Test Credit Card Numbers
187-
188-
| Card Type | Card Number |
189-
|----------------------------|------------------|
190-
| American Express Test Card | 370000000000002 |
191-
| Discover Test Card | 6011000000000012 |
192-
| Visa Test Card | 4007000000027 |
193-
| Second Visa Test Card | 4012888818888 |
194-
| JCB | 3088000000000017 |
195-
| Diners Club/ Carte Blanche | 38000000000006 |
196-
197-
*Set the expiration date to anytime in the future.*
198-
199-
200-
## PHPDoc
201-
202-
Add PhpDocumentor to your composer.json and run `composer update --dev`:
203-
```json
204-
"require-dev": {
205-
"phpdocumentor/phpdocumentor": "*"
206-
}
207-
```
208-
To autogenerate PHPDocs run the following at the command line (from the same directory as your composer.json):
209-
```shell
210-
vendor/bin/phpdoc -t vendor/authorizenet/authorizenet/doc/api/ -d vendor/authorizenet/authorizenet/lib
211-
```
212-
213-
214168
## License
215-
216-
This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file.
217-
218-
219-
220-
## Testing Guide?
169+
This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file.

0 commit comments

Comments
 (0)