Skip to content

Commit 3d1d52b

Browse files
adaptors: add stripe docs (#704)
* feat: add stripe docs Signed-off-by: Hunter Achieng <achienghunter@gmail.com> * fix: update example and stripe description Signed-off-by: Hunter Achieng <achienghunter@gmail.com> --------- Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
1 parent cffc8d3 commit 3d1d52b

4 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Get subscription data
2+
fn(state => {
3+
state.subscriptions = state.data;
4+
state.subscriptionsData = [];
5+
return state;
6+
});
7+
8+
each(
9+
'$.subscriptions',
10+
get('subscriptions', $.data).then(state => {
11+
state.subscriptionsData.push(state.data.data);
12+
return state;
13+
})
14+
);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// List customers in Stripe
2+
3+
list('customers').then(state => {
4+
state.customers = state.data.data;
5+
return state;
6+
});

adaptors/library/staticExamples.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@
136136
"adaptor": "http",
137137
"name": "Chaining synchronous http requests"
138138
},
139+
{
140+
"expressionPath": "jobs/stripe-get-subscriptions",
141+
"adaptor": "stripe",
142+
"name": "Get subscriptions in Stripe"
143+
},
144+
{
145+
"expressionPath": "jobs/stripe-list-customers",
146+
"adaptor": "stripe",
147+
"name": "List customers in Stripe"
148+
},
139149
{
140150
"expressionPath": "jobs/async-findValue",
141151
"adaptor": "postgresql",

adaptors/stripe.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Stripe Adaptor
3+
---
4+
5+
## About Stripe
6+
7+
[Stripe](https://stripe.com/) is a solution designed to automate payment
8+
processing and financial operations.
9+
10+
## Integration Options
11+
12+
Stripe has a REST API that enables external services like OpenFn to pull data
13+
from Stripe, or push data from external apps to Stripe. This option is suited
14+
for scheduled, bulk syncs or workflows that must update data in Stripe with
15+
external information. See [functions](/adaptors/packages/stripe-docs) for more
16+
on how to use this adaptor to work with the API.
17+
18+
## Authentication
19+
20+
See [Stripe docs](https://docs.stripe.com/api/authentication) for the latest on
21+
supported authentication methods. When integrating Stripe via OpenFn, Stripe API
22+
Key is required.
23+
[See our configuration docs](/adaptors/packages/stripe-configuration-schema) to
24+
learn more.
25+
26+
See platform docs on
27+
[managing credentials](/documentation/manage-projects/manage-credentials) for
28+
how to configure a credential in OpenFn. If working locally or if using a Raw
29+
JSON credential type, then your configuration will look something like this:
30+
31+
```json
32+
{
33+
"apiKey": "sk_test_53ixb7na9ydu4tqfufg477365gbvrnv348r475gf4bf485845gbrf
34+
"
35+
}
36+
```
37+
38+
### Helpful Links
39+
40+
1. [Stripe Documentation](https://docs.stripe.com/get-started)

0 commit comments

Comments
 (0)