@paykit-sdk/monnify 1.0.0
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 +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4508 -0
- package/dist/index.mjs +4505 -0
- package/dist/monnify-provider.d.mts +59 -0
- package/dist/monnify-provider.d.ts +59 -0
- package/dist/monnify-provider.js +4490 -0
- package/dist/monnify-provider.mjs +4488 -0
- package/dist/utils/mapper.d.mts +8 -0
- package/dist/utils/mapper.d.ts +8 -0
- package/dist/utils/mapper.js +4166 -0
- package/dist/utils/mapper.mjs +4161 -0
- package/package.json +46 -0
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
|
|
3
|
+
interface MonnifyOptions extends PaykitProviderOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The API key for the Monnify API
|
|
6
|
+
*/
|
|
7
|
+
apiKey: string;
|
|
8
|
+
/**
|
|
9
|
+
* The secret key for the Monnify API
|
|
10
|
+
*/
|
|
11
|
+
secretKey: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to use the sandbox environment
|
|
14
|
+
*/
|
|
15
|
+
isSandbox: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare class MonnifyProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
18
|
+
private readonly opts;
|
|
19
|
+
readonly providerName = "monnify";
|
|
20
|
+
private _client;
|
|
21
|
+
private baseUrl;
|
|
22
|
+
private tokenManager;
|
|
23
|
+
constructor(opts: MonnifyOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Validates schema and throws ValidationError if invalid
|
|
26
|
+
*/
|
|
27
|
+
private validateSchema;
|
|
28
|
+
/**
|
|
29
|
+
* Ensures API response is successful and has responseBody
|
|
30
|
+
*/
|
|
31
|
+
private ensureResponse;
|
|
32
|
+
/**
|
|
33
|
+
* Queries transaction by transactionReference or paymentReference (with fallback)
|
|
34
|
+
*/
|
|
35
|
+
private queryTransaction;
|
|
36
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
37
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
38
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
39
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
40
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
41
|
+
retrieveCustomer: (id: string) => Promise<Customer | null>;
|
|
42
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
43
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
44
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
45
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
46
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
47
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
48
|
+
retrieveSubscription: (id: string) => Promise<Subscription | null>;
|
|
49
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
50
|
+
retrievePayment: (id: string) => Promise<Payment | null>;
|
|
51
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
52
|
+
deletePayment: (id: string) => Promise<null>;
|
|
53
|
+
capturePayment: (id: string, params: CapturePaymentSchema) => Promise<Payment>;
|
|
54
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
55
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
56
|
+
handleWebhook: (payload: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { type MonnifyOptions, MonnifyProvider };
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
|
|
3
|
+
interface MonnifyOptions extends PaykitProviderOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The API key for the Monnify API
|
|
6
|
+
*/
|
|
7
|
+
apiKey: string;
|
|
8
|
+
/**
|
|
9
|
+
* The secret key for the Monnify API
|
|
10
|
+
*/
|
|
11
|
+
secretKey: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to use the sandbox environment
|
|
14
|
+
*/
|
|
15
|
+
isSandbox: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare class MonnifyProvider extends AbstractPayKitProvider implements PayKitProvider {
|
|
18
|
+
private readonly opts;
|
|
19
|
+
readonly providerName = "monnify";
|
|
20
|
+
private _client;
|
|
21
|
+
private baseUrl;
|
|
22
|
+
private tokenManager;
|
|
23
|
+
constructor(opts: MonnifyOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Validates schema and throws ValidationError if invalid
|
|
26
|
+
*/
|
|
27
|
+
private validateSchema;
|
|
28
|
+
/**
|
|
29
|
+
* Ensures API response is successful and has responseBody
|
|
30
|
+
*/
|
|
31
|
+
private ensureResponse;
|
|
32
|
+
/**
|
|
33
|
+
* Queries transaction by transactionReference or paymentReference (with fallback)
|
|
34
|
+
*/
|
|
35
|
+
private queryTransaction;
|
|
36
|
+
createCheckout: (params: CreateCheckoutSchema) => Promise<Checkout>;
|
|
37
|
+
retrieveCheckout: (id: string) => Promise<Checkout>;
|
|
38
|
+
updateCheckout: (id: string, params: UpdateCheckoutSchema) => Promise<Checkout>;
|
|
39
|
+
deleteCheckout: (id: string) => Promise<null>;
|
|
40
|
+
createCustomer: (params: CreateCustomerParams) => Promise<Customer>;
|
|
41
|
+
retrieveCustomer: (id: string) => Promise<Customer | null>;
|
|
42
|
+
updateCustomer: (id: string, params: UpdateCustomerParams) => Promise<Customer>;
|
|
43
|
+
deleteCustomer: (id: string) => Promise<null>;
|
|
44
|
+
createSubscription: (params: CreateSubscriptionSchema) => Promise<Subscription>;
|
|
45
|
+
updateSubscription: (id: string, params: UpdateSubscriptionSchema) => Promise<Subscription>;
|
|
46
|
+
cancelSubscription: (id: string) => Promise<Subscription>;
|
|
47
|
+
deleteSubscription: (id: string) => Promise<null>;
|
|
48
|
+
retrieveSubscription: (id: string) => Promise<Subscription | null>;
|
|
49
|
+
createPayment: (params: CreatePaymentSchema) => Promise<Payment>;
|
|
50
|
+
retrievePayment: (id: string) => Promise<Payment | null>;
|
|
51
|
+
updatePayment: (id: string, params: UpdatePaymentSchema) => Promise<Payment>;
|
|
52
|
+
deletePayment: (id: string) => Promise<null>;
|
|
53
|
+
capturePayment: (id: string, params: CapturePaymentSchema) => Promise<Payment>;
|
|
54
|
+
cancelPayment: (id: string) => Promise<Payment>;
|
|
55
|
+
createRefund: (params: CreateRefundSchema) => Promise<Refund>;
|
|
56
|
+
handleWebhook: (payload: HandleWebhookParams) => Promise<Array<WebhookEventPayload>>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { type MonnifyOptions, MonnifyProvider };
|