stripe
Stripe is a payment processing platform.
Usage
import { stripe } from 'netzo/apis/stripe.ts'
const api = stripe({
apiKey: Deno.env.get('STRIPE_API_KEY')
})
Configuration
The stripe
factory function expects an object with the following, and returns an object with an API client api
.
Param | Type | Default | Description |
---|---|---|---|
apiKey | string | Deno.env.get('STRIPE_API_KEY') | the API key to use for authentication |
Refer to the API documentation to get the required information.
Examples
The following examples assume you have created an api client instance.
Find subscriptions
Find all subscriptions that match the query.
const query: QuerySubscriptions = {}
const result = await api.subscriptions.get<Subscriptions>(query)
const resultData = result.data
Find subscription items
Find all subscription items that correspond to a specific subscription.
const query: QuerySubscriptionItems = { subscription: SUBSCRIPTION_ID }
const result = await api.subscription_items.get<SubscriptionItems>(query)
const resultData = result.data
Find customers
Find all customers that match the query.
const query: QueryCustomers = {}
const result = await api.customers.get<Customers>(query)
const resultData = result.data
Find invoices
Find all invoices that match the query.
const query: QueryInvoices = {}
const result = await api.invoices.get<Invoices>(query)
const resultData = result.data
Find charges
Find all charges that match the query.
const query: QueryCharges = {}
const result = await api.charges.get<Charges>(query)
const resultData = result.data
Find plans
Find all plans that match the query.
const query: QueryPlans = {}
const result = await api.plans.get<Plans>(query)
const resultData = result.data
Find transactions
Find all transactions that have contributed to the Stripe account balance.
const query: QueryTransactions = {}
const result = await api.balance_transactions.get<Transactions>(query)
const resultData = result.data