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
Copy file name to clipboardExpand all lines: README.md
+22-28Lines changed: 22 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,46 +1,26 @@
1
1
# Node.JS SDK for the CyberSource REST API
2
2
3
-
4
-
## Installation
5
-
6
-
#### npm
7
-
8
-
```shell
9
-
npm install CyberSource
10
-
```
11
-
3
+
The CyberSource Node client provides convenient access to the [CyberSource REST API](https://developer.cybersource.com/api/reference/api-reference.html) from your Node application.
12
4
13
5
## Requirements
14
6
* Node.js version 4.8.4 or higher
15
7
* A CyberSource account (see _Registration & Configuration_ section below)
16
8
17
9
10
+
## Installation
18
11
19
-
## Registration & Configuration
20
-
Use of this SDK and the CyberSource APIs requires having an account on our system. You can find details of getting a test account and creating your keys [here](https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration.html)
21
-
22
-
23
-
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. In our sample
24
12
25
-
#### To set your API credentials for an API request:
An authentication test sample is provided and can be run with the following command:
32
-
`node sample/test.js`
33
17
34
-
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.
18
+
## Registration & Configuration
19
+
Use of this SDK and the CyberSource APIs requires having an account on our system. You can find details of getting a test account and creating your keys [here](https://developer.cybersource.com/api/developer-guides/dita-gettingstarted/registration.html)
35
20
36
-
### Switching between the sandbox environment and the production environment
37
-
Cybersource 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, call `setEnvironment` on the controller variable before execute. For example:
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.
42
22
43
-
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
23
+
Remember this SDK is for use in server-side Node applications that access the CyberSource REST API and credentials should always be securely store and accessed appropriately.
44
24
45
25
46
26
## SDK Usage Examples and Sample Code
@@ -55,6 +35,20 @@ Additionally, you can find details and examples of how our API is structured in
55
35
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.
56
36
57
37
38
+
### Switching between the sandbox environment and the production environment
39
+
Cybersource 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 `runEnvironment` in the SDK Configuration. See our sample at https://github.com/CyberSource/cybersource-rest-samples-node/blob/master/Data/Configuration.js.
0 commit comments