Skip to content

Commit 0def4ff

Browse files
author
Aman Aalam
authored
Merge pull request #41 from PaymentRails/dev
feat: Analytics, Rebranding, routeMinimum changes, and new testing framework
2 parents 90ed4b4 + e8a0f75 commit 0def4ff

File tree

97 files changed

+18136
-859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+18136
-859
lines changed

.env.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TROLLEY_ENVIRONMENT="sandbox"
2+
TROLLEY_ACCESS_KEY="access-key"
3+
TROLLEY_SECRET_KEY="access-secret"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ __MACOSX
1010
.vscode
1111
.idea
1212
dist/
13+
.env

.mocharc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"ui": "bdd",
3+
"timeout": 15000,
4+
"extension": ["ts"],
5+
"spec": ["'test/integration/*Spec.ts'"],
6+
"require": ["ts-node/register", "test/hooks.ts"],
7+
"package": "./package.json"
8+
}

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 16.17.0

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Payment Rails[^1] JavaScript SDK
1+
# Trolley JavaScript SDK (Previously Payment Rails[^1])
22

3-
A JavaScript SDK (written in TypeScript) - For more information about the API as well as NodeJS code samples check out the [full API documentation](http://docs.paymentrails.com)
3+
Trolley's JavaScript SDK (written in TypeScript) - For more information about the API as well as NodeJS code samples check out the [full API documentation](https://docs.trolley.com)
44

5-
[^1]: [Payment Rails is now Trolley](https://www.trolley.com/payment-rails-is-now-trolley-series-a), we'll be updating our SDKs to support the new domain during the first half of 2022.
5+
[^1]: [Payment Rails is now Trolley](https://www.trolley.com/payment-rails-is-now-trolley-series-a). We're in the process of updating our SDKs to support the new domain. In this transition phase, you might still see "PaymentRails" at some places.
66

77
## Installation
88

99
npm install --save paymentrails
1010

1111
## Getting Started
1212

13-
The Payment Rails API is built using promises and all methods except
13+
The Trolley API is built using promises and all methods except
1414
connect will return a promise. The connect call allows you to setup
1515
your API Key and Secret with a client that can be used for subsequent
1616
calls.
1717

1818
```js
19-
// A simple application using the Payment Rails SDK
20-
const paymentrails = require('paymentrails');
19+
// A simple application using the Trolley/Payment Rails SDK
20+
const trolley = require('paymentrails');
2121

22-
const client = paymentrails.connect({
22+
const client = trolley.connect({
2323
key: "YOUR-API-KEY",
2424
secret: "YOUR-API-SECRET",
2525
environment: "production",
@@ -46,7 +46,7 @@ client.recipient.find("R-G7SXXpm6cs4aTUd9YhmgWC").then(recipient => {
4646

4747
### Usage
4848

49-
Methods should all have JSDoc comments to help you understand their usage. As mentioned the [full API documentation](http://docs.paymentrails.com)
49+
Methods should all have JSDoc comments to help you understand their usage. As mentioned the [full API documentation](https://docs.trolley.com)
5050
is the best source of information about the API.
5151

5252
For more information please read the [JavaScript API docs](https://github.com/PaymentRails/javascript-sdk/blob/master/docs/) is available. The best starting point is:
@@ -58,18 +58,19 @@ For more information please read the [JavaScript API docs](https://github.com/Pa
5858
| Recipient | [API Docs for Recipient](https://github.com/PaymentRails/javascript-sdk/blob/master/docs/classes/recipientgateway.md) |
5959
| Recipient Account | [API Docs for Recipient Account](https://github.com/PaymentRails/javascript-sdk/blob/master/docs/classes/recipientaccountgateway.md) |
6060

61-
#### Running Integration / Unit tests
61+
### Running Integration / Unit tests
6262

63-
If you're working on the library itself, here's easy way to run the unit tests. They are designed to be run with configuration coming through environment variables.
63+
If you're working on the library itself, here's easy way to run the tests.
6464

65-
* ``PR_ACCESS_KEY``
66-
* ``PR_SECRET_KEY``
67-
* ``PR_ENVIRONMENT``
65+
```
66+
// if not already, copy the example env file to create an env file
67+
$ cp .env.test .env
6868
69-
For a command like:
70-
71-
PR_ACCESS_KEY=xxx \
72-
PR_SECRET_KEY=yyy \
73-
PR_ENVIRONMENT=integration \
74-
npm run test:integration
69+
// Set access key and secret in the env file
70+
TROLLEY_ENVIRONMENT="production"
71+
TROLLEY_ACCESS_KEY="ACCESS_KEY"
72+
TROLLEY_SECRET_KEY="SECRET_KEY"
7573
74+
//Run the fixture based tests
75+
$ npm test
76+
```

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Payment Rails JavaScript SDK
2+
# Trolley JavaScript SDK
33

44
## Index
55

@@ -41,7 +41,7 @@
4141

4242
*Defined in [index.ts:21](https://github.com/PaymentRails/javascript-sdk/blob/c3121c6/lib/index.ts#L21)*
4343

44-
Create a client for the Payment Rails JavasScript API
44+
Create a client for the Trolley (Payment Rails) JavasScript API
4545

4646
const client = paymentrails.connect({
4747
key: "MY_PUBLIC_KEY",

docs/classes/balancesgateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Payment Rails JavaScript SDK](../README.md) > [BalancesGateway](../classes/balancesgateway.md)
1+
[Trolley JavaScript SDK](../README.md) > [BalancesGateway](../classes/balancesgateway.md)
22

33
# Class: BalancesGateway
44

docs/classes/batchgateway.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Payment Rails JavaScript SDK](../README.md) > [BatchGateway](../classes/batchgateway.md)
1+
[Trolley JavaScript SDK](../README.md) > [BatchGateway](../classes/batchgateway.md)
22

33
# Class: BatchGateway
44

@@ -49,7 +49,7 @@ ___
4949

5050
*Defined in [BatchGateway.ts:95](https://github.com/PaymentRails/javascript-sdk/blob/c3121c6/lib/BatchGateway.ts#L95)*
5151

52-
Creates a batch with optional payments. This is the interface that is provide by the [Create Batch](http://docs.paymentrails.com/api/#create-a-batch) API
52+
Creates a batch with optional payments. This is the interface that is provide by the [Create Batch](https://docs.trolley.com/api/#create-a-batch) API
5353

5454
const batch = await client.batch.create({
5555
description: "My Batch",
@@ -89,7 +89,7 @@ Retrieves a batch based on the batch id
8989

9090
| Param | Type | Description |
9191
| ------ | ------ | ------ |
92-
| batchId | `string` | Payment Rails payment id (e.g. "B-xx999bb") |
92+
| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") |
9393

9494
**Returns:** `Promise`<`Batch`>
9595

@@ -108,7 +108,7 @@ Generate a FX quote for this batch
108108

109109
| Param | Type | Description |
110110
| ------ | ------ | ------ |
111-
| batchId | `string` | Payment Rails payment id (e.g. "B-xx999bb") |
111+
| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") |
112112

113113
**Returns:** `Promise`<`Batch`>
114114

@@ -127,7 +127,7 @@ Return a paginated list of payments for this batch
127127

128128
| Param | Type | Default value | Description |
129129
| ------ | ------ | ------ | ------ |
130-
| batchId | `string` | - | Payment Rails payment id (e.g. "B-xx999bb") |
130+
| batchId | `string` | - | Trolley payment id (e.g. "B-xx999bb") |
131131
| `Default value` page | `number` | 1 | starting a 1 |
132132
| `Default value` pageSize | `number` | 10 | in the range 0...1000 |
133133

@@ -150,7 +150,7 @@ Delete the given batch
150150

151151
| Param | Type | Description |
152152
| ------ | ------ | ------ |
153-
| batchId | `string` | Payment Rails payment id (e.g. "B-xx999bb") |
153+
| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") |
154154

155155
**Returns:** `Promise`<`boolean`>
156156

@@ -190,7 +190,7 @@ Start processing this batch
190190

191191
| Param | Type | Description |
192192
| ------ | ------ | ------ |
193-
| batchId | `string` | Payment Rails payment id (e.g. "B-xx999bb") |
193+
| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") |
194194

195195
**Returns:** `Promise`<`Batch`>
196196

@@ -209,7 +209,7 @@ Get a transaction totaled summary for this batch
209209

210210
| Param | Type | Description |
211211
| ------ | ------ | ------ |
212-
| batchId | `string` | Payment Rails payment id (e.g. "B-xx999bb") |
212+
| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") |
213213

214214
**Returns:** `Promise`<`BatchSummary`>
215215

@@ -232,7 +232,7 @@ Update the batch data, note you can only update the information of a batch not t
232232

233233
| Param | Type | Description |
234234
| ------ | ------ | ------ |
235-
| batchId | `string` | Payment Rails payment id (e.g. "B-xx999bb") |
235+
| batchId | `string` | Trolley payment id (e.g. "B-xx999bb") |
236236
| body | `BatchInput` |
237237

238238
**Returns:** `Promise`<`boolean`>

docs/classes/configuration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Payment Rails JavaScript SDK](../README.md) > [Configuration](../classes/configuration.md)
1+
[Trolley JavaScript SDK](../README.md) > [Configuration](../classes/configuration.md)
22

33
# Class: Configuration
44

@@ -62,13 +62,13 @@ ___
6262

6363
*Defined in [Configuration.ts:55](https://github.com/PaymentRails/javascript-sdk/blob/c3121c6/lib/Configuration.ts#L55)*
6464

65-
Globally set the public API key to connect to Payment Rails
65+
Globally set the public API key to connect to Trolley
6666

6767
**Parameters:**
6868

6969
| Param | Type | Description |
7070
| ------ | ------ | ------ |
71-
| key | `string` | Your Payment Rails API public key |
71+
| key | `string` | Your Trolley API public key |
7272

7373
**Returns:** `void`
7474

@@ -81,13 +81,13 @@ ___
8181

8282
*Defined in [Configuration.ts:63](https://github.com/PaymentRails/javascript-sdk/blob/c3121c6/lib/Configuration.ts#L63)*
8383

84-
Globally set the secret API key to connect to Payment Rails
84+
Globally set the secret API key to connect to Trolley
8585

8686
**Parameters:**
8787

8888
| Param | Type | Description |
8989
| ------ | ------ | ------ |
90-
| secret | `string` | Your Payment Rails API secret Key |
90+
| secret | `string` | Your Trolley API secret Key |
9191

9292
**Returns:** `void`
9393

@@ -100,7 +100,7 @@ ___
100100

101101
*Defined in [Configuration.ts:90](https://github.com/PaymentRails/javascript-sdk/blob/c3121c6/lib/Configuration.ts#L90)*
102102

103-
Set the Payment Rails API environment that your using
103+
Set the Trolley API environment that your using
104104

105105
**Parameters:**
106106

docs/classes/exceptions.authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Payment Rails JavaScript SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [Authentication](../classes/exceptions.authentication.md)
1+
[Trolley JavaScript SDK](../README.md) > [Exceptions](../modules/exceptions.md) > [Authentication](../classes/exceptions.authentication.md)
22

33
# Class: Authentication
44

0 commit comments

Comments
 (0)