@paykit-sdk/paypal 1.0.1 → 1.0.3
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/dist/controllers/subscription.d.mts +37 -0
- package/dist/controllers/subscription.d.ts +37 -0
- package/dist/controllers/subscription.js +179 -0
- package/dist/controllers/subscription.mjs +177 -0
- package/dist/controllers/webhook.d.mts +18 -0
- package/dist/controllers/webhook.d.ts +18 -0
- package/dist/controllers/webhook.js +122 -0
- package/dist/controllers/webhook.mjs +120 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4669 -0
- package/dist/index.mjs +4666 -0
- package/dist/paypal-provider.d.mts +66 -0
- package/dist/paypal-provider.d.ts +66 -0
- package/dist/paypal-provider.js +4651 -0
- package/dist/paypal-provider.mjs +4649 -0
- package/dist/schema.d.mts +138 -0
- package/dist/schema.d.ts +138 -0
- package/dist/schema.js +92 -0
- package/dist/schema.mjs +85 -0
- package/dist/types.d.mts +108 -0
- package/dist/types.d.ts +108 -0
- package/dist/types.js +2 -0
- package/dist/types.mjs +1 -0
- package/dist/utils/mapper.d.mts +22 -0
- package/dist/utils/mapper.d.ts +22 -0
- package/dist/utils/mapper.js +77 -0
- package/dist/utils/mapper.mjs +72 -0
- package/package.json +35 -13
- package/CHANGELOG.md +0 -9
- package/src/controllers/subscription.ts +0 -118
- package/src/controllers/webhook.ts +0 -45
- package/src/index.ts +0 -20
- package/src/paypal-provider.ts +0 -504
- package/src/schema.ts +0 -230
- package/src/types.ts +0 -126
- package/src/utils/mapper.ts +0 -111
- package/tsconfig.json +0 -17
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AbstractPayKitProvider, PayKitProvider, PaykitProviderOptions, CreateCheckoutSchema, Checkout, UpdateCheckoutSchema, CreateCustomerParams, Customer, UpdateCustomerParams, CreateSubscriptionSchema, Subscription, UpdateSubscriptionSchema, CreatePaymentSchema, Payment, UpdatePaymentSchema, CreateRefundSchema, Refund, HandleWebhookParams, WebhookEventPayload } from '@paykit-sdk/core';
|
|
2
|
+
|
|
3
|
+
interface PayPalOptions extends PaykitProviderOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The client ID for the PayPal API
|
|
6
|
+
*/
|
|
7
|
+
clientId: string;
|
|
8
|
+
/**
|
|
9
|
+
* The client secret for the PayPal API
|
|
10
|
+
*/
|
|
11
|
+
clientSecret: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to use the sandbox environment
|
|
14
|
+
*/
|
|
15
|
+
isSandbox: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare class PayPalProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
18
|
+
readonly providerName = "paypal";
|
|
19
|
+
private client;
|
|
20
|
+
private ordersController;
|
|
21
|
+
private paymentsController;
|
|
22
|
+
private subscriptionsController;
|
|
23
|
+
private webhookController;
|
|
24
|
+
constructor(config: PayPalOptions);
|
|
25
|
+
/**
|
|
26
|
+
* Checkout management
|
|
27
|
+
* In PayPal, Order IS the checkout
|
|
28
|
+
*/
|
|
29
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
30
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
31
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
32
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
33
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
34
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
35
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
36
|
+
retrieveCustomer: (id: string) => Promise<Customer | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Subscription management
|
|
39
|
+
* Would need PayPal Subscriptions API - different from Orders
|
|
40
|
+
*/
|
|
41
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
42
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
43
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
44
|
+
retrieveSubscription: (id: string) => Promise<Subscription>;
|
|
45
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
46
|
+
/**
|
|
47
|
+
* Payment management
|
|
48
|
+
* In PayPal, Order IS the payment
|
|
49
|
+
*/
|
|
50
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
51
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
52
|
+
retrievePayment: (id: string) => Promise<Payment | null>;
|
|
53
|
+
deletePayment: (id: string) => Promise<null>;
|
|
54
|
+
capturePayment: (id: string) => Promise<Payment>;
|
|
55
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
56
|
+
/**
|
|
57
|
+
* Refund management
|
|
58
|
+
*/
|
|
59
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
60
|
+
/**
|
|
61
|
+
* Webhook management
|
|
62
|
+
*/
|
|
63
|
+
handleWebhook: (params: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { type PayPalOptions, PayPalProvider };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AbstractPayKitProvider, PayKitProvider, PaykitProviderOptions, CreateCheckoutSchema, Checkout, UpdateCheckoutSchema, CreateCustomerParams, Customer, UpdateCustomerParams, CreateSubscriptionSchema, Subscription, UpdateSubscriptionSchema, CreatePaymentSchema, Payment, UpdatePaymentSchema, CreateRefundSchema, Refund, HandleWebhookParams, WebhookEventPayload } from '@paykit-sdk/core';
|
|
2
|
+
|
|
3
|
+
interface PayPalOptions extends PaykitProviderOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The client ID for the PayPal API
|
|
6
|
+
*/
|
|
7
|
+
clientId: string;
|
|
8
|
+
/**
|
|
9
|
+
* The client secret for the PayPal API
|
|
10
|
+
*/
|
|
11
|
+
clientSecret: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to use the sandbox environment
|
|
14
|
+
*/
|
|
15
|
+
isSandbox: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare class PayPalProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
18
|
+
readonly providerName = "paypal";
|
|
19
|
+
private client;
|
|
20
|
+
private ordersController;
|
|
21
|
+
private paymentsController;
|
|
22
|
+
private subscriptionsController;
|
|
23
|
+
private webhookController;
|
|
24
|
+
constructor(config: PayPalOptions);
|
|
25
|
+
/**
|
|
26
|
+
* Checkout management
|
|
27
|
+
* In PayPal, Order IS the checkout
|
|
28
|
+
*/
|
|
29
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
30
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
31
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
32
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
33
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
34
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
35
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
36
|
+
retrieveCustomer: (id: string) => Promise<Customer | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Subscription management
|
|
39
|
+
* Would need PayPal Subscriptions API - different from Orders
|
|
40
|
+
*/
|
|
41
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
42
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
43
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
44
|
+
retrieveSubscription: (id: string) => Promise<Subscription>;
|
|
45
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
46
|
+
/**
|
|
47
|
+
* Payment management
|
|
48
|
+
* In PayPal, Order IS the payment
|
|
49
|
+
*/
|
|
50
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
51
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
52
|
+
retrievePayment: (id: string) => Promise<Payment | null>;
|
|
53
|
+
deletePayment: (id: string) => Promise<null>;
|
|
54
|
+
capturePayment: (id: string) => Promise<Payment>;
|
|
55
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
56
|
+
/**
|
|
57
|
+
* Refund management
|
|
58
|
+
*/
|
|
59
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
60
|
+
/**
|
|
61
|
+
* Webhook management
|
|
62
|
+
*/
|
|
63
|
+
handleWebhook: (params: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { type PayPalOptions, PayPalProvider };
|