@paykit-sdk/stripe 1.1.6 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -100
- package/dist/index.d.mts +4 -33
- package/dist/index.d.ts +4 -33
- package/dist/index.js +4426 -134
- package/dist/index.mjs +4419 -102
- package/dist/stripe-provider.d.mts +52 -0
- package/dist/stripe-provider.d.ts +52 -0
- package/dist/stripe-provider.js +4526 -0
- package/dist/stripe-provider.mjs +4520 -0
- package/package.json +6 -5
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PaykitProviderOptions, AbstractPayKitProvider, PayKitProvider, CreateCheckoutSchema, Checkout, UpdateCheckoutSchema, CreateCustomerParams, Customer, UpdateCustomerParams, CreateSubscriptionSchema, Subscription, UpdateSubscriptionSchema, CreatePaymentSchema, Payment, UpdatePaymentSchema, CapturePaymentSchema, CreateRefundSchema, Refund, HandleWebhookParams, WebhookEventPayload } from '@paykit-sdk/core';
|
|
2
|
+
import Stripe from 'stripe';
|
|
3
|
+
|
|
4
|
+
interface StripeOptions extends PaykitProviderOptions<Stripe.StripeConfig> {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
}
|
|
7
|
+
declare class StripeProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
8
|
+
private stripe;
|
|
9
|
+
constructor(config: StripeOptions);
|
|
10
|
+
readonly providerName = "stripe";
|
|
11
|
+
/**
|
|
12
|
+
* Checkout management
|
|
13
|
+
*/
|
|
14
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
15
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
16
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
17
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
18
|
+
/**
|
|
19
|
+
* Customer management
|
|
20
|
+
*/
|
|
21
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
22
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
23
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
24
|
+
retrieveCustomer: (id: string) => Promise<Customer | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Subscription management
|
|
27
|
+
*/
|
|
28
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
29
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
30
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
31
|
+
retrieveSubscription: (id: string) => Promise<Subscription>;
|
|
32
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
33
|
+
/**
|
|
34
|
+
* Payment management
|
|
35
|
+
*/
|
|
36
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
37
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
38
|
+
retrievePayment: (id: string) => Promise<Payment | null>;
|
|
39
|
+
deletePayment: (id: string) => Promise<null>;
|
|
40
|
+
capturePayment: (id: string, params: CapturePaymentSchema) => Promise<Payment>;
|
|
41
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
42
|
+
/**
|
|
43
|
+
* Refund management
|
|
44
|
+
*/
|
|
45
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
46
|
+
/**
|
|
47
|
+
* Webhook management
|
|
48
|
+
*/
|
|
49
|
+
handleWebhook: (params: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { type StripeOptions, StripeProvider };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PaykitProviderOptions, AbstractPayKitProvider, PayKitProvider, CreateCheckoutSchema, Checkout, UpdateCheckoutSchema, CreateCustomerParams, Customer, UpdateCustomerParams, CreateSubscriptionSchema, Subscription, UpdateSubscriptionSchema, CreatePaymentSchema, Payment, UpdatePaymentSchema, CapturePaymentSchema, CreateRefundSchema, Refund, HandleWebhookParams, WebhookEventPayload } from '@paykit-sdk/core';
|
|
2
|
+
import Stripe from 'stripe';
|
|
3
|
+
|
|
4
|
+
interface StripeOptions extends PaykitProviderOptions<Stripe.StripeConfig> {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
}
|
|
7
|
+
declare class StripeProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
8
|
+
private stripe;
|
|
9
|
+
constructor(config: StripeOptions);
|
|
10
|
+
readonly providerName = "stripe";
|
|
11
|
+
/**
|
|
12
|
+
* Checkout management
|
|
13
|
+
*/
|
|
14
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
15
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
16
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
17
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
18
|
+
/**
|
|
19
|
+
* Customer management
|
|
20
|
+
*/
|
|
21
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
22
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
23
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
24
|
+
retrieveCustomer: (id: string) => Promise<Customer | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Subscription management
|
|
27
|
+
*/
|
|
28
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
29
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
30
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
31
|
+
retrieveSubscription: (id: string) => Promise<Subscription>;
|
|
32
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
33
|
+
/**
|
|
34
|
+
* Payment management
|
|
35
|
+
*/
|
|
36
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
37
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
38
|
+
retrievePayment: (id: string) => Promise<Payment | null>;
|
|
39
|
+
deletePayment: (id: string) => Promise<null>;
|
|
40
|
+
capturePayment: (id: string, params: CapturePaymentSchema) => Promise<Payment>;
|
|
41
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
42
|
+
/**
|
|
43
|
+
* Refund management
|
|
44
|
+
*/
|
|
45
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
46
|
+
/**
|
|
47
|
+
* Webhook management
|
|
48
|
+
*/
|
|
49
|
+
handleWebhook: (params: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { type StripeOptions, StripeProvider };
|