Skip to content

Commit 713eff6

Browse files
committed
standardize readme format and info across repos
1 parent 41bc28b commit 713eff6

1 file changed

Lines changed: 44 additions & 58 deletions

File tree

README.md

Lines changed: 44 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,60 @@
44
[![Code Climate](https://codeclimate.com/github/AuthorizeNet/sdk-java/badges/gpa.svg)](https://codeclimate.com/github/AuthorizeNet/sdk-java)
55
[![Maven Central](https://img.shields.io/maven-central/v/net.authorize/anet-java-sdk.svg?style=flat)](http://mvnrepository.com/artifact/net.authorize/anet-java-sdk)
66

7-
```
8-
<groupId>net.authorize</groupId>
9-
<artifactId>anet-java-sdk</artifactId>
10-
<version>LATEST</version>
11-
```
12-
137

148
## Requirements
15-
169
* JDK 1.5.0 or higher
1710
* Ant 1.6.2 or higher (build SDK only)
1811
* Maven 2.2.0 or higher (build SDK only)
1912
* An Authorize.Net account (see _Registration & Configuration_ section below)
2013

2114
_Note: Support for building the SDK with either Ant or Maven has been made. Please see the respective build processes below. All initial jars and docs were built with Ant, however._
2215

16+
### Dependencies
17+
* commons-logging-1.1.1.jar : logging
18+
* log4j-1.2.16.jar : logging
19+
* httpclient-4.0.1.jar : http communication with the payment gateway
20+
* httpcore-4.0.1.jar : http communication with the payment gateway
21+
* junit-4.8.2.jar : unit testing
22+
* hamcrest-core-1.3.jar : unit testing
23+
* hamcrest-library-1.3.jar : unit testing
24+
* jmock-2.6.0.jar : unit testing
25+
2326
### TLS 1.2
2427
The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. It's important to make sure you have new enough versions of all required 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 your system or any libraries it uses.
2528

2629

2730
## Installation
28-
31+
```
32+
<groupId>net.authorize</groupId>
33+
<artifactId>anet-java-sdk</artifactId>
34+
<version>LATEST</version>
35+
```
2936

3037
## Registration & Configuration
31-
3238
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.
3339
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/).
3440

3541
### Authentication
36-
3742
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).
3843

3944
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.
4045

4146
#### To set your API credentials for an API request:
47+
```java
48+
MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;
49+
merchantAuthenticationType.setName("YOUR_API_LOGIN_ID");
50+
merchantAuthenticationType.setTransactionKey("YOUR_TRANSACTION_KEY");
51+
ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);
52+
```
4253

43-
44-
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.
54+
You should never include your Login ID and Transaction Key directly in a 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.
4555

4656
### Switching between the sandbox environment and the production environment
47-
48-
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, do the following:
57+
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, set the appropriate environment constant using ApiOperationBase `setEnvironment` method. For example:
4958
```java
5059
// For PRODUCTION use
60+
ApiOperationBase.setEnvironment(Environment.PRODUCTION);
5161
```
5262

5363
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
@@ -65,62 +75,38 @@ Additionally, you can find details and examples of how our API is structured in
6575
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.
6676

6777

78+
## Building & Testing the SDK
79+
Build the SDK with Maven
80+
------------------------
6881

82+
To compile the SDK and create a jar...
6983

70-
## Wot's all this, then?
71-
72-
### Dependencies
73-
74-
* commons-logging-1.1.1.jar : logging
75-
* log4j-1.2.16.jar : logging
76-
* httpclient-4.0.1.jar : http communication with the payment gateway
77-
* httpcore-4.0.1.jar : http communication with the payment gateway
78-
* junit-4.8.2.jar : unit testing
79-
* hamcrest-core-1.3.jar : unit testing
80-
* hamcrest-library-1.3.jar : unit testing
81-
* jmock-2.6.0.jar : unit testing
82-
83-
### Build process
84-
85-
* Note: To properly run the unit tests, please reference the
86-
anet-java-sdk.properties file, which is a simple properties file that
87-
holds the API credentials for testing the SDK.
84+
` $ mvn clean package`
8885

86+
Build the SDK with Ant
87+
----------------------
8988

89+
To compile the SDK and create a jar...
9090

91-
Build the SDK with Maven
92-
------------------------
91+
` $ ant jar`
9392

94-
To compile the SDK and create a jar...
93+
To run the unit tests...
9594

96-
$ mvn clean package
95+
` $ ant unit-test`
9796

9897

98+
To create the javadocs...
9999

100-
Build the SDK with Ant
101-
----------------------
100+
` $ ant javadoc`
102101

103-
To compile the SDK and create a jar...
102+
### Running the SDK Tests
103+
* Note: To properly run the unit tests, please reference the
104+
anet-java-sdk.properties file, which is a simple properties file that
105+
holds the API credentials for testing the SDK.
104106

105-
$ ant jar
106-
107-
To run the unit tests...
108-
109-
$ ant unit-test
110-
111-
112-
To create the javadocs...
113-
114-
$ ant javadoc
115-
116-
## Sample Code
117-
118-
There are some sample unit tests that are located in the test directory. They
119-
can demonstrate basic functionality. However, detailed sample code for all
120-
of the API operations available can be found in our sample code repository
121-
at https://github.com/AuthorizeNet/sample-code-java
107+
### Testing Guide
108+
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.
122109

123110

124111
## License
125-
126-
This repository is destributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file.
112+
This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/license.txt) file.

0 commit comments

Comments
 (0)