awesome-node-checkout 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/abstract/base-payment-provider.abstract.d.ts +30 -0
- package/dist/abstract/base-payment-provider.abstract.d.ts.map +1 -0
- package/dist/abstract/base-payment-provider.abstract.js +28 -0
- package/dist/abstract/base-payment-provider.abstract.js.map +1 -0
- package/dist/adapters/express/index.d.ts +35 -0
- package/dist/adapters/express/index.d.ts.map +1 -0
- package/dist/adapters/express/index.js +129 -0
- package/dist/adapters/express/index.js.map +1 -0
- package/dist/checkout-configurator.d.ts +66 -0
- package/dist/checkout-configurator.d.ts.map +1 -0
- package/dist/checkout-configurator.js +148 -0
- package/dist/checkout-configurator.js.map +1 -0
- package/dist/events/checkout-event-bus.d.ts +29 -0
- package/dist/events/checkout-event-bus.d.ts.map +1 -0
- package/dist/events/checkout-event-bus.js +37 -0
- package/dist/events/checkout-event-bus.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/payment-provider.interface.d.ts +33 -0
- package/dist/interfaces/payment-provider.interface.d.ts.map +1 -0
- package/dist/interfaces/payment-provider.interface.js +3 -0
- package/dist/interfaces/payment-provider.interface.js.map +1 -0
- package/dist/interfaces/transaction-store.interface.d.ts +24 -0
- package/dist/interfaces/transaction-store.interface.d.ts.map +1 -0
- package/dist/interfaces/transaction-store.interface.js +3 -0
- package/dist/interfaces/transaction-store.interface.js.map +1 -0
- package/dist/models/checkout-config.model.d.ts +12 -0
- package/dist/models/checkout-config.model.d.ts.map +1 -0
- package/dist/models/checkout-config.model.js +3 -0
- package/dist/models/checkout-config.model.js.map +1 -0
- package/dist/models/errors.d.ts +7 -0
- package/dist/models/errors.d.ts.map +1 -0
- package/dist/models/errors.js +17 -0
- package/dist/models/errors.js.map +1 -0
- package/dist/models/payment-request.model.d.ts +21 -0
- package/dist/models/payment-request.model.d.ts.map +1 -0
- package/dist/models/payment-request.model.js +3 -0
- package/dist/models/payment-request.model.js.map +1 -0
- package/dist/models/payment-result.model.d.ts +23 -0
- package/dist/models/payment-result.model.d.ts.map +1 -0
- package/dist/models/payment-result.model.js +3 -0
- package/dist/models/payment-result.model.js.map +1 -0
- package/dist/providers/nexi/nexi.provider.d.ts +64 -0
- package/dist/providers/nexi/nexi.provider.d.ts.map +1 -0
- package/dist/providers/nexi/nexi.provider.js +227 -0
- package/dist/providers/nexi/nexi.provider.js.map +1 -0
- package/dist/providers/paypal/paypal.provider.d.ts +33 -0
- package/dist/providers/paypal/paypal.provider.d.ts.map +1 -0
- package/dist/providers/paypal/paypal.provider.js +167 -0
- package/dist/providers/paypal/paypal.provider.js.map +1 -0
- package/dist/providers/satispay/satispay.provider.d.ts +79 -0
- package/dist/providers/satispay/satispay.provider.d.ts.map +1 -0
- package/dist/providers/satispay/satispay.provider.js +301 -0
- package/dist/providers/satispay/satispay.provider.js.map +1 -0
- package/dist/stores/in-memory-transaction.store.d.ts +17 -0
- package/dist/stores/in-memory-transaction.store.d.ts.map +1 -0
- package/dist/stores/in-memory-transaction.store.js +30 -0
- package/dist/stores/in-memory-transaction.store.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayPalProvider = void 0;
|
|
4
|
+
const paypal_server_sdk_1 = require("@paypal/paypal-server-sdk");
|
|
5
|
+
const base_payment_provider_abstract_1 = require("../../abstract/base-payment-provider.abstract");
|
|
6
|
+
/**
|
|
7
|
+
* PayPal Checkout provider.
|
|
8
|
+
* Flow: `redirect` — creates an order, redirects the user to PayPal,
|
|
9
|
+
* then captures the payment on return via `handleRedirect`.
|
|
10
|
+
*/
|
|
11
|
+
class PayPalProvider extends base_payment_provider_abstract_1.BasePaymentProvider {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super();
|
|
14
|
+
this.config = config;
|
|
15
|
+
this.name = 'paypal';
|
|
16
|
+
this.flow = 'redirect';
|
|
17
|
+
const { clientId, clientSecret, environment = 'sandbox' } = config;
|
|
18
|
+
this.client = new paypal_server_sdk_1.Client({
|
|
19
|
+
clientCredentialsAuthCredentials: {
|
|
20
|
+
oAuthClientId: clientId,
|
|
21
|
+
oAuthClientSecret: clientSecret,
|
|
22
|
+
},
|
|
23
|
+
environment: environment === 'live' ? paypal_server_sdk_1.Environment.Production : paypal_server_sdk_1.Environment.Sandbox,
|
|
24
|
+
logging: {
|
|
25
|
+
logLevel: paypal_server_sdk_1.LogLevel.Error,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
this.ordersController = new paypal_server_sdk_1.OrdersController(this.client);
|
|
29
|
+
this.paymentsController = new paypal_server_sdk_1.PaymentsController(this.client);
|
|
30
|
+
}
|
|
31
|
+
async createPayment(request) {
|
|
32
|
+
try {
|
|
33
|
+
const { result: order } = await this.ordersController.createOrder({
|
|
34
|
+
body: {
|
|
35
|
+
intent: 'CAPTURE',
|
|
36
|
+
purchaseUnits: [
|
|
37
|
+
{
|
|
38
|
+
amount: {
|
|
39
|
+
currencyCode: request.currency,
|
|
40
|
+
value: request.amount.toFixed(2),
|
|
41
|
+
},
|
|
42
|
+
description: request.description,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
paymentSource: {
|
|
46
|
+
paypal: {
|
|
47
|
+
experienceContext: {
|
|
48
|
+
returnUrl: request.returnUrl,
|
|
49
|
+
cancelUrl: request.cancelUrl,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
prefer: 'return=representation',
|
|
55
|
+
});
|
|
56
|
+
const approvalUrl = order.links?.find((l) => l.rel === 'payer-action' || l.rel === 'approve')?.href;
|
|
57
|
+
return {
|
|
58
|
+
success: true,
|
|
59
|
+
paymentId: order.id,
|
|
60
|
+
approvalUrl,
|
|
61
|
+
status: order.status,
|
|
62
|
+
raw: order,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return this.errorResult(error, 'Failed to create PayPal payment');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async executePayment(paymentId) {
|
|
70
|
+
try {
|
|
71
|
+
const { result: order } = await this.ordersController.captureOrder({
|
|
72
|
+
id: paymentId,
|
|
73
|
+
body: {},
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
success: order.status === 'COMPLETED',
|
|
77
|
+
paymentId: order.id,
|
|
78
|
+
status: order.status,
|
|
79
|
+
raw: order,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return this.errorResult(error, 'Failed to execute PayPal payment');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async getPaymentDetails(paymentId) {
|
|
87
|
+
try {
|
|
88
|
+
const { result: order } = await this.ordersController.getOrder({
|
|
89
|
+
id: paymentId,
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
success: true,
|
|
93
|
+
paymentId: order.id,
|
|
94
|
+
status: order.status,
|
|
95
|
+
raw: order,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
return this.errorResult(error, 'Failed to get PayPal payment details');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async refundPayment(paymentId, amount) {
|
|
103
|
+
try {
|
|
104
|
+
// Retrieve order to find the capture ID and currency
|
|
105
|
+
const { result: order } = await this.ordersController.getOrder({ id: paymentId });
|
|
106
|
+
// The PayPal SDK types nested objects as `any`; extract with explicit guards
|
|
107
|
+
const purchaseUnit = Array.isArray(order?.purchaseUnits)
|
|
108
|
+
? order.purchaseUnits[0]
|
|
109
|
+
: undefined;
|
|
110
|
+
const captureId = Array.isArray(purchaseUnit?.payments?.captures) && purchaseUnit.payments.captures.length > 0
|
|
111
|
+
? String(purchaseUnit.payments.captures[0].id)
|
|
112
|
+
: undefined;
|
|
113
|
+
if (!captureId) {
|
|
114
|
+
return {
|
|
115
|
+
success: false,
|
|
116
|
+
error: 'No capture found for this order. Ensure the payment has been captured before refunding.',
|
|
117
|
+
paymentId,
|
|
118
|
+
status: 'REFUND_FAILED',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const refundBody = {};
|
|
122
|
+
if (amount !== undefined) {
|
|
123
|
+
const currencyCode = typeof purchaseUnit?.amount?.currencyCode === 'string'
|
|
124
|
+
? purchaseUnit.amount.currencyCode
|
|
125
|
+
: undefined;
|
|
126
|
+
if (!currencyCode) {
|
|
127
|
+
return {
|
|
128
|
+
success: false,
|
|
129
|
+
error: 'Cannot determine currency code from order. Refund a specific amount is not possible.',
|
|
130
|
+
paymentId,
|
|
131
|
+
status: 'REFUND_FAILED',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
refundBody['amount'] = { value: amount.toFixed(2), currencyCode };
|
|
135
|
+
}
|
|
136
|
+
const { result: refund } = await this.paymentsController.refundCapturedPayment({
|
|
137
|
+
captureId,
|
|
138
|
+
body: refundBody,
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
success: refund?.status === 'COMPLETED',
|
|
142
|
+
paymentId: String(refund?.id ?? ''),
|
|
143
|
+
status: String(refund?.status ?? ''),
|
|
144
|
+
raw: refund,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
return this.errorResult(error, 'Failed to refund PayPal payment');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Handles the redirect from PayPal after the user approves the payment.
|
|
153
|
+
* PayPal appends `token` (order ID) and `PayerID` to the returnUrl.
|
|
154
|
+
*/
|
|
155
|
+
async handleRedirect(query) {
|
|
156
|
+
const paymentId = query['token'];
|
|
157
|
+
if (!paymentId) {
|
|
158
|
+
return {
|
|
159
|
+
success: false,
|
|
160
|
+
error: 'Missing token in PayPal redirect query',
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return this.executePayment(paymentId);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
exports.PayPalProvider = PayPalProvider;
|
|
167
|
+
//# sourceMappingURL=paypal.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paypal.provider.js","sourceRoot":"","sources":["../../../src/providers/paypal/paypal.provider.ts"],"names":[],"mappings":";;;AAAA,iEAMmC;AACnC,kGAAoF;AAWpF;;;;GAIG;AACH,MAAa,cAAe,SAAQ,oDAAmB;IAQrD,YAA6B,MAA4B;QACvD,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAsB;QAPhD,SAAI,GAAG,QAAQ,CAAC;QAChB,SAAI,GAAG,UAAmB,CAAC;QAQlC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC;QAEnE,IAAI,CAAC,MAAM,GAAG,IAAI,0BAAM,CAAC;YACvB,gCAAgC,EAAE;gBAChC,aAAa,EAAE,QAAQ;gBACvB,iBAAiB,EAAE,YAAY;aAChC;YACD,WAAW,EACT,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,+BAAW,CAAC,UAAU,CAAC,CAAC,CAAC,+BAAW,CAAC,OAAO;YACvE,OAAO,EAAE;gBACP,QAAQ,EAAE,4BAAQ,CAAC,KAAK;aACzB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,IAAI,oCAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,kBAAkB,GAAG,IAAI,sCAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAAuB;QACzC,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,WAAW,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O,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,iCAAiC,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,cAAc,CAAC,KAA6B;QAChD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,wCAAwC;aAChD,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AA9KD,wCA8KC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BasePaymentProvider } from '../../abstract/base-payment-provider.abstract';
|
|
2
|
+
import { PaymentRequest } from '../../models/payment-request.model';
|
|
3
|
+
import { PaymentResult, WebhookResult } from '../../models/payment-result.model';
|
|
4
|
+
import { ITransactionStore } from '../../interfaces/transaction-store.interface';
|
|
5
|
+
export interface SatispayProviderConfig {
|
|
6
|
+
keyId: string;
|
|
7
|
+
/**
|
|
8
|
+
* RSA private key in PEM format (string content, not a file path).
|
|
9
|
+
* Load with: `fs.readFileSync('private.pem', 'utf8')`
|
|
10
|
+
*/
|
|
11
|
+
privateKey: string;
|
|
12
|
+
/**
|
|
13
|
+
* Satispay RSA public key in PEM format, used to verify incoming webhook
|
|
14
|
+
* HTTP Signatures. Obtain it by calling GET /g_business/v1/consumers/{keyId}
|
|
15
|
+
* on Satispay's API for the keyId present in the webhook Authorization header.
|
|
16
|
+
* When provided, every inbound webhook whose signature cannot be verified is
|
|
17
|
+
* rejected before any business logic is executed.
|
|
18
|
+
*/
|
|
19
|
+
webhookPublicKey?: string;
|
|
20
|
+
/** @default 'sandbox' */
|
|
21
|
+
environment?: 'sandbox' | 'production';
|
|
22
|
+
/**
|
|
23
|
+
* Base URL of the host application.
|
|
24
|
+
* Used to build the `callback_url` sent to Satispay.
|
|
25
|
+
* Example: 'https://myapp.com'
|
|
26
|
+
*/
|
|
27
|
+
serverUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Custom transaction store for correlating webhooks with orders.
|
|
30
|
+
* Defaults to InMemoryTransactionStore.
|
|
31
|
+
* Use a persistent store (Redis, DB) in multi-instance deployments.
|
|
32
|
+
*/
|
|
33
|
+
transactionStore?: ITransactionStore;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Satispay Business API provider.
|
|
37
|
+
* Flow: `webhook` — creates a MATCH_CODE payment, user pays via Satispay app,
|
|
38
|
+
* Satispay calls the `callback_url` webhook, which is correlated to the order
|
|
39
|
+
* via the `ITransactionStore`. The redirect is then verified via `handleRedirect`.
|
|
40
|
+
*/
|
|
41
|
+
export declare class SatispayProvider extends BasePaymentProvider {
|
|
42
|
+
private readonly config;
|
|
43
|
+
readonly name = "satispay";
|
|
44
|
+
readonly flow: "webhook";
|
|
45
|
+
private readonly apiUrl;
|
|
46
|
+
private readonly transactionStore;
|
|
47
|
+
constructor(config: SatispayProviderConfig);
|
|
48
|
+
private buildSignatureHeaders;
|
|
49
|
+
/**
|
|
50
|
+
* Verifies the HTTP Signature in an inbound Satispay webhook request.
|
|
51
|
+
* Satispay signs webhooks with their own RSA private key; we verify using
|
|
52
|
+
* the corresponding public key supplied in `config.webhookPublicKey`.
|
|
53
|
+
*
|
|
54
|
+
* Returns `true` if the signature is valid, `false` otherwise.
|
|
55
|
+
* If no `webhookPublicKey` is configured the check is skipped and `true`
|
|
56
|
+
* is returned — callers should treat this as an unverified state.
|
|
57
|
+
*/
|
|
58
|
+
private verifyWebhookSignature;
|
|
59
|
+
private request;
|
|
60
|
+
createPayment(request: PaymentRequest): Promise<PaymentResult>;
|
|
61
|
+
/** For Satispay, execute is equivalent to a status check */
|
|
62
|
+
executePayment(paymentId: string): Promise<PaymentResult>;
|
|
63
|
+
getPaymentDetails(paymentId: string): Promise<PaymentResult>;
|
|
64
|
+
refundPayment(paymentId: string, amount?: number): Promise<PaymentResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Handles the async webhook notification from Satispay.
|
|
67
|
+
* Satispay calls this URL with `payment_id` (the Satispay payment UUID).
|
|
68
|
+
* The HTTP Signature in the Authorization header is verified against
|
|
69
|
+
* `config.webhookPublicKey` (when configured) before processing.
|
|
70
|
+
* We then confirm the payment status via an authenticated API call.
|
|
71
|
+
*/
|
|
72
|
+
handleWebhook(body: Record<string, unknown>, headers: Record<string, string>): Promise<WebhookResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Handles the redirect back to the merchant app after the Satispay flow.
|
|
75
|
+
* Looks up the transaction by `order_id` in the store, then verifies status.
|
|
76
|
+
*/
|
|
77
|
+
handleRedirect(query: Record<string, string>): Promise<PaymentResult>;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=satispay.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satispay.provider.d.ts","sourceRoot":"","sources":["../../../src/providers/satispay/satispay.provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAGjF,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB;IACzB,WAAW,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IACvC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;CACtC;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,mBAAmB;IAO3C,OAAO,CAAC,QAAQ,CAAC,MAAM;IANnC,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,IAAI,EAAG,SAAS,CAAU;IAEnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoB;gBAExB,MAAM,EAAE,sBAAsB;IAsB3D,OAAO,CAAC,qBAAqB;IAmC7B;;;;;;;;OAQG;IACH,OAAO,CAAC,sBAAsB;YAgEhB,OAAO;IAsBf,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAyCpE,4DAA4D;IACtD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIzD,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAc5D,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAmB/E;;;;;;OAMG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAwB3G;;;OAGG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;CA4B5E"}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SatispayProvider = void 0;
|
|
37
|
+
const crypto = __importStar(require("crypto"));
|
|
38
|
+
const base_payment_provider_abstract_1 = require("../../abstract/base-payment-provider.abstract");
|
|
39
|
+
const in_memory_transaction_store_1 = require("../../stores/in-memory-transaction.store");
|
|
40
|
+
/**
|
|
41
|
+
* Satispay Business API provider.
|
|
42
|
+
* Flow: `webhook` — creates a MATCH_CODE payment, user pays via Satispay app,
|
|
43
|
+
* Satispay calls the `callback_url` webhook, which is correlated to the order
|
|
44
|
+
* via the `ITransactionStore`. The redirect is then verified via `handleRedirect`.
|
|
45
|
+
*/
|
|
46
|
+
class SatispayProvider extends base_payment_provider_abstract_1.BasePaymentProvider {
|
|
47
|
+
constructor(config) {
|
|
48
|
+
super();
|
|
49
|
+
this.config = config;
|
|
50
|
+
this.name = 'satispay';
|
|
51
|
+
this.flow = 'webhook';
|
|
52
|
+
this.apiUrl =
|
|
53
|
+
config.environment === 'production'
|
|
54
|
+
? 'https://authservices.satispay.com/g_business/v1'
|
|
55
|
+
: 'https://staging.authservices.satispay.com/g_business/v1';
|
|
56
|
+
this.transactionStore = config.transactionStore ?? new in_memory_transaction_store_1.InMemoryTransactionStore();
|
|
57
|
+
if (!config.webhookPublicKey) {
|
|
58
|
+
console.warn('[SatispayProvider] webhookPublicKey is not configured: ' +
|
|
59
|
+
'incoming webhook signatures will NOT be verified. ' +
|
|
60
|
+
'Anyone who knows the webhook URL can send fake payment notifications. ' +
|
|
61
|
+
'Set webhookPublicKey in SatispayProviderConfig before deploying to production.');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Authentication
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
buildSignatureHeaders(method, path, host, body) {
|
|
68
|
+
const bodyString = body ? JSON.stringify(body) : '';
|
|
69
|
+
const digest = 'SHA-256=' + crypto.createHash('sha256').update(bodyString).digest('base64');
|
|
70
|
+
const date = new Date().toUTCString();
|
|
71
|
+
const requestTarget = `${method.toLowerCase()} ${path}`;
|
|
72
|
+
const message = `(request-target): ${requestTarget}\n` +
|
|
73
|
+
`host: ${host}\n` +
|
|
74
|
+
`date: ${date}\n` +
|
|
75
|
+
`digest: ${digest}`;
|
|
76
|
+
const sign = crypto.createSign('RSA-SHA256');
|
|
77
|
+
sign.update(message);
|
|
78
|
+
const signature = sign.sign(this.config.privateKey, 'base64');
|
|
79
|
+
const authorization = `Signature keyId="${this.config.keyId}", algorithm="rsa-sha256", ` +
|
|
80
|
+
`headers="(request-target) host date digest", signature="${signature}"`;
|
|
81
|
+
return {
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
'Host': host,
|
|
84
|
+
'Date': date,
|
|
85
|
+
'Digest': digest,
|
|
86
|
+
'Authorization': authorization,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Verifies the HTTP Signature in an inbound Satispay webhook request.
|
|
91
|
+
* Satispay signs webhooks with their own RSA private key; we verify using
|
|
92
|
+
* the corresponding public key supplied in `config.webhookPublicKey`.
|
|
93
|
+
*
|
|
94
|
+
* Returns `true` if the signature is valid, `false` otherwise.
|
|
95
|
+
* If no `webhookPublicKey` is configured the check is skipped and `true`
|
|
96
|
+
* is returned — callers should treat this as an unverified state.
|
|
97
|
+
*/
|
|
98
|
+
verifyWebhookSignature(body, headers) {
|
|
99
|
+
if (!this.config.webhookPublicKey) {
|
|
100
|
+
return true; // verification skipped — no public key configured
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
const authHeader = headers['authorization'] ?? headers['Authorization'];
|
|
104
|
+
if (!authHeader)
|
|
105
|
+
return false;
|
|
106
|
+
// Parse the Signature params from the Authorization header.
|
|
107
|
+
// Format: Signature keyId="...", algorithm="...", headers="...", signature="..."
|
|
108
|
+
// Use indexOf-based parsing to avoid ReDoS-prone regexes on untrusted input.
|
|
109
|
+
const sigParams = {};
|
|
110
|
+
const schemePrefix = 'Signature ';
|
|
111
|
+
const paramStr = authHeader.startsWith(schemePrefix)
|
|
112
|
+
? authHeader.slice(schemePrefix.length)
|
|
113
|
+
: authHeader;
|
|
114
|
+
for (const part of paramStr.split(',')) {
|
|
115
|
+
const eqIdx = part.indexOf('="');
|
|
116
|
+
if (eqIdx === -1)
|
|
117
|
+
continue;
|
|
118
|
+
const key = part.slice(0, eqIdx).trim();
|
|
119
|
+
const valueStart = eqIdx + 2;
|
|
120
|
+
const valueEnd = part.lastIndexOf('"');
|
|
121
|
+
if (valueEnd <= valueStart)
|
|
122
|
+
continue;
|
|
123
|
+
const value = part.slice(valueStart, valueEnd);
|
|
124
|
+
if (key)
|
|
125
|
+
sigParams[key] = value;
|
|
126
|
+
}
|
|
127
|
+
const { signature, headers: signedHeaders = '(request-target) host date digest' } = sigParams;
|
|
128
|
+
if (!signature)
|
|
129
|
+
return false;
|
|
130
|
+
// Reconstruct the signed message from the incoming headers
|
|
131
|
+
const headerNames = signedHeaders.split(' ');
|
|
132
|
+
const bodyString = body ? JSON.stringify(body) : '';
|
|
133
|
+
const digest = 'SHA-256=' + crypto.createHash('sha256').update(bodyString).digest('base64');
|
|
134
|
+
const parts = [];
|
|
135
|
+
for (const name of headerNames) {
|
|
136
|
+
if (name === 'digest') {
|
|
137
|
+
parts.push(`digest: ${digest}`);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
const value = headers[name] ??
|
|
141
|
+
headers[name.toLowerCase()] ??
|
|
142
|
+
headers[name.toUpperCase()];
|
|
143
|
+
if (value === undefined)
|
|
144
|
+
return false;
|
|
145
|
+
parts.push(`${name}: ${value}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const message = parts.join('\n');
|
|
149
|
+
const verify = crypto.createVerify('RSA-SHA256');
|
|
150
|
+
verify.update(message);
|
|
151
|
+
return verify.verify(this.config.webhookPublicKey, signature, 'base64');
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async request(method, url, body) {
|
|
158
|
+
const parsed = new URL(url);
|
|
159
|
+
const headers = this.buildSignatureHeaders(method, parsed.pathname, parsed.host, body);
|
|
160
|
+
const response = await fetch(url, {
|
|
161
|
+
method,
|
|
162
|
+
headers,
|
|
163
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
164
|
+
});
|
|
165
|
+
const text = await response.text();
|
|
166
|
+
if (!response.ok) {
|
|
167
|
+
throw new Error(`Satispay API ${response.status}: ${text}`);
|
|
168
|
+
}
|
|
169
|
+
return JSON.parse(text);
|
|
170
|
+
}
|
|
171
|
+
// ---------------------------------------------------------------------------
|
|
172
|
+
// IPaymentProvider implementation
|
|
173
|
+
// ---------------------------------------------------------------------------
|
|
174
|
+
async createPayment(request) {
|
|
175
|
+
try {
|
|
176
|
+
const orderId = request.orderId ?? `ORD-${Date.now()}`;
|
|
177
|
+
const baseUrl = this.config.serverUrl ?? '';
|
|
178
|
+
// Satispay replaces {uuid} at runtime with the actual payment ID
|
|
179
|
+
const callbackUrl = `${baseUrl}/checkout/satispay/webhook?order_id=${orderId}&payment_id={uuid}`;
|
|
180
|
+
const body = {
|
|
181
|
+
flow: 'MATCH_CODE',
|
|
182
|
+
amount_unit: Math.round(request.amount * 100),
|
|
183
|
+
currency: request.currency,
|
|
184
|
+
external_code: orderId,
|
|
185
|
+
callback_url: callbackUrl,
|
|
186
|
+
redirect_url: request.returnUrl,
|
|
187
|
+
metadata: request.metadata,
|
|
188
|
+
};
|
|
189
|
+
const payment = await this.request('POST', `${this.apiUrl}/payments`, body);
|
|
190
|
+
// Persist the mapping orderId → paymentId for later webhook correlation
|
|
191
|
+
await this.transactionStore.save(orderId, {
|
|
192
|
+
provider: 'satispay',
|
|
193
|
+
orderId,
|
|
194
|
+
paymentId: payment['id'],
|
|
195
|
+
createdAt: new Date().toISOString(),
|
|
196
|
+
});
|
|
197
|
+
return {
|
|
198
|
+
success: true,
|
|
199
|
+
paymentId: payment['id'],
|
|
200
|
+
approvalUrl: (payment['redirect_url'] ?? payment['url_checkout']),
|
|
201
|
+
status: payment['status'],
|
|
202
|
+
raw: payment,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
return this.errorResult(error, 'Failed to create Satispay payment');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/** For Satispay, execute is equivalent to a status check */
|
|
210
|
+
async executePayment(paymentId) {
|
|
211
|
+
return this.getPaymentDetails(paymentId);
|
|
212
|
+
}
|
|
213
|
+
async getPaymentDetails(paymentId) {
|
|
214
|
+
try {
|
|
215
|
+
const payment = await this.request('GET', `${this.apiUrl}/payments/${paymentId}`);
|
|
216
|
+
return {
|
|
217
|
+
success: true,
|
|
218
|
+
paymentId: payment['id'],
|
|
219
|
+
status: payment['status'],
|
|
220
|
+
raw: payment,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
return this.errorResult(error, 'Failed to get Satispay payment details');
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async refundPayment(paymentId, amount) {
|
|
228
|
+
try {
|
|
229
|
+
const body = amount ? { amount_unit: Math.round(amount * 100) } : {};
|
|
230
|
+
const refund = await this.request('POST', `${this.apiUrl}/payments/${paymentId}/refunds`, body);
|
|
231
|
+
return {
|
|
232
|
+
success: true,
|
|
233
|
+
paymentId: refund['id'],
|
|
234
|
+
status: refund['status'],
|
|
235
|
+
raw: refund,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
return this.errorResult(error, 'Failed to refund Satispay payment');
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Handles the async webhook notification from Satispay.
|
|
244
|
+
* Satispay calls this URL with `payment_id` (the Satispay payment UUID).
|
|
245
|
+
* The HTTP Signature in the Authorization header is verified against
|
|
246
|
+
* `config.webhookPublicKey` (when configured) before processing.
|
|
247
|
+
* We then confirm the payment status via an authenticated API call.
|
|
248
|
+
*/
|
|
249
|
+
async handleWebhook(body, headers) {
|
|
250
|
+
if (!this.verifyWebhookSignature(body, headers)) {
|
|
251
|
+
return { success: false, error: 'Webhook signature verification failed' };
|
|
252
|
+
}
|
|
253
|
+
const paymentId = body['payment_id'] ?? body['id'];
|
|
254
|
+
if (!paymentId) {
|
|
255
|
+
return { success: false, error: 'Missing payment_id in webhook body' };
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
const payment = await this.request('GET', `${this.apiUrl}/payments/${paymentId}`);
|
|
259
|
+
return {
|
|
260
|
+
success: payment['status'] === 'ACCEPTED',
|
|
261
|
+
paymentId: payment['id'],
|
|
262
|
+
status: payment['status'],
|
|
263
|
+
raw: payment,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
const msg = error instanceof Error ? error.message : 'Webhook handling failed';
|
|
268
|
+
return { success: false, paymentId, error: msg };
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Handles the redirect back to the merchant app after the Satispay flow.
|
|
273
|
+
* Looks up the transaction by `order_id` in the store, then verifies status.
|
|
274
|
+
*/
|
|
275
|
+
async handleRedirect(query) {
|
|
276
|
+
const orderId = query['order_id'];
|
|
277
|
+
if (!orderId) {
|
|
278
|
+
return { success: false, error: 'Missing order_id in redirect query' };
|
|
279
|
+
}
|
|
280
|
+
const transaction = await this.transactionStore.get(orderId);
|
|
281
|
+
if (!transaction?.paymentId) {
|
|
282
|
+
return {
|
|
283
|
+
success: false,
|
|
284
|
+
error: `Transaction not found for order '${orderId}'. ` +
|
|
285
|
+
'Ensure the webhook was received before the redirect.',
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
const details = await this.getPaymentDetails(transaction.paymentId);
|
|
289
|
+
if (details.success && details.status === 'ACCEPTED') {
|
|
290
|
+
await this.transactionStore.delete(orderId);
|
|
291
|
+
}
|
|
292
|
+
return {
|
|
293
|
+
success: details.success && details.status === 'ACCEPTED',
|
|
294
|
+
paymentId: details.paymentId,
|
|
295
|
+
status: details.status,
|
|
296
|
+
raw: details.raw,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
exports.SatispayProvider = SatispayProvider;
|
|
301
|
+
//# sourceMappingURL=satispay.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satispay.provider.js","sourceRoot":"","sources":["../../../src/providers/satispay/satispay.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACnD,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,cAAc,CAAC,KAA6B;QAChD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oCAAoC,EAAE,CAAC;QACzE,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,CAAC;YAC5B,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,oCAAoC,OAAO,KAAK;oBACrD,sDAAsD;aACzD,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAEpE,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACrD,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;QAED,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU;YACzD,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,EAAE,OAAO,CAAC,GAAG;SACjB,CAAC;IACJ,CAAC;CACF;AA7SD,4CA6SC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ITransactionStore, TransactionData } from '../interfaces/transaction-store.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Built-in in-memory transaction store.
|
|
4
|
+
* Suitable for development and single-process deployments.
|
|
5
|
+
*
|
|
6
|
+
* For production multi-instance deployments, implement `ITransactionStore`
|
|
7
|
+
* backed by Redis, PostgreSQL, MongoDB, etc.
|
|
8
|
+
*/
|
|
9
|
+
export declare class InMemoryTransactionStore implements ITransactionStore {
|
|
10
|
+
private readonly store;
|
|
11
|
+
save(key: string, data: TransactionData): Promise<void>;
|
|
12
|
+
get(key: string): Promise<TransactionData | null>;
|
|
13
|
+
delete(key: string): Promise<void>;
|
|
14
|
+
/** Returns the number of stored transactions (useful for testing) */
|
|
15
|
+
get size(): number;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=in-memory-transaction.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-transaction.store.d.ts","sourceRoot":"","sources":["../../src/stores/in-memory-transaction.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAE/F;;;;;;GAMG;AACH,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2C;IAE3D,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAIjD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,qEAAqE;IACrE,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemoryTransactionStore = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Built-in in-memory transaction store.
|
|
6
|
+
* Suitable for development and single-process deployments.
|
|
7
|
+
*
|
|
8
|
+
* For production multi-instance deployments, implement `ITransactionStore`
|
|
9
|
+
* backed by Redis, PostgreSQL, MongoDB, etc.
|
|
10
|
+
*/
|
|
11
|
+
class InMemoryTransactionStore {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.store = new Map();
|
|
14
|
+
}
|
|
15
|
+
async save(key, data) {
|
|
16
|
+
this.store.set(key, { ...data });
|
|
17
|
+
}
|
|
18
|
+
async get(key) {
|
|
19
|
+
return this.store.get(key) ?? null;
|
|
20
|
+
}
|
|
21
|
+
async delete(key) {
|
|
22
|
+
this.store.delete(key);
|
|
23
|
+
}
|
|
24
|
+
/** Returns the number of stored transactions (useful for testing) */
|
|
25
|
+
get size() {
|
|
26
|
+
return this.store.size;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.InMemoryTransactionStore = InMemoryTransactionStore;
|
|
30
|
+
//# sourceMappingURL=in-memory-transaction.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-transaction.store.js","sourceRoot":"","sources":["../../src/stores/in-memory-transaction.store.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,MAAa,wBAAwB;IAArC;QACmB,UAAK,GAAiC,IAAI,GAAG,EAAE,CAAC;IAkBnE,CAAC;IAhBC,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,IAAqB;QAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,qEAAqE;IACrE,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAnBD,4DAmBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "awesome-node-checkout",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Framework-agnostic payment checkout library for Node.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@paypal/paypal-server-sdk": "^2.2.0"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|