Skip to content

Commit b4e4c4a

Browse files
authored
Update README.md
1 parent c991016 commit b4e4c4a

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

README.md

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,26 @@
11
# Node.JS SDK for the CyberSource REST API
22

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.
124

135
## Requirements
146
* Node.js version 4.8.4 or higher
157
* A CyberSource account (see _Registration & Configuration_ section below)
168

179

10+
## Installation
1811

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
2412

25-
#### To set your API credentials for an API request:
26-
```javascript
27-
const MerchantSecretKey = "yBJxy6LjM2TmcPGu+GaJrHtkke25fPpUX+UY6/L/1tE=";
28-
const MerchantKeyId = "08c94330-f618-42a3-b09d-e1e43be5efda";
13+
```shell
14+
npm install cybersource-rest-client
2915
```
3016

31-
An authentication test sample is provided and can be run with the following command:
32-
`node sample/test.js`
3317

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)
3520

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:
38-
```javascript
39-
// For PRODUCTION use
40-
ctrl.setEnvironment(SDKConstants.endpoint.production);
41-
```
21+
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.
4222

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.
4424

4525

4626
## SDK Usage Examples and Sample Code
@@ -55,6 +35,20 @@ Additionally, you can find details and examples of how our API is structured in
5535
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.
5636

5737

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.
40+
41+
```javascript
42+
// For TESTING use
43+
const RunEnvironment = "cybersource.environment.sandbox";
44+
// For PRODUCTION use
45+
const RunEnvironment = "cybersource.environment.production";
46+
```
47+
48+
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
49+
50+
51+
5852
## Building & Testing the SDK
5953

6054
### Running the SDK Tests

0 commit comments

Comments
 (0)