kassza 0.18.0 → 0.19.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/README.md +1 -1
- package/dist/batch/index.cjs +5 -7
- package/dist/batch/index.d.cts +5 -9
- package/dist/batch/index.d.ts +5 -9
- package/dist/batch/index.js +5 -7
- package/dist/{binary-B89HM03_.cjs → binary-CdpKlNNI.cjs} +1 -2
- package/dist/{binary-D0M9U2MD.js → binary-DuKBSfH-.js} +1 -2
- package/dist/cli.cjs +14 -21
- package/dist/cli.js +14 -21
- package/dist/{client-DeWWQ-RZ.d.ts → client-BT2odGYl.d.cts} +8 -36
- package/dist/{client-SVZu25MB.d.cts → client-C-SYCiOZ.d.ts} +8 -36
- package/dist/{client-Cvb9yfxU.cjs → client-I_29IPMh.cjs} +25 -37
- package/dist/{client-CdWEA0et.js → client-JZ1M1sZX.js} +25 -37
- package/dist/{context-kb33TgzE.d.ts → context-BuX6Eion.d.ts} +6 -24
- package/dist/{context-CFNKzStE.d.cts → context-PwqY4JOK.d.cts} +6 -24
- package/dist/cookie-stores/index.cjs +2 -2
- package/dist/cookie-stores/index.d.cts +3 -3
- package/dist/cookie-stores/index.d.ts +3 -3
- package/dist/cookie-stores/index.js +2 -2
- package/dist/{create-CflXrPip.js → create-BwRslos0.js} +9 -12
- package/dist/{create-CvUvLUaT.cjs → create-DH5jiZPA.cjs} +9 -12
- package/dist/{create-once-CW0x_yvp.js → create-once-B6cAXyET.js} +16 -22
- package/dist/{create-once-VKp0tVow.d.ts → create-once-CiGUjXut.d.ts} +3 -7
- package/dist/{create-once-Bh6fOWkW.d.cts → create-once-CyaVT36b.d.cts} +3 -7
- package/dist/{create-once-CHhDz0un.cjs → create-once-zeF7GVVP.cjs} +16 -22
- package/dist/{crypto-Dpn4FHQ6.cjs → crypto-B0PAHKJB.cjs} +1 -2
- package/dist/{crypto-usDg8L2K.js → crypto-BqGn_oGu.js} +1 -2
- package/dist/data-link/index.cjs +10 -13
- package/dist/data-link/index.d.cts +1 -5
- package/dist/data-link/index.d.ts +1 -5
- package/dist/data-link/index.js +10 -13
- package/dist/{dates-CXyj7Azy.js → dates-DWsZOdaO.js} +1 -2
- package/dist/{dates-9zvESP0i.d.cts → dates-nlGEokCf.d.cts} +0 -2
- package/dist/{dates-9zvESP0i.d.ts → dates-nlGEokCf.d.ts} +0 -2
- package/dist/{dates-CPgBodkP.cjs → dates-oOp3ypPP.cjs} +1 -2
- package/dist/delegation/index.cjs +9 -12
- package/dist/delegation/index.d.cts +3 -9
- package/dist/delegation/index.d.ts +3 -9
- package/dist/delegation/index.js +9 -12
- package/dist/{errors-EE96_6D_.cjs → errors-Bn6pe6yw.cjs} +12 -3
- package/dist/{errors-DtN4g5Z9.js → errors-CGGsW0Y5.js} +12 -3
- package/dist/{get-Byc9T5WO.d.cts → get-BL4Fr8-P.d.cts} +0 -2
- package/dist/{get-Byc9T5WO.d.ts → get-BL4Fr8-P.d.ts} +0 -2
- package/dist/{get-BdMTseh4.cjs → get-DFhT7kOp.cjs} +4 -5
- package/dist/{get-CZEShCcj.js → get-HrHwVkVt.js} +4 -5
- package/dist/{index-C-7yWV7L.d.cts → index-CinpAhQM.d.cts} +0 -8
- package/dist/{index-C-7yWV7L.d.ts → index-CinpAhQM.d.ts} +0 -8
- package/dist/{index-BqGgQ4t3.d.ts → index-DqoDUw6X.d.ts} +2 -20
- package/dist/{index-BhUPY_EH.d.cts → index-qk62lWr3.d.cts} +2 -20
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +7 -7
- package/dist/ipn/index.cjs +4 -6
- package/dist/ipn/index.d.cts +0 -4
- package/dist/ipn/index.d.ts +0 -4
- package/dist/ipn/index.js +4 -6
- package/dist/{issue-Bin4tKD_.cjs → issue-DReARZnF.cjs} +12 -18
- package/dist/{issue-DMA1Nbr1.js → issue-Dy9zvRK1.js} +12 -18
- package/dist/journal/index.cjs +7 -11
- package/dist/journal/index.d.cts +2 -6
- package/dist/journal/index.d.ts +2 -6
- package/dist/journal/index.js +7 -11
- package/dist/{journal-Y9qrIB8G.d.ts → journal-BNdo07p5.d.ts} +5 -9
- package/dist/{journal-DvI81Kt7.d.cts → journal-DI-hOW6N.d.cts} +5 -9
- package/dist/{json-4y4E2xxS.cjs → json-COC9rDwf.cjs} +1 -2
- package/dist/json-D3Bx7NhF.d.cts +2 -0
- package/dist/json-D3Bx7NhF.d.ts +2 -0
- package/dist/{json-DjnqnaJK.js → json-as-6J7d-.js} +1 -2
- package/dist/mcp/index.cjs +1 -1
- package/dist/mcp/index.d.cts +1 -9
- package/dist/mcp/index.d.ts +1 -9
- package/dist/mcp/index.js +1 -2
- package/dist/money/index.cjs +3 -3
- package/dist/money/index.d.cts +1 -1
- package/dist/money/index.d.ts +1 -1
- package/dist/money/index.js +3 -3
- package/dist/{money-K9j0wPit.cjs → money-NtVytaxG.cjs} +5 -7
- package/dist/{money-Cw457SD6.js → money-f280VT77.js} +5 -7
- package/dist/nav/index.cjs +15 -22
- package/dist/nav/index.d.cts +2 -22
- package/dist/nav/index.d.ts +2 -22
- package/dist/nav/index.js +15 -22
- package/dist/{nav-BcCerwWS.js → nav-NvNgaONz.js} +5 -7
- package/dist/{nav-BNbc8U0R.cjs → nav-VShZkjg8.cjs} +5 -7
- package/dist/node/index.cjs +1 -2
- package/dist/node/index.d.cts +1 -3
- package/dist/node/index.d.ts +1 -3
- package/dist/node/index.js +1 -2
- package/dist/observe/index.cjs +3 -5
- package/dist/observe/index.d.cts +1 -5
- package/dist/observe/index.d.ts +1 -5
- package/dist/observe/index.js +3 -5
- package/dist/{once-BN_3B5OF.cjs → once-BmXfrNbQ.cjs} +2 -3
- package/dist/{once-CqqZxsXG.js → once-CMhDPrs7.js} +2 -3
- package/dist/{parse-Cr7yQ3_z.js → parse-1RiSh4vY.js} +5 -7
- package/dist/{parse-DOA2XQ3e.cjs → parse-CmM5va-p.cjs} +5 -7
- package/dist/payments/barion.cjs +7 -6
- package/dist/payments/barion.d.cts +4 -6
- package/dist/payments/barion.d.ts +4 -6
- package/dist/payments/barion.js +7 -6
- package/dist/payments/index.cjs +2 -2
- package/dist/payments/index.d.cts +3 -9
- package/dist/payments/index.d.ts +3 -9
- package/dist/payments/index.js +2 -2
- package/dist/payments/paypal.cjs +8 -7
- package/dist/payments/paypal.d.cts +4 -6
- package/dist/payments/paypal.d.ts +4 -6
- package/dist/payments/paypal.js +8 -7
- package/dist/payments/revolut.cjs +7 -6
- package/dist/payments/revolut.d.cts +4 -6
- package/dist/payments/revolut.d.ts +4 -6
- package/dist/payments/revolut.js +7 -6
- package/dist/payments/simplepay.cjs +9 -8
- package/dist/payments/simplepay.d.cts +4 -6
- package/dist/payments/simplepay.d.ts +4 -6
- package/dist/payments/simplepay.js +9 -8
- package/dist/payments/stripe.cjs +6 -6
- package/dist/payments/stripe.d.cts +4 -6
- package/dist/payments/stripe.d.ts +4 -6
- package/dist/payments/stripe.js +6 -6
- package/dist/{push-BXj0Sf0Z.d.ts → push-CTxDD3yJ.d.cts} +2 -4
- package/dist/{push-D4nNbCNV.d.cts → push-DJh5YkyV.d.ts} +2 -4
- package/dist/{reference-B5TATqb5.js → reference-Cxz0m2zF.js} +6 -7
- package/dist/{reference-BIdYMK0t.cjs → reference-DoY12fc1.cjs} +6 -7
- package/dist/reports/index.cjs +3 -4
- package/dist/reports/index.d.cts +1 -7
- package/dist/reports/index.d.ts +1 -7
- package/dist/reports/index.js +3 -4
- package/dist/{request-body-uZHMRlQr.js → request-body-BM4sbsHd.js} +2 -3
- package/dist/{request-body-CH6ZGOrq.cjs → request-body-BhfkJhff.cjs} +2 -3
- package/dist/{rounding-TxoWy2ww.cjs → rounding-CHmSK5Z2.cjs} +1 -2
- package/dist/{rounding-BLyHjjI5.js → rounding-CZLj4DbV.js} +1 -2
- package/dist/{serialize-B2eFh3D-.js → serialize-CjymGkJj.js} +2 -4
- package/dist/{serialize-CquIsxA-.cjs → serialize-DEU7r6Bk.cjs} +2 -4
- package/dist/{server-B9guio75.cjs → server-BZ-ySQGx.cjs} +23 -35
- package/dist/{server-yx9eG_8p.js → server-CDwsjBWk.js} +23 -35
- package/dist/{session-Ckl5eJhV.d.ts → session-BBbSXlx3.d.cts} +1 -3
- package/dist/{session-DeM5vjvC.cjs → session-BYotpR_s.cjs} +2 -4
- package/dist/{session-SaEEXu2N.js → session-DZeE1ryt.js} +2 -4
- package/dist/{session-YbChChx7.d.cts → session-mKtpAeUB.d.ts} +1 -3
- package/dist/{shared-CrxlxI8n.cjs → shared-BOBTXDTo.cjs} +5 -6
- package/dist/{shared-D6DLa4b7.js → shared-Dbcfwr8x.js} +5 -6
- package/dist/storage/fs.cjs +3 -4
- package/dist/storage/fs.d.cts +2 -4
- package/dist/storage/fs.d.ts +2 -4
- package/dist/storage/fs.js +3 -4
- package/dist/storage/index.cjs +16 -25
- package/dist/storage/index.d.cts +2 -26
- package/dist/storage/index.d.ts +2 -26
- package/dist/storage/index.js +16 -25
- package/dist/{store-C1rHd9DB.d.cts → store-BkaZ8qkU.d.cts} +0 -2
- package/dist/{store-C1rHd9DB.d.ts → store-BkaZ8qkU.d.ts} +0 -2
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.d.cts +3 -3
- package/dist/stores/index.d.ts +3 -3
- package/dist/stores/index.js +2 -2
- package/dist/{stores-DhjGBrl_.js → stores-BUnPNJQl.js} +12 -22
- package/dist/{stores-BNrS0dWl.cjs → stores-CH4rYKs_.cjs} +12 -22
- package/dist/{tax-number-BdqKsxNR.js → tax-number-C6jySuGR.js} +3 -6
- package/dist/{tax-number-BYFkBp4A.cjs → tax-number-XLdM5ETv.cjs} +3 -6
- package/dist/testing/index.cjs +20 -30
- package/dist/testing/index.d.cts +5 -15
- package/dist/testing/index.d.ts +5 -15
- package/dist/testing/index.js +20 -30
- package/dist/{types-DVRgwcqg.d.cts → types-Bfs08Mrc.d.cts} +0 -2
- package/dist/{types-DVRgwcqg.d.ts → types-Bfs08Mrc.d.ts} +0 -2
- package/dist/{types-ByAEvGsZ.d.ts → types-DeuUqIvU.d.cts} +2 -4
- package/dist/{types-D1zDOH_F.d.ts → types-Z6rQoqHn.d.ts} +1 -3
- package/dist/{types-lnKkQdot.d.cts → types-_HKTOCuQ.d.cts} +1 -3
- package/dist/{types-B1A8mUIE.d.cts → types-oiDulesz.d.ts} +2 -4
- package/dist/url-CRIlLxPE.cjs +23 -0
- package/dist/url-DeCMiKVm.js +12 -0
- package/dist/validators/index.cjs +6 -10
- package/dist/validators/index.d.cts +0 -12
- package/dist/validators/index.d.ts +0 -12
- package/dist/validators/index.js +6 -10
- package/dist/{vat-v_dcWCto.js → vat-B4J5Q0tu.js} +1 -2
- package/dist/{vat-g35srbNG.cjs → vat-BkoiiKm4.cjs} +1 -2
- package/dist/{warnings-DwTl5J-2.js → warnings-DJ0QvZOp.js} +1 -2
- package/dist/{warnings-B3DXnveC.d.cts → warnings-DpuYhn39.d.cts} +0 -4
- package/dist/{warnings-B3DXnveC.d.ts → warnings-DpuYhn39.d.ts} +0 -4
- package/dist/{warnings-DeIw5RFj.cjs → warnings-ciSzK6Jc.cjs} +1 -2
- package/dist/{webhook-Ckj-_hPD.cjs → webhook-BBTebz1x.cjs} +7 -11
- package/dist/{webhook-D6lEejob.d.ts → webhook-C9IBUdeT.d.ts} +1 -3
- package/dist/{webhook-CmdhGiH5.d.cts → webhook-DF2p_m2Q.d.cts} +1 -3
- package/dist/{webhook-CQVShAfI.js → webhook-SFlA_nCf.js} +7 -11
- package/package.json +1 -1
- package/dist/json-B70TwoX1.d.cts +0 -4
- package/dist/json-B70TwoX1.d.ts +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
const require_binary = require("./binary-
|
|
3
|
-
const require_serialize = require("./serialize-
|
|
4
|
-
|
|
1
|
+
const require_errors = require("./errors-Bn6pe6yw.cjs");
|
|
2
|
+
const require_binary = require("./binary-CdpKlNNI.cjs");
|
|
3
|
+
const require_serialize = require("./serialize-DEU7r6Bk.cjs");
|
|
4
|
+
// src/core/response.ts
|
|
5
5
|
function createAgentResponse(action, status, headers, body) {
|
|
6
6
|
let cachedText;
|
|
7
7
|
return {
|
|
@@ -155,8 +155,7 @@ function throwIfAnyError(response) {
|
|
|
155
155
|
throwIfTextError(response);
|
|
156
156
|
throwIfHttpError(response);
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
//#region src/receipts/parse.ts
|
|
158
|
+
// src/receipts/parse.ts
|
|
160
159
|
function requiredText(element, name, response) {
|
|
161
160
|
const value = require_serialize.childText(element, name);
|
|
162
161
|
if (value === void 0) throw unexpectedResponse(response, `Hiányzik a(z) <${name}> elem a nyugta válaszból.`);
|
|
@@ -287,7 +286,6 @@ function parseReceiptResponse(response) {
|
|
|
287
286
|
}
|
|
288
287
|
return parseReceiptXml(root, response);
|
|
289
288
|
}
|
|
290
|
-
//#endregion
|
|
291
289
|
Object.defineProperty(exports, "createAgentResponse", {
|
|
292
290
|
enumerable: true,
|
|
293
291
|
get: function() {
|
package/dist/payments/barion.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rounding = require("../rounding-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
const require_rounding = require("../rounding-CHmSK5Z2.cjs");
|
|
3
|
+
const require_url = require("../url-CRIlLxPE.cjs");
|
|
4
|
+
const require_webhook = require("../webhook-BBTebz1x.cjs");
|
|
5
|
+
const require_json = require("../json-COC9rDwf.cjs");
|
|
6
|
+
// src/payments/barion.ts
|
|
6
7
|
const BARION_LIVE_API_URL = "https://api.barion.com";
|
|
7
8
|
const BARION_SANDBOX_API_URL = "https://api.test.barion.com";
|
|
8
9
|
const BARION_CARD_METHOD = "bankkártya";
|
|
@@ -37,7 +38,8 @@ const CARD_SOURCES = /* @__PURE__ */ new Set([
|
|
|
37
38
|
"GooglePay"
|
|
38
39
|
]);
|
|
39
40
|
function apiBase(options) {
|
|
40
|
-
|
|
41
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://api.test.barion.com" : "https://api.barion.com");
|
|
42
|
+
return require_url.trimTrailingSlashes(base);
|
|
41
43
|
}
|
|
42
44
|
function barionErrors(json) {
|
|
43
45
|
return require_json.records(json?.Errors).map((error) => [
|
|
@@ -220,7 +222,6 @@ function barionWebhook(options) {
|
|
|
220
222
|
return require_webhook.plainResponse(200, "OK");
|
|
221
223
|
});
|
|
222
224
|
}
|
|
223
|
-
//#endregion
|
|
224
225
|
exports.BARION_CARD_METHOD = BARION_CARD_METHOD;
|
|
225
226
|
exports.BARION_LIVE_API_URL = BARION_LIVE_API_URL;
|
|
226
227
|
exports.BARION_SANDBOX_API_URL = BARION_SANDBOX_API_URL;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/barion.d.ts
|
|
1
|
+
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-DeuUqIvU.cjs";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.cjs";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-DF2p_m2Q.cjs";
|
|
5
4
|
export declare const BARION_LIVE_API_URL = "https://api.barion.com";
|
|
6
5
|
export declare const BARION_SANDBOX_API_URL = "https://api.test.barion.com";
|
|
7
6
|
export declare const BARION_CARD_METHOD = "bankkártya";
|
|
@@ -24,5 +23,4 @@ export interface BarionWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
24
23
|
readonly sandbox?: boolean | undefined;
|
|
25
24
|
readonly apiUrl?: string | undefined;
|
|
26
25
|
}
|
|
27
|
-
export declare function barionWebhook(options: BarionWebhookOptions): WebhookHandler;
|
|
28
|
-
//#endregion
|
|
26
|
+
export declare function barionWebhook(options: BarionWebhookOptions): WebhookHandler;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/barion.d.ts
|
|
1
|
+
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-oiDulesz.js";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.js";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-C9IBUdeT.js";
|
|
5
4
|
export declare const BARION_LIVE_API_URL = "https://api.barion.com";
|
|
6
5
|
export declare const BARION_SANDBOX_API_URL = "https://api.test.barion.com";
|
|
7
6
|
export declare const BARION_CARD_METHOD = "bankkártya";
|
|
@@ -24,5 +23,4 @@ export interface BarionWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
24
23
|
readonly sandbox?: boolean | undefined;
|
|
25
24
|
readonly apiUrl?: string | undefined;
|
|
26
25
|
}
|
|
27
|
-
export declare function barionWebhook(options: BarionWebhookOptions): WebhookHandler;
|
|
28
|
-
//#endregion
|
|
26
|
+
export declare function barionWebhook(options: BarionWebhookOptions): WebhookHandler;
|
package/dist/payments/barion.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { r as roundMoney } from "../rounding-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { r as roundMoney } from "../rounding-CZLj4DbV.js";
|
|
2
|
+
import { n as trimTrailingSlashes } from "../url-DeCMiKVm.js";
|
|
3
|
+
import { c as plainResponse, d as WebhookVerificationError, h as normalizeCurrency, i as respondToWebhook, l as readRawBody, r as deliverPayment, u as PaymentProviderError } from "../webhook-SFlA_nCf.js";
|
|
4
|
+
import { a as text, i as records, r as record, t as numeric } from "../json-as-6J7d-.js";
|
|
5
|
+
// src/payments/barion.ts
|
|
5
6
|
const BARION_LIVE_API_URL = "https://api.barion.com";
|
|
6
7
|
const BARION_SANDBOX_API_URL = "https://api.test.barion.com";
|
|
7
8
|
const BARION_CARD_METHOD = "bankkártya";
|
|
@@ -36,7 +37,8 @@ const CARD_SOURCES = /* @__PURE__ */ new Set([
|
|
|
36
37
|
"GooglePay"
|
|
37
38
|
]);
|
|
38
39
|
function apiBase(options) {
|
|
39
|
-
|
|
40
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://api.test.barion.com" : "https://api.barion.com");
|
|
41
|
+
return trimTrailingSlashes(base);
|
|
40
42
|
}
|
|
41
43
|
function barionErrors(json) {
|
|
42
44
|
return records(json?.Errors).map((error) => [
|
|
@@ -219,5 +221,4 @@ function barionWebhook(options) {
|
|
|
219
221
|
return plainResponse(200, "OK");
|
|
220
222
|
});
|
|
221
223
|
}
|
|
222
|
-
//#endregion
|
|
223
224
|
export { BARION_CARD_METHOD, BARION_LIVE_API_URL, BARION_SANDBOX_API_URL, BARION_TRANSFER_METHOD, BARION_WALLET_METHOD, barionPaymentEvent, barionPaymentId, barionWebhook, fetchBarionPaymentState };
|
package/dist/payments/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_issue = require("../issue-
|
|
3
|
-
const require_webhook = require("../webhook-
|
|
2
|
+
const require_issue = require("../issue-DReARZnF.cjs");
|
|
3
|
+
const require_webhook = require("../webhook-BBTebz1x.cjs");
|
|
4
4
|
exports.DEFAULT_DEDUPE_TTL_SECONDS = require_webhook.DEFAULT_DEDUPE_TTL_SECONDS;
|
|
5
5
|
exports.DEFAULT_MAX_WEBHOOK_BYTES = require_webhook.DEFAULT_MAX_WEBHOOK_BYTES;
|
|
6
6
|
exports.PaymentProviderError = require_webhook.PaymentProviderError;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { A as IssuedRefundCorrection, C as PaymentDocumentItem, D as issueForPayment, E as buyerFromCustomer, F as RefundProposalLine, I as correctionExternalId, M as PartialRefundMode, N as RefundItemsContext, O as paymentOrderNumber, P as RefundItemsResolver, S as IssuedReversal, T as SkippedPayment, b as IssuedInvoice, j as IssuedRefundProposal, k as IssuedCorrection, v as IssueForPaymentOptions, w as PaymentDocumentsApi, x as IssuedReceipt, y as IssuedDocument } from "../client-
|
|
2
|
-
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentRefund, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress, u as PaymentWebhookBaseOptions } from "../types-
|
|
3
|
-
import { a as respondToWebhook, i as deliverPayment, n as WEBHOOK_DEDUPE_KEY_PREFIX, o as webhookDedupeKey, r as WebhookHandler, t as DEFAULT_DEDUPE_TTL_SECONDS } from "../webhook-
|
|
4
|
-
//#region src/payments/amounts.d.ts
|
|
1
|
+
import { A as IssuedRefundCorrection, C as PaymentDocumentItem, D as issueForPayment, E as buyerFromCustomer, F as RefundProposalLine, I as correctionExternalId, M as PartialRefundMode, N as RefundItemsContext, O as paymentOrderNumber, P as RefundItemsResolver, S as IssuedReversal, T as SkippedPayment, b as IssuedInvoice, j as IssuedRefundProposal, k as IssuedCorrection, v as IssueForPaymentOptions, w as PaymentDocumentsApi, x as IssuedReceipt, y as IssuedDocument } from "../client-BT2odGYl.cjs";
|
|
2
|
+
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentRefund, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress, u as PaymentWebhookBaseOptions } from "../types-DeuUqIvU.cjs";
|
|
3
|
+
import { a as respondToWebhook, i as deliverPayment, n as WEBHOOK_DEDUPE_KEY_PREFIX, o as webhookDedupeKey, r as WebhookHandler, t as DEFAULT_DEDUPE_TTL_SECONDS } from "../webhook-DF2p_m2Q.cjs";
|
|
5
4
|
type MinorUnitConvention = "iso4217" | "stripe";
|
|
6
5
|
export declare function currencyExponent(currency: string, convention: MinorUnitConvention): number;
|
|
7
6
|
export declare function fromMinorUnits(amount: number, currency: string, convention: MinorUnitConvention): number;
|
|
8
7
|
export declare function parseDecimalAmount(value: string): number;
|
|
9
8
|
export declare function normalizeCurrency(currency: string): string;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/payments/body.d.ts
|
|
12
9
|
export declare const DEFAULT_MAX_WEBHOOK_BYTES = 1048576;
|
|
13
10
|
export declare function readRawBody(request: Request, provider: PaymentProvider, maxBytes?: number): Promise<string>;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/payments/errors.d.ts
|
|
16
11
|
type WebhookVerificationReason = "missing_signature" | "invalid_signature" | "timestamp_out_of_range" | "invalid_payload" | "payload_too_large" | "verification_failed";
|
|
17
12
|
export declare class WebhookVerificationError extends Error {
|
|
18
13
|
override readonly name: string;
|
|
@@ -27,5 +22,4 @@ export declare class PaymentProviderError extends Error {
|
|
|
27
22
|
constructor(provider: PaymentProvider, message: string, status?: number, cause?: unknown);
|
|
28
23
|
}
|
|
29
24
|
export declare function isWebhookVerificationError(error: unknown): error is WebhookVerificationError;
|
|
30
|
-
//#endregion
|
|
31
25
|
export { DEFAULT_DEDUPE_TTL_SECONDS, type IssueForPaymentOptions, type IssuedCorrection, type IssuedDocument, type IssuedInvoice, type IssuedReceipt, type IssuedRefundCorrection, type IssuedRefundProposal, type IssuedReversal, type MinorUnitConvention, type PartialRefundMode, type PaymentAddress, type PaymentAmount, type PaymentCustomer, type PaymentDocumentItem, type PaymentDocumentsApi, type PaymentEvent, type PaymentEventKind, type PaymentHandler, type PaymentLineItem, type PaymentProvider, type PaymentRefund, type PaymentWebhookBaseOptions, type RefundItemsContext, type RefundItemsResolver, type RefundProposalLine, type SkippedPayment, WEBHOOK_DEDUPE_KEY_PREFIX, type WebhookHandler, type WebhookVerificationReason, buyerFromCustomer, correctionExternalId, deliverPayment, issueForPayment, paymentOrderNumber, respondToWebhook, webhookDedupeKey };
|
package/dist/payments/index.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { A as IssuedRefundCorrection, C as PaymentDocumentItem, D as issueForPayment, E as buyerFromCustomer, F as RefundProposalLine, I as correctionExternalId, M as PartialRefundMode, N as RefundItemsContext, O as paymentOrderNumber, P as RefundItemsResolver, S as IssuedReversal, T as SkippedPayment, b as IssuedInvoice, j as IssuedRefundProposal, k as IssuedCorrection, v as IssueForPaymentOptions, w as PaymentDocumentsApi, x as IssuedReceipt, y as IssuedDocument } from "../client-
|
|
2
|
-
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentRefund, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress, u as PaymentWebhookBaseOptions } from "../types-
|
|
3
|
-
import { a as respondToWebhook, i as deliverPayment, n as WEBHOOK_DEDUPE_KEY_PREFIX, o as webhookDedupeKey, r as WebhookHandler, t as DEFAULT_DEDUPE_TTL_SECONDS } from "../webhook-
|
|
4
|
-
//#region src/payments/amounts.d.ts
|
|
1
|
+
import { A as IssuedRefundCorrection, C as PaymentDocumentItem, D as issueForPayment, E as buyerFromCustomer, F as RefundProposalLine, I as correctionExternalId, M as PartialRefundMode, N as RefundItemsContext, O as paymentOrderNumber, P as RefundItemsResolver, S as IssuedReversal, T as SkippedPayment, b as IssuedInvoice, j as IssuedRefundProposal, k as IssuedCorrection, v as IssueForPaymentOptions, w as PaymentDocumentsApi, x as IssuedReceipt, y as IssuedDocument } from "../client-C-SYCiOZ.js";
|
|
2
|
+
import { a as PaymentEventKind, c as PaymentProvider, i as PaymentEvent, l as PaymentRefund, n as PaymentAmount, o as PaymentHandler, r as PaymentCustomer, s as PaymentLineItem, t as PaymentAddress, u as PaymentWebhookBaseOptions } from "../types-oiDulesz.js";
|
|
3
|
+
import { a as respondToWebhook, i as deliverPayment, n as WEBHOOK_DEDUPE_KEY_PREFIX, o as webhookDedupeKey, r as WebhookHandler, t as DEFAULT_DEDUPE_TTL_SECONDS } from "../webhook-C9IBUdeT.js";
|
|
5
4
|
type MinorUnitConvention = "iso4217" | "stripe";
|
|
6
5
|
export declare function currencyExponent(currency: string, convention: MinorUnitConvention): number;
|
|
7
6
|
export declare function fromMinorUnits(amount: number, currency: string, convention: MinorUnitConvention): number;
|
|
8
7
|
export declare function parseDecimalAmount(value: string): number;
|
|
9
8
|
export declare function normalizeCurrency(currency: string): string;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/payments/body.d.ts
|
|
12
9
|
export declare const DEFAULT_MAX_WEBHOOK_BYTES = 1048576;
|
|
13
10
|
export declare function readRawBody(request: Request, provider: PaymentProvider, maxBytes?: number): Promise<string>;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/payments/errors.d.ts
|
|
16
11
|
type WebhookVerificationReason = "missing_signature" | "invalid_signature" | "timestamp_out_of_range" | "invalid_payload" | "payload_too_large" | "verification_failed";
|
|
17
12
|
export declare class WebhookVerificationError extends Error {
|
|
18
13
|
override readonly name: string;
|
|
@@ -27,5 +22,4 @@ export declare class PaymentProviderError extends Error {
|
|
|
27
22
|
constructor(provider: PaymentProvider, message: string, status?: number, cause?: unknown);
|
|
28
23
|
}
|
|
29
24
|
export declare function isWebhookVerificationError(error: unknown): error is WebhookVerificationError;
|
|
30
|
-
//#endregion
|
|
31
25
|
export { DEFAULT_DEDUPE_TTL_SECONDS, type IssueForPaymentOptions, type IssuedCorrection, type IssuedDocument, type IssuedInvoice, type IssuedReceipt, type IssuedRefundCorrection, type IssuedRefundProposal, type IssuedReversal, type MinorUnitConvention, type PartialRefundMode, type PaymentAddress, type PaymentAmount, type PaymentCustomer, type PaymentDocumentItem, type PaymentDocumentsApi, type PaymentEvent, type PaymentEventKind, type PaymentHandler, type PaymentLineItem, type PaymentProvider, type PaymentRefund, type PaymentWebhookBaseOptions, type RefundItemsContext, type RefundItemsResolver, type RefundProposalLine, type SkippedPayment, WEBHOOK_DEDUPE_KEY_PREFIX, type WebhookHandler, type WebhookVerificationReason, buyerFromCustomer, correctionExternalId, deliverPayment, issueForPayment, paymentOrderNumber, respondToWebhook, webhookDedupeKey };
|
package/dist/payments/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as correctionExternalId, n as issueForPayment, r as paymentOrderNumber, t as buyerFromCustomer } from "../issue-
|
|
2
|
-
import { a as webhookDedupeKey, d as WebhookVerificationError, f as isWebhookVerificationError, g as parseDecimalAmount, h as normalizeCurrency, i as respondToWebhook, l as readRawBody, m as fromMinorUnits, n as WEBHOOK_DEDUPE_KEY_PREFIX, o as DEFAULT_MAX_WEBHOOK_BYTES, p as currencyExponent, r as deliverPayment, t as DEFAULT_DEDUPE_TTL_SECONDS, u as PaymentProviderError } from "../webhook-
|
|
1
|
+
import { i as correctionExternalId, n as issueForPayment, r as paymentOrderNumber, t as buyerFromCustomer } from "../issue-Dy9zvRK1.js";
|
|
2
|
+
import { a as webhookDedupeKey, d as WebhookVerificationError, f as isWebhookVerificationError, g as parseDecimalAmount, h as normalizeCurrency, i as respondToWebhook, l as readRawBody, m as fromMinorUnits, n as WEBHOOK_DEDUPE_KEY_PREFIX, o as DEFAULT_MAX_WEBHOOK_BYTES, p as currencyExponent, r as deliverPayment, t as DEFAULT_DEDUPE_TTL_SECONDS, u as PaymentProviderError } from "../webhook-SFlA_nCf.js";
|
|
3
3
|
export { DEFAULT_DEDUPE_TTL_SECONDS, DEFAULT_MAX_WEBHOOK_BYTES, PaymentProviderError, WEBHOOK_DEDUPE_KEY_PREFIX, WebhookVerificationError, buyerFromCustomer, correctionExternalId, currencyExponent, deliverPayment, fromMinorUnits, isWebhookVerificationError, issueForPayment, normalizeCurrency, parseDecimalAmount, paymentOrderNumber, readRawBody, respondToWebhook, webhookDedupeKey };
|
package/dist/payments/paypal.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_binary = require("../binary-
|
|
3
|
-
const require_rounding = require("../rounding-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
2
|
+
const require_binary = require("../binary-CdpKlNNI.cjs");
|
|
3
|
+
const require_rounding = require("../rounding-CHmSK5Z2.cjs");
|
|
4
|
+
const require_url = require("../url-CRIlLxPE.cjs");
|
|
5
|
+
const require_webhook = require("../webhook-BBTebz1x.cjs");
|
|
6
|
+
const require_json = require("../json-COC9rDwf.cjs");
|
|
7
|
+
// src/payments/paypal.ts
|
|
7
8
|
const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
8
9
|
const PAYPAL_SANDBOX_API_URL = "https://api-m.sandbox.paypal.com";
|
|
9
10
|
const PAYPAL_METHOD = "PayPal";
|
|
@@ -21,7 +22,8 @@ const TRANSMISSION_HEADERS = {
|
|
|
21
22
|
transmissionTime: "paypal-transmission-time"
|
|
22
23
|
};
|
|
23
24
|
function apiBase(options) {
|
|
24
|
-
|
|
25
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://api-m.sandbox.paypal.com" : "https://api-m.paypal.com");
|
|
26
|
+
return require_url.trimTrailingSlashes(base);
|
|
25
27
|
}
|
|
26
28
|
async function readJson(response, what) {
|
|
27
29
|
const json = require_json.record(await response.json().catch(() => void 0));
|
|
@@ -348,7 +350,6 @@ function payPalWebhook(options) {
|
|
|
348
350
|
return require_webhook.plainResponse(200, "OK");
|
|
349
351
|
});
|
|
350
352
|
}
|
|
351
|
-
//#endregion
|
|
352
353
|
exports.PAYPAL_HANDLING_ITEM_NAME = PAYPAL_HANDLING_ITEM_NAME;
|
|
353
354
|
exports.PAYPAL_INSURANCE_ITEM_NAME = PAYPAL_INSURANCE_ITEM_NAME;
|
|
354
355
|
exports.PAYPAL_LIVE_API_URL = PAYPAL_LIVE_API_URL;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/paypal.d.ts
|
|
1
|
+
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-DeuUqIvU.cjs";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.cjs";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-DF2p_m2Q.cjs";
|
|
5
4
|
export declare const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
6
5
|
export declare const PAYPAL_SANDBOX_API_URL = "https://api-m.sandbox.paypal.com";
|
|
7
6
|
export declare const PAYPAL_METHOD = "PayPal";
|
|
@@ -55,5 +54,4 @@ export interface PayPalWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
55
54
|
readonly apiUrl?: string | undefined;
|
|
56
55
|
readonly fetchOrder?: boolean | undefined;
|
|
57
56
|
}
|
|
58
|
-
export declare function payPalWebhook(options: PayPalWebhookOptions): WebhookHandler;
|
|
59
|
-
//#endregion
|
|
57
|
+
export declare function payPalWebhook(options: PayPalWebhookOptions): WebhookHandler;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/paypal.d.ts
|
|
1
|
+
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-oiDulesz.js";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.js";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-C9IBUdeT.js";
|
|
5
4
|
export declare const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
6
5
|
export declare const PAYPAL_SANDBOX_API_URL = "https://api-m.sandbox.paypal.com";
|
|
7
6
|
export declare const PAYPAL_METHOD = "PayPal";
|
|
@@ -55,5 +54,4 @@ export interface PayPalWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
55
54
|
readonly apiUrl?: string | undefined;
|
|
56
55
|
readonly fetchOrder?: boolean | undefined;
|
|
57
56
|
}
|
|
58
|
-
export declare function payPalWebhook(options: PayPalWebhookOptions): WebhookHandler;
|
|
59
|
-
//#endregion
|
|
57
|
+
export declare function payPalWebhook(options: PayPalWebhookOptions): WebhookHandler;
|
package/dist/payments/paypal.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { i as encodeUtf8, n as bytesToBase64 } from "../binary-
|
|
2
|
-
import { r as roundMoney } from "../rounding-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { i as encodeUtf8, n as bytesToBase64 } from "../binary-DuKBSfH-.js";
|
|
2
|
+
import { r as roundMoney } from "../rounding-CZLj4DbV.js";
|
|
3
|
+
import { n as trimTrailingSlashes } from "../url-DeCMiKVm.js";
|
|
4
|
+
import { c as plainResponse, d as WebhookVerificationError, g as parseDecimalAmount, h as normalizeCurrency, i as respondToWebhook, l as readRawBody, r as deliverPayment, s as parseJsonObject, u as PaymentProviderError } from "../webhook-SFlA_nCf.js";
|
|
5
|
+
import { a as text, i as records, n as path, r as record, t as numeric } from "../json-as-6J7d-.js";
|
|
6
|
+
// src/payments/paypal.ts
|
|
6
7
|
const PAYPAL_LIVE_API_URL = "https://api-m.paypal.com";
|
|
7
8
|
const PAYPAL_SANDBOX_API_URL = "https://api-m.sandbox.paypal.com";
|
|
8
9
|
const PAYPAL_METHOD = "PayPal";
|
|
@@ -20,7 +21,8 @@ const TRANSMISSION_HEADERS = {
|
|
|
20
21
|
transmissionTime: "paypal-transmission-time"
|
|
21
22
|
};
|
|
22
23
|
function apiBase(options) {
|
|
23
|
-
|
|
24
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://api-m.sandbox.paypal.com" : "https://api-m.paypal.com");
|
|
25
|
+
return trimTrailingSlashes(base);
|
|
24
26
|
}
|
|
25
27
|
async function readJson(response, what) {
|
|
26
28
|
const json = record(await response.json().catch(() => void 0));
|
|
@@ -347,5 +349,4 @@ function payPalWebhook(options) {
|
|
|
347
349
|
return plainResponse(200, "OK");
|
|
348
350
|
});
|
|
349
351
|
}
|
|
350
|
-
//#endregion
|
|
351
352
|
export { PAYPAL_HANDLING_ITEM_NAME, PAYPAL_INSURANCE_ITEM_NAME, PAYPAL_LIVE_API_URL, PAYPAL_METHOD, PAYPAL_SANDBOX_API_URL, PAYPAL_SHIPPING_ITEM_NAME, parsePayPalEvent, payPalApi, payPalCaptureIdOfRefund, payPalOrderIdOfCapture, payPalPaymentEvent, payPalTransmission, payPalWebhook, verifyPayPalWebhook };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
const require_url = require("../url-CRIlLxPE.cjs");
|
|
3
|
+
const require_crypto = require("../crypto-B0PAHKJB.cjs");
|
|
4
|
+
const require_webhook = require("../webhook-BBTebz1x.cjs");
|
|
5
|
+
const require_json = require("../json-COC9rDwf.cjs");
|
|
6
|
+
// src/payments/revolut.ts
|
|
6
7
|
const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
7
8
|
const REVOLUT_SANDBOX_API_URL = "https://sandbox-merchant.revolut.com";
|
|
8
9
|
const REVOLUT_API_VERSION = "2026-08-17";
|
|
@@ -56,7 +57,8 @@ function parseRevolutEvent(payload) {
|
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
59
|
function apiBase(options) {
|
|
59
|
-
|
|
60
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://sandbox-merchant.revolut.com" : "https://merchant.revolut.com");
|
|
61
|
+
return require_url.trimTrailingSlashes(base);
|
|
60
62
|
}
|
|
61
63
|
async function fetchRevolutOrder(orderId, options) {
|
|
62
64
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -260,7 +262,6 @@ function revolutWebhook(options) {
|
|
|
260
262
|
return new Response(null, { status: 204 });
|
|
261
263
|
});
|
|
262
264
|
}
|
|
263
|
-
//#endregion
|
|
264
265
|
exports.REVOLUT_ACCOUNT_METHOD = REVOLUT_ACCOUNT_METHOD;
|
|
265
266
|
exports.REVOLUT_API_VERSION = REVOLUT_API_VERSION;
|
|
266
267
|
exports.REVOLUT_CARD_METHOD = REVOLUT_CARD_METHOD;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/revolut.d.ts
|
|
1
|
+
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-DeuUqIvU.cjs";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.cjs";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-DF2p_m2Q.cjs";
|
|
5
4
|
export declare const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
6
5
|
export declare const REVOLUT_SANDBOX_API_URL = "https://sandbox-merchant.revolut.com";
|
|
7
6
|
export declare const REVOLUT_API_VERSION = "2026-08-17";
|
|
@@ -44,5 +43,4 @@ export interface RevolutWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
44
43
|
readonly toleranceMs?: number | undefined;
|
|
45
44
|
readonly now?: (() => number) | undefined;
|
|
46
45
|
}
|
|
47
|
-
export declare function revolutWebhook(options: RevolutWebhookOptions): WebhookHandler;
|
|
48
|
-
//#endregion
|
|
46
|
+
export declare function revolutWebhook(options: RevolutWebhookOptions): WebhookHandler;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/revolut.d.ts
|
|
1
|
+
import { i as PaymentEvent, u as PaymentWebhookBaseOptions } from "../types-oiDulesz.js";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.js";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-C9IBUdeT.js";
|
|
5
4
|
export declare const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
6
5
|
export declare const REVOLUT_SANDBOX_API_URL = "https://sandbox-merchant.revolut.com";
|
|
7
6
|
export declare const REVOLUT_API_VERSION = "2026-08-17";
|
|
@@ -44,5 +43,4 @@ export interface RevolutWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
44
43
|
readonly toleranceMs?: number | undefined;
|
|
45
44
|
readonly now?: (() => number) | undefined;
|
|
46
45
|
}
|
|
47
|
-
export declare function revolutWebhook(options: RevolutWebhookOptions): WebhookHandler;
|
|
48
|
-
//#endregion
|
|
46
|
+
export declare function revolutWebhook(options: RevolutWebhookOptions): WebhookHandler;
|
package/dist/payments/revolut.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { n as trimTrailingSlashes } from "../url-DeCMiKVm.js";
|
|
2
|
+
import { a as timingSafeEqual, i as hmacHex } from "../crypto-BqGn_oGu.js";
|
|
3
|
+
import { d as WebhookVerificationError, h as normalizeCurrency, i as respondToWebhook, l as readRawBody, m as fromMinorUnits, r as deliverPayment, s as parseJsonObject, u as PaymentProviderError } from "../webhook-SFlA_nCf.js";
|
|
4
|
+
import { a as text, i as records, n as path, r as record, t as numeric } from "../json-as-6J7d-.js";
|
|
5
|
+
// src/payments/revolut.ts
|
|
5
6
|
const REVOLUT_LIVE_API_URL = "https://merchant.revolut.com";
|
|
6
7
|
const REVOLUT_SANDBOX_API_URL = "https://sandbox-merchant.revolut.com";
|
|
7
8
|
const REVOLUT_API_VERSION = "2026-08-17";
|
|
@@ -55,7 +56,8 @@ function parseRevolutEvent(payload) {
|
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
function apiBase(options) {
|
|
58
|
-
|
|
59
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://sandbox-merchant.revolut.com" : "https://merchant.revolut.com");
|
|
60
|
+
return trimTrailingSlashes(base);
|
|
59
61
|
}
|
|
60
62
|
async function fetchRevolutOrder(orderId, options) {
|
|
61
63
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -259,5 +261,4 @@ function revolutWebhook(options) {
|
|
|
259
261
|
return new Response(null, { status: 204 });
|
|
260
262
|
});
|
|
261
263
|
}
|
|
262
|
-
//#endregion
|
|
263
264
|
export { REVOLUT_ACCOUNT_METHOD, REVOLUT_API_VERSION, REVOLUT_CARD_METHOD, REVOLUT_DEFAULT_TOLERANCE_MS, REVOLUT_DIRECT_DEBIT_METHOD, REVOLUT_LIVE_API_URL, REVOLUT_SANDBOX_API_URL, fetchRevolutOrder, parseRevolutEvent, revolutPaymentEvent, revolutWebhook, verifyRevolutSignature };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_binary = require("../binary-
|
|
3
|
-
const require_dates = require("../dates-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
2
|
+
const require_binary = require("../binary-CdpKlNNI.cjs");
|
|
3
|
+
const require_dates = require("../dates-oOp3ypPP.cjs");
|
|
4
|
+
const require_url = require("../url-CRIlLxPE.cjs");
|
|
5
|
+
const require_crypto = require("../crypto-B0PAHKJB.cjs");
|
|
6
|
+
const require_webhook = require("../webhook-BBTebz1x.cjs");
|
|
7
|
+
const require_json = require("../json-COC9rDwf.cjs");
|
|
8
|
+
// src/payments/simplepay.ts
|
|
8
9
|
const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
|
9
10
|
const SIMPLEPAY_SANDBOX_API_URL = "https://sandbox.simplepay.hu/payment/v2";
|
|
10
11
|
const SIMPLEPAY_SDK_VERSION = "kassza";
|
|
@@ -60,7 +61,8 @@ function randomSalt() {
|
|
|
60
61
|
return require_crypto.bytesToHex(crypto.getRandomValues(new Uint8Array(SALT_BYTES)));
|
|
61
62
|
}
|
|
62
63
|
function apiBase(options) {
|
|
63
|
-
|
|
64
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://sandbox.simplepay.hu/payment/v2" : "https://secure.simplepay.hu/payment/v2");
|
|
65
|
+
return require_url.trimTrailingSlashes(base);
|
|
64
66
|
}
|
|
65
67
|
function serializeRequest(body) {
|
|
66
68
|
return JSON.stringify(body).replace(/\//g, "\\/");
|
|
@@ -328,7 +330,6 @@ async function verifySimplePayRedirect(input, keys) {
|
|
|
328
330
|
orderRef: require_json.text(json.o) ?? ""
|
|
329
331
|
};
|
|
330
332
|
}
|
|
331
|
-
//#endregion
|
|
332
333
|
exports.SIMPLEPAY_CARD_METHOD = SIMPLEPAY_CARD_METHOD;
|
|
333
334
|
exports.SIMPLEPAY_LIVE_API_URL = SIMPLEPAY_LIVE_API_URL;
|
|
334
335
|
exports.SIMPLEPAY_SANDBOX_API_URL = SIMPLEPAY_SANDBOX_API_URL;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, r as PaymentCustomer, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/simplepay.d.ts
|
|
1
|
+
import { i as PaymentEvent, r as PaymentCustomer, u as PaymentWebhookBaseOptions } from "../types-DeuUqIvU.cjs";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.cjs";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-DF2p_m2Q.cjs";
|
|
5
4
|
export declare const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
|
6
5
|
export declare const SIMPLEPAY_SANDBOX_API_URL = "https://sandbox.simplepay.hu/payment/v2";
|
|
7
6
|
export declare const SIMPLEPAY_SDK_VERSION = "kassza";
|
|
@@ -82,5 +81,4 @@ export interface SimplePayRedirect {
|
|
|
82
81
|
readonly merchant: string;
|
|
83
82
|
readonly orderRef: string;
|
|
84
83
|
}
|
|
85
|
-
export declare function verifySimplePayRedirect(input: URL | URLSearchParams | string, keys: string | SimplePayMerchants): Promise<SimplePayRedirect>;
|
|
86
|
-
//#endregion
|
|
84
|
+
export declare function verifySimplePayRedirect(input: URL | URLSearchParams | string, keys: string | SimplePayMerchants): Promise<SimplePayRedirect>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, r as PaymentCustomer, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/simplepay.d.ts
|
|
1
|
+
import { i as PaymentEvent, r as PaymentCustomer, u as PaymentWebhookBaseOptions } from "../types-oiDulesz.js";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.js";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-C9IBUdeT.js";
|
|
5
4
|
export declare const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
|
6
5
|
export declare const SIMPLEPAY_SANDBOX_API_URL = "https://sandbox.simplepay.hu/payment/v2";
|
|
7
6
|
export declare const SIMPLEPAY_SDK_VERSION = "kassza";
|
|
@@ -82,5 +81,4 @@ export interface SimplePayRedirect {
|
|
|
82
81
|
readonly merchant: string;
|
|
83
82
|
readonly orderRef: string;
|
|
84
83
|
}
|
|
85
|
-
export declare function verifySimplePayRedirect(input: URL | URLSearchParams | string, keys: string | SimplePayMerchants): Promise<SimplePayRedirect>;
|
|
86
|
-
//#endregion
|
|
84
|
+
export declare function verifySimplePayRedirect(input: URL | URLSearchParams | string, keys: string | SimplePayMerchants): Promise<SimplePayRedirect>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { n as bytesToBase64, r as decodeUtf8, t as base64ToBytes } from "../binary-
|
|
2
|
-
import { i as toBudapestTimestamp } from "../dates-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { n as bytesToBase64, r as decodeUtf8, t as base64ToBytes } from "../binary-DuKBSfH-.js";
|
|
2
|
+
import { i as toBudapestTimestamp } from "../dates-DWsZOdaO.js";
|
|
3
|
+
import { n as trimTrailingSlashes } from "../url-DeCMiKVm.js";
|
|
4
|
+
import { a as timingSafeEqual, r as hmac, t as bytesToHex } from "../crypto-BqGn_oGu.js";
|
|
5
|
+
import { d as WebhookVerificationError, h as normalizeCurrency, i as respondToWebhook, l as readRawBody, r as deliverPayment, s as parseJsonObject, u as PaymentProviderError } from "../webhook-SFlA_nCf.js";
|
|
6
|
+
import { a as text, i as records, r as record, t as numeric } from "../json-as-6J7d-.js";
|
|
7
|
+
// src/payments/simplepay.ts
|
|
7
8
|
const SIMPLEPAY_LIVE_API_URL = "https://secure.simplepay.hu/payment/v2";
|
|
8
9
|
const SIMPLEPAY_SANDBOX_API_URL = "https://sandbox.simplepay.hu/payment/v2";
|
|
9
10
|
const SIMPLEPAY_SDK_VERSION = "kassza";
|
|
@@ -59,7 +60,8 @@ function randomSalt() {
|
|
|
59
60
|
return bytesToHex(crypto.getRandomValues(new Uint8Array(SALT_BYTES)));
|
|
60
61
|
}
|
|
61
62
|
function apiBase(options) {
|
|
62
|
-
|
|
63
|
+
const base = options.apiUrl ?? (options.sandbox ? "https://sandbox.simplepay.hu/payment/v2" : "https://secure.simplepay.hu/payment/v2");
|
|
64
|
+
return trimTrailingSlashes(base);
|
|
63
65
|
}
|
|
64
66
|
function serializeRequest(body) {
|
|
65
67
|
return JSON.stringify(body).replace(/\//g, "\\/");
|
|
@@ -327,5 +329,4 @@ async function verifySimplePayRedirect(input, keys) {
|
|
|
327
329
|
orderRef: text(json.o) ?? ""
|
|
328
330
|
};
|
|
329
331
|
}
|
|
330
|
-
//#endregion
|
|
331
332
|
export { SIMPLEPAY_CARD_METHOD, SIMPLEPAY_LIVE_API_URL, SIMPLEPAY_SANDBOX_API_URL, SIMPLEPAY_SDK_VERSION, SIMPLEPAY_WIRE_METHOD, parseSimplePayIpn, querySimplePayTransaction, simplePayIpnResponse, simplePayPaymentEvent, simplePayRequest, simplePaySignature, simplePayWebhook, verifySimplePayRedirect, verifySimplePaySignature };
|
package/dist/payments/stripe.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
const require_url = require("../url-CRIlLxPE.cjs");
|
|
3
|
+
const require_crypto = require("../crypto-B0PAHKJB.cjs");
|
|
4
|
+
const require_webhook = require("../webhook-BBTebz1x.cjs");
|
|
5
|
+
const require_json = require("../json-COC9rDwf.cjs");
|
|
6
|
+
// src/payments/stripe.ts
|
|
6
7
|
const STRIPE_DEFAULT_TOLERANCE_SECONDS = 300;
|
|
7
8
|
const STRIPE_API_URL = "https://api.stripe.com";
|
|
8
9
|
const STRIPE_DEFAULT_METHOD = "bankkártya";
|
|
@@ -209,7 +210,7 @@ async function stripeGet(url, options, what) {
|
|
|
209
210
|
return body;
|
|
210
211
|
}
|
|
211
212
|
function apiUrl(options, pathname) {
|
|
212
|
-
return new URL(`${(options.apiUrl ?? "https://api.stripe.com")
|
|
213
|
+
return new URL(`${require_url.trimTrailingSlashes(options.apiUrl ?? "https://api.stripe.com")}${pathname}`);
|
|
213
214
|
}
|
|
214
215
|
async function fetchStripeLineItems(sessionId, options) {
|
|
215
216
|
const items = [];
|
|
@@ -317,7 +318,6 @@ function stripeWebhook(options) {
|
|
|
317
318
|
return require_webhook.plainResponse(200, "OK");
|
|
318
319
|
});
|
|
319
320
|
}
|
|
320
|
-
//#endregion
|
|
321
321
|
exports.STRIPE_API_URL = STRIPE_API_URL;
|
|
322
322
|
exports.STRIPE_DEFAULT_METHOD = STRIPE_DEFAULT_METHOD;
|
|
323
323
|
exports.STRIPE_DEFAULT_TOLERANCE_SECONDS = STRIPE_DEFAULT_TOLERANCE_SECONDS;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, s as PaymentLineItem, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/stripe.d.ts
|
|
1
|
+
import { i as PaymentEvent, s as PaymentLineItem, u as PaymentWebhookBaseOptions } from "../types-DeuUqIvU.cjs";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.cjs";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-DF2p_m2Q.cjs";
|
|
5
4
|
export declare const STRIPE_DEFAULT_TOLERANCE_SECONDS = 300;
|
|
6
5
|
export declare const STRIPE_API_URL = "https://api.stripe.com";
|
|
7
6
|
export declare const STRIPE_DEFAULT_METHOD = "bankkártya";
|
|
@@ -45,5 +44,4 @@ export interface StripeWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
45
44
|
readonly shippingItemName?: string | undefined;
|
|
46
45
|
readonly now?: (() => number) | undefined;
|
|
47
46
|
}
|
|
48
|
-
export declare function stripeWebhook(options: StripeWebhookOptions): WebhookHandler;
|
|
49
|
-
//#endregion
|
|
47
|
+
export declare function stripeWebhook(options: StripeWebhookOptions): WebhookHandler;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { i as PaymentEvent, s as PaymentLineItem, u as PaymentWebhookBaseOptions } from "../types-
|
|
2
|
-
import { t as JsonRecord } from "../json-
|
|
3
|
-
import { r as WebhookHandler } from "../webhook-
|
|
4
|
-
//#region src/payments/stripe.d.ts
|
|
1
|
+
import { i as PaymentEvent, s as PaymentLineItem, u as PaymentWebhookBaseOptions } from "../types-oiDulesz.js";
|
|
2
|
+
import { t as JsonRecord } from "../json-D3Bx7NhF.js";
|
|
3
|
+
import { r as WebhookHandler } from "../webhook-C9IBUdeT.js";
|
|
5
4
|
export declare const STRIPE_DEFAULT_TOLERANCE_SECONDS = 300;
|
|
6
5
|
export declare const STRIPE_API_URL = "https://api.stripe.com";
|
|
7
6
|
export declare const STRIPE_DEFAULT_METHOD = "bankkártya";
|
|
@@ -45,5 +44,4 @@ export interface StripeWebhookOptions extends PaymentWebhookBaseOptions {
|
|
|
45
44
|
readonly shippingItemName?: string | undefined;
|
|
46
45
|
readonly now?: (() => number) | undefined;
|
|
47
46
|
}
|
|
48
|
-
export declare function stripeWebhook(options: StripeWebhookOptions): WebhookHandler;
|
|
49
|
-
//#endregion
|
|
47
|
+
export declare function stripeWebhook(options: StripeWebhookOptions): WebhookHandler;
|