stripe@1.0.0
This adaptor exports the following namespaced functions:
This adaptor exports the following from common:
- as()
- assert()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- lastReferenceValue()
- map()
- merge()
- scrubEmojis()
- sourceValue()
- util
Functions
get
get(resource, id) ⇒ Operation
Get a single resource using its ID
Param | Type | Description |
---|---|---|
resource | string | The API path to retrieve. |
id | string | The ID of the resource to retrieve. |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | The requested resource object |
Example: Get a payment intent
get('payment_intents','pi_3RxS5EEAUr6ipfDB0aKo3moC');
Example: Get a customer
get('customers','cus_SthTl85l20LRJj');
list
list(resource, options) ⇒ Operation
List items from Stripe
Param | Type | Description |
---|---|---|
resource | string | The API resource to list items from. |
options | object | Optional options object. See Stripe API documentation for more details. |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | an array of items |
Example: List all payment intents
list('payment_intents');
Example: List customers with options
list('customers', {limit:3});
http
These functions belong to the http namespace.
http.get
get(path, options) ⇒ Operation
Make a GET request to Stripe
Param | Type | Description |
---|---|---|
path | string | Path to resource |
options | RequestOptions | Optional request options |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | the parsed response body |
response | the response from the HTTP server, including headers, statusCode, body, etc |
references | an array of all previous data objects used in the Job |
Example: Get all invoices
http.get('/invoices')
http.post
post(path, body, options) ⇒ Operation
Make a POST request to Stripe
Param | Type | Description |
---|---|---|
path | string | Path to resource |
body | object | Object which will be attached to the POST body |
options | RequestOptions | Optional request options |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | the parsed response body |
response | the response from the HTTP server, including headers, statusCode, body, etc |
references | an array of all previous data objects used in the Job |
Example: Post a new payment intent
http.post(
'/payment_intents',
{},
{
query: {
amount: 10000,
currency: 'usd',
},
}
);
http.request
request(method, path, body, options) ⇒ Operation
Make a general HTTP request to Stripe
Param | Type | Description |
---|---|---|
method | string | HTTP method to use |
path | string | Path to resource |
body | object | Object which will be attached to the POST body |
options | RequestOptions | Optional request options |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | the parsed response body |
response | the response from the HTTP server, including headers, statusCode, body, etc |
references | an array of all previous data objects used in the Job |
Example: Get all customers
http.request('GET', 'customers');
Interfaces
HttpState
State object
Properties
Name | Description |
---|---|
data | the parsed response body |
response | the response from the HTTP server, including headers, statusCode, body, etc |
references | an array of all previous data objects used in the Job |
RequestOptions
Options provided to the HTTP request
Properties
Name | Type | Description |
---|---|---|
body | object | string | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). |
errors | object | Map of errorCodes -> error messages, ie, { 404: 'Resource not found;' } . Pass false to suppress errors for this code. |
form | object | Pass a JSON object to be serialised into a multipart HTML form (as FormData) in the body. |
query | object | An object of query parameters to be encoded into the URL. |
headers | object | An object of headers to append to the request. |
parseAs | string | Parse the response body as json, text or stream. By default will use the response headers. |
timeout | number | Request timeout in ms. Default: 300 seconds. |
tls | object | TLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions |