@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.
@@ -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 };