Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions adaptors/library/jobs/stripe-get-subscriptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Get subscription data
fn(state => {
state.subscriptions = state.data;
state.subscriptionsData = [];
return state;
});

each(
'$.subscriptions',
get('subscriptions', $.data).then(state => {
state.subscriptionsData.push(state.data.data);
return state;
})
);
6 changes: 6 additions & 0 deletions adaptors/library/jobs/stripe-list-customers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// List customers in Stripe

list('customers').then(state => {
state.customers = state.data.data;
return state;
});
10 changes: 10 additions & 0 deletions adaptors/library/staticExamples.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@
"adaptor": "http",
"name": "Chaining synchronous http requests"
},
{
"expressionPath": "jobs/stripe-get-subscriptions",
"adaptor": "stripe",
"name": "Get subscriptions in Stripe"
},
{
"expressionPath": "jobs/stripe-list-customers",
"adaptor": "stripe",
"name": "List customers in Stripe"
},
{
"expressionPath": "jobs/async-findValue",
"adaptor": "postgresql",
Expand Down
40 changes: 40 additions & 0 deletions adaptors/stripe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Stripe Adaptor
---

## About Stripe

[Stripe](https://stripe.com/) is a solution designed to automate payment
processing and financial operations.

## Integration Options

Stripe has a REST API that enables external services like OpenFn to pull data
from Stripe, or push data from external apps to Stripe. This option is suited
for scheduled, bulk syncs or workflows that must update data in Stripe with
external information. See [functions](/adaptors/packages/stripe-docs) for more
on how to use this adaptor to work with the API.

## Authentication

See [Stripe docs](https://docs.stripe.com/api/authentication) for the latest on
supported authentication methods. When integrating Stripe via OpenFn, Stripe API
Key is required.
[See our configuration docs](/adaptors/packages/stripe-configuration-schema) to
learn more.

See platform docs on
[managing credentials](/documentation/manage-projects/manage-credentials) for
how to configure a credential in OpenFn. If working locally or if using a Raw
JSON credential type, then your configuration will look something like this:

```json
{
"apiKey": "sk_test_53ixb7na9ydu4tqfufg477365gbvrnv348r475gf4bf485845gbrf
"
}
```

### Helpful Links

1. [Stripe Documentation](https://docs.stripe.com/get-started)