UNPKG

@paykit-sdk/stripe

Version:

Stripe provider for PayKit

38 lines (34 loc) 1.51 kB
import { PaykitProviderOptions, PayKitProvider, CreateCheckoutParams, Checkout, CreateCustomerParams, Customer, UpdateCustomerParams, UpdateSubscriptionParams, Subscription, HandleWebhookParams, WebhookEventPayload } from '@paykit-sdk/core'; import Stripe from 'stripe'; interface StripeConfig extends PaykitProviderOptions<Stripe.StripeConfig> { apiKey: string; } declare class StripeProvider implements PayKitProvider { private stripe; constructor(config: StripeConfig); /** * Checkout management */ createCheckout: (params: CreateCheckoutParams) => Promise<Checkout>; retrieveCheckout: (id: string) => Promise<Checkout>; /** * Customer management */ createCustomer: (params: CreateCustomerParams) => Promise<Customer>; updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>; deleteCustomer: (id: string) => Promise<null>; retrieveCustomer: (id: string) => Promise<Customer | null>; /** * Subscription management */ cancelSubscription: (id: string) => Promise<null>; updateSubscription: (id: string, params: UpdateSubscriptionParams) => Promise<Subscription>; retrieveSubscription: (id: string) => Promise<Subscription>; /** * Webhook management */ handleWebhook: (params: HandleWebhookParams) => Promise<WebhookEventPayload>; } declare const createStripe: (config: StripeConfig) => StripeProvider; declare const stripe: () => StripeProvider; export { createStripe, stripe };