@paykit-sdk/medusajs 1.0.1 → 1.0.2
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/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _medusajs_types from '@medusajs/types';
|
|
2
|
+
export { PaykitMedusaJSAdapter, PaykitMedusaJSAdapterOptions } from './providers/paykit-provider.mjs';
|
|
3
|
+
import '@medusajs/framework/types';
|
|
4
|
+
import '@medusajs/framework/utils';
|
|
5
|
+
import '@paykit-sdk/core';
|
|
6
|
+
import 'zod';
|
|
7
|
+
|
|
8
|
+
declare const _default: _medusajs_types.ModuleProviderExports;
|
|
9
|
+
|
|
10
|
+
export { _default as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _medusajs_types from '@medusajs/types';
|
|
2
|
+
export { PaykitMedusaJSAdapter, PaykitMedusaJSAdapterOptions } from './providers/paykit-provider.js';
|
|
3
|
+
import '@medusajs/framework/types';
|
|
4
|
+
import '@medusajs/framework/utils';
|
|
5
|
+
import '@paykit-sdk/core';
|
|
6
|
+
import 'zod';
|
|
7
|
+
|
|
8
|
+
declare const _default: _medusajs_types.ModuleProviderExports;
|
|
9
|
+
|
|
10
|
+
export { _default as default };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InitiatePaymentInput, InitiatePaymentOutput, CapturePaymentInput, CapturePaymentOutput, AuthorizePaymentInput, AuthorizePaymentOutput, CancelPaymentInput, CancelPaymentOutput, DeletePaymentInput, DeletePaymentOutput, GetPaymentStatusInput, GetPaymentStatusOutput, RefundPaymentInput, RefundPaymentOutput, RetrievePaymentInput, RetrievePaymentOutput, UpdatePaymentInput, UpdatePaymentOutput, ProviderWebhookPayload, WebhookActionResult } from '@medusajs/framework/types';
|
|
2
|
+
import { AbstractPaymentProvider } from '@medusajs/framework/utils';
|
|
3
|
+
import { PayKitProvider, PayKit } from '@paykit-sdk/core';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
declare const optionsSchema: z.ZodObject<{
|
|
7
|
+
/**
|
|
8
|
+
* The underlying PayKit provider instance (Stripe, PayPal, etc.)
|
|
9
|
+
* This is required and must be a valid PayKit provider instance
|
|
10
|
+
*/
|
|
11
|
+
provider: z.ZodType<PayKitProvider, z.ZodTypeDef, PayKitProvider>;
|
|
12
|
+
/**
|
|
13
|
+
* The webhook secret for the provider
|
|
14
|
+
* This is required and must be a valid webhook secret
|
|
15
|
+
*/
|
|
16
|
+
webhookSecret: z.ZodString;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to enable debug mode
|
|
19
|
+
* If enabled, the adapter will log debug information to the console
|
|
20
|
+
*/
|
|
21
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
provider: PayKitProvider;
|
|
24
|
+
webhookSecret: string;
|
|
25
|
+
debug?: boolean | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
provider: PayKitProvider;
|
|
28
|
+
webhookSecret: string;
|
|
29
|
+
debug?: boolean | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
type PaykitMedusaJSAdapterOptions = z.infer<typeof optionsSchema>;
|
|
32
|
+
declare class PaykitMedusaJSAdapter extends AbstractPaymentProvider<PaykitMedusaJSAdapterOptions> {
|
|
33
|
+
/**
|
|
34
|
+
* The unique identifier for this payment provider
|
|
35
|
+
* Will be stored as `pp_paykit_{id}` in Medusa
|
|
36
|
+
*/
|
|
37
|
+
static identifier: string;
|
|
38
|
+
protected readonly paykit: PayKit;
|
|
39
|
+
protected readonly provider: PayKitProvider;
|
|
40
|
+
protected readonly options: PaykitMedusaJSAdapterOptions;
|
|
41
|
+
static validateOptions(options: Record<string, any>): void | never;
|
|
42
|
+
/**
|
|
43
|
+
* Constructor receives Medusa's container and provider options
|
|
44
|
+
*
|
|
45
|
+
* @param cradle - Medusa's dependency injection container
|
|
46
|
+
* @param options - PayKit provider configuration
|
|
47
|
+
*/
|
|
48
|
+
constructor(cradle: Record<string, unknown>, options: PaykitMedusaJSAdapterOptions);
|
|
49
|
+
initiatePayment: ({ context, amount, currency_code, data, }: InitiatePaymentInput) => Promise<InitiatePaymentOutput>;
|
|
50
|
+
capturePayment: (input: CapturePaymentInput) => Promise<CapturePaymentOutput>;
|
|
51
|
+
authorizePayment: (input: AuthorizePaymentInput) => Promise<AuthorizePaymentOutput>;
|
|
52
|
+
cancelPayment: (input: CancelPaymentInput) => Promise<CancelPaymentOutput>;
|
|
53
|
+
deletePayment: (input: DeletePaymentInput) => Promise<DeletePaymentOutput>;
|
|
54
|
+
getPaymentStatus: (input: GetPaymentStatusInput) => Promise<GetPaymentStatusOutput>;
|
|
55
|
+
refundPayment: (input: RefundPaymentInput) => Promise<RefundPaymentOutput>;
|
|
56
|
+
retrievePayment: (input: RetrievePaymentInput) => Promise<RetrievePaymentOutput>;
|
|
57
|
+
updatePayment: (input: UpdatePaymentInput) => Promise<UpdatePaymentOutput>;
|
|
58
|
+
getWebhookActionAndData: (payload: ProviderWebhookPayload["payload"]) => Promise<WebhookActionResult>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { PaykitMedusaJSAdapter, type PaykitMedusaJSAdapterOptions };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InitiatePaymentInput, InitiatePaymentOutput, CapturePaymentInput, CapturePaymentOutput, AuthorizePaymentInput, AuthorizePaymentOutput, CancelPaymentInput, CancelPaymentOutput, DeletePaymentInput, DeletePaymentOutput, GetPaymentStatusInput, GetPaymentStatusOutput, RefundPaymentInput, RefundPaymentOutput, RetrievePaymentInput, RetrievePaymentOutput, UpdatePaymentInput, UpdatePaymentOutput, ProviderWebhookPayload, WebhookActionResult } from '@medusajs/framework/types';
|
|
2
|
+
import { AbstractPaymentProvider } from '@medusajs/framework/utils';
|
|
3
|
+
import { PayKitProvider, PayKit } from '@paykit-sdk/core';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
declare const optionsSchema: z.ZodObject<{
|
|
7
|
+
/**
|
|
8
|
+
* The underlying PayKit provider instance (Stripe, PayPal, etc.)
|
|
9
|
+
* This is required and must be a valid PayKit provider instance
|
|
10
|
+
*/
|
|
11
|
+
provider: z.ZodType<PayKitProvider, z.ZodTypeDef, PayKitProvider>;
|
|
12
|
+
/**
|
|
13
|
+
* The webhook secret for the provider
|
|
14
|
+
* This is required and must be a valid webhook secret
|
|
15
|
+
*/
|
|
16
|
+
webhookSecret: z.ZodString;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to enable debug mode
|
|
19
|
+
* If enabled, the adapter will log debug information to the console
|
|
20
|
+
*/
|
|
21
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
provider: PayKitProvider;
|
|
24
|
+
webhookSecret: string;
|
|
25
|
+
debug?: boolean | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
provider: PayKitProvider;
|
|
28
|
+
webhookSecret: string;
|
|
29
|
+
debug?: boolean | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
type PaykitMedusaJSAdapterOptions = z.infer<typeof optionsSchema>;
|
|
32
|
+
declare class PaykitMedusaJSAdapter extends AbstractPaymentProvider<PaykitMedusaJSAdapterOptions> {
|
|
33
|
+
/**
|
|
34
|
+
* The unique identifier for this payment provider
|
|
35
|
+
* Will be stored as `pp_paykit_{id}` in Medusa
|
|
36
|
+
*/
|
|
37
|
+
static identifier: string;
|
|
38
|
+
protected readonly paykit: PayKit;
|
|
39
|
+
protected readonly provider: PayKitProvider;
|
|
40
|
+
protected readonly options: PaykitMedusaJSAdapterOptions;
|
|
41
|
+
static validateOptions(options: Record<string, any>): void | never;
|
|
42
|
+
/**
|
|
43
|
+
* Constructor receives Medusa's container and provider options
|
|
44
|
+
*
|
|
45
|
+
* @param cradle - Medusa's dependency injection container
|
|
46
|
+
* @param options - PayKit provider configuration
|
|
47
|
+
*/
|
|
48
|
+
constructor(cradle: Record<string, unknown>, options: PaykitMedusaJSAdapterOptions);
|
|
49
|
+
initiatePayment: ({ context, amount, currency_code, data, }: InitiatePaymentInput) => Promise<InitiatePaymentOutput>;
|
|
50
|
+
capturePayment: (input: CapturePaymentInput) => Promise<CapturePaymentOutput>;
|
|
51
|
+
authorizePayment: (input: AuthorizePaymentInput) => Promise<AuthorizePaymentOutput>;
|
|
52
|
+
cancelPayment: (input: CancelPaymentInput) => Promise<CancelPaymentOutput>;
|
|
53
|
+
deletePayment: (input: DeletePaymentInput) => Promise<DeletePaymentOutput>;
|
|
54
|
+
getPaymentStatus: (input: GetPaymentStatusInput) => Promise<GetPaymentStatusOutput>;
|
|
55
|
+
refundPayment: (input: RefundPaymentInput) => Promise<RefundPaymentOutput>;
|
|
56
|
+
retrievePayment: (input: RetrievePaymentInput) => Promise<RetrievePaymentOutput>;
|
|
57
|
+
updatePayment: (input: UpdatePaymentInput) => Promise<UpdatePaymentOutput>;
|
|
58
|
+
getWebhookActionAndData: (payload: ProviderWebhookPayload["payload"]) => Promise<WebhookActionResult>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { PaykitMedusaJSAdapter, type PaykitMedusaJSAdapterOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paykit-sdk/medusajs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MedusaJS Integrations for Paykit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"zod": "^3.25.76",
|
|
41
|
-
"@paykit-sdk/core": ">=1.1.
|
|
41
|
+
"@paykit-sdk/core": ">=1.1.98"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|