@paykit-sdk/polar 1.1.91 → 1.1.92
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 +117 -108
- package/dist/index.d.mts +4 -34
- package/dist/index.d.ts +4 -34
- package/dist/index.js +4397 -101
- package/dist/index.mjs +4394 -80
- package/dist/polar-provider.d.mts +52 -0
- package/dist/polar-provider.d.ts +52 -0
- package/dist/polar-provider.js +4525 -0
- package/dist/polar-provider.mjs +4523 -0
- package/package.json +7 -6
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PaykitProviderOptions, OverrideProps, 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 { SDKOptions } from '@polar-sh/sdk';
|
|
3
|
+
|
|
4
|
+
interface PolarOptions extends PaykitProviderOptions<OverrideProps<Pick<SDKOptions, 'accessToken' | 'userAgent' | 'retryConfig' | 'timeoutMs'>, {
|
|
5
|
+
accessToken: string;
|
|
6
|
+
}>> {
|
|
7
|
+
isSandbox: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare class PolarProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
10
|
+
private config;
|
|
11
|
+
readonly providerName = "polar";
|
|
12
|
+
private polar;
|
|
13
|
+
private refunds;
|
|
14
|
+
private readonly productionURL;
|
|
15
|
+
private readonly sandboxURL;
|
|
16
|
+
constructor(config: PolarOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Checkout management
|
|
19
|
+
*/
|
|
20
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
21
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
22
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
23
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
24
|
+
/**
|
|
25
|
+
* Customer management
|
|
26
|
+
*/
|
|
27
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
28
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
29
|
+
retrieveCustomer: (id: string) => Promise<Customer>;
|
|
30
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
31
|
+
/**
|
|
32
|
+
* Subscription management
|
|
33
|
+
*/
|
|
34
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
35
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
36
|
+
retrieveSubscription: (id: string) => Promise<Subscription>;
|
|
37
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
38
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
39
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
40
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
41
|
+
capturePayment: (id: string, params: CapturePaymentSchema) => Promise<Payment>;
|
|
42
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
43
|
+
deletePayment: (id: string) => Promise<null>;
|
|
44
|
+
retrievePayment: (id: string) => Promise<Payment>;
|
|
45
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
46
|
+
/**
|
|
47
|
+
* Webhook management
|
|
48
|
+
*/
|
|
49
|
+
handleWebhook: (params: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { type PolarOptions, PolarProvider };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PaykitProviderOptions, OverrideProps, 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 { SDKOptions } from '@polar-sh/sdk';
|
|
3
|
+
|
|
4
|
+
interface PolarOptions extends PaykitProviderOptions<OverrideProps<Pick<SDKOptions, 'accessToken' | 'userAgent' | 'retryConfig' | 'timeoutMs'>, {
|
|
5
|
+
accessToken: string;
|
|
6
|
+
}>> {
|
|
7
|
+
isSandbox: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare class PolarProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
10
|
+
private config;
|
|
11
|
+
readonly providerName = "polar";
|
|
12
|
+
private polar;
|
|
13
|
+
private refunds;
|
|
14
|
+
private readonly productionURL;
|
|
15
|
+
private readonly sandboxURL;
|
|
16
|
+
constructor(config: PolarOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Checkout management
|
|
19
|
+
*/
|
|
20
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
21
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
22
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
23
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
24
|
+
/**
|
|
25
|
+
* Customer management
|
|
26
|
+
*/
|
|
27
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
28
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
29
|
+
retrieveCustomer: (id: string) => Promise<Customer>;
|
|
30
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
31
|
+
/**
|
|
32
|
+
* Subscription management
|
|
33
|
+
*/
|
|
34
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
35
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
36
|
+
retrieveSubscription: (id: string) => Promise<Subscription>;
|
|
37
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
38
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
39
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
40
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
41
|
+
capturePayment: (id: string, params: CapturePaymentSchema) => Promise<Payment>;
|
|
42
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
43
|
+
deletePayment: (id: string) => Promise<null>;
|
|
44
|
+
retrievePayment: (id: string) => Promise<Payment>;
|
|
45
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
46
|
+
/**
|
|
47
|
+
* Webhook management
|
|
48
|
+
*/
|
|
49
|
+
handleWebhook: (params: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { type PolarOptions, PolarProvider };
|