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
* An Authorize.Net account (see _Registration & Configuration_ section below)
20
13
21
14
_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._
22
15
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
+
23
26
### TLS 1.2
24
27
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.
25
28
26
29
27
30
## Installation
28
-
31
+
```
32
+
<groupId>net.authorize</groupId>
33
+
<artifactId>anet-java-sdk</artifactId>
34
+
<version>LATEST</version>
35
+
```
29
36
30
37
## Registration & Configuration
31
-
32
38
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.
33
39
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/).
34
40
35
41
### Authentication
36
-
37
42
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).
38
43
39
44
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.
40
45
41
46
#### 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.
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.
45
55
46
56
### 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:
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
65
75
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.
66
76
67
77
78
+
## Building & Testing the SDK
79
+
Build the SDK with Maven
80
+
------------------------
68
81
82
+
To compile the SDK and create a jar...
69
83
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`
88
85
86
+
Build the SDK with Ant
87
+
----------------------
89
88
89
+
To compile the SDK and create a jar...
90
90
91
-
Build the SDK with Maven
92
-
------------------------
91
+
` $ ant jar`
93
92
94
-
To compile the SDK and create a jar...
93
+
To run the unit tests...
95
94
96
-
$ mvn clean package
95
+
` $ ant unit-test`
97
96
98
97
98
+
To create the javadocs...
99
99
100
-
Build the SDK with Ant
101
-
----------------------
100
+
` $ ant javadoc`
102
101
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.
104
106
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.
122
109
123
110
124
111
## 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