@delopay/sdk 0.484.0 → 0.490.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/airwallexCard.cjs.map +1 -1
- package/dist/branding.cjs.map +1 -1
- package/dist/cardFormStyles.cjs.map +1 -1
- package/dist/checkoutSession.cjs +2 -2
- package/dist/checkoutSession.cjs.map +1 -1
- package/dist/checkoutSession.js +1 -1
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/chunk-34PC72O7.cjs.map +1 -1
- package/dist/chunk-3GBWQWTP.cjs.map +1 -1
- package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
- package/dist/chunk-44QBWVRS.cjs.map +1 -1
- package/dist/chunk-4EKAWNYI.cjs.map +1 -1
- package/dist/chunk-4LN4BR2T.cjs.map +1 -1
- package/dist/chunk-4T4XHPYN.cjs.map +1 -1
- package/dist/{chunk-36EJUE7E.cjs → chunk-4T7BJFY2.cjs} +9 -9
- package/dist/chunk-4T7BJFY2.cjs.map +1 -0
- package/dist/chunk-5CITBN33.cjs.map +1 -1
- package/dist/chunk-5HCKC4HF.cjs.map +1 -1
- package/dist/chunk-5O2JSQYA.cjs.map +1 -1
- package/dist/chunk-5QS67SBO.cjs.map +1 -1
- package/dist/chunk-6BFZS4YP.cjs.map +1 -1
- package/dist/chunk-6EBY2KKL.cjs.map +1 -1
- package/dist/chunk-6LFOM6HV.cjs.map +1 -1
- package/dist/chunk-6LOWE2YI.cjs.map +1 -1
- package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
- package/dist/chunk-6SU2MTN2.cjs.map +1 -1
- package/dist/chunk-6YCDLSIU.cjs.map +1 -1
- package/dist/chunk-75E5WNJG.cjs.map +1 -1
- package/dist/{chunk-35U6FHUL.js → chunk-7AELDJXA.js} +33 -12
- package/dist/chunk-7AELDJXA.js.map +1 -0
- package/dist/chunk-7JV6VVO7.cjs.map +1 -1
- package/dist/chunk-7NKJD5ST.cjs.map +1 -1
- package/dist/chunk-7QZCUXWB.cjs.map +1 -1
- package/dist/chunk-7VXF5D67.cjs.map +1 -1
- package/dist/{chunk-W4EASI7R.js → chunk-A767G7YE.js} +32 -1
- package/dist/chunk-A767G7YE.js.map +1 -0
- package/dist/chunk-ABWAYMN5.cjs.map +1 -1
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/{chunk-R2AKKQ35.cjs → chunk-ANQRR2BG.cjs} +5 -1
- package/dist/chunk-ANQRR2BG.cjs.map +1 -0
- package/dist/chunk-AYUYJO3I.cjs.map +1 -1
- package/dist/chunk-BCA3TCGS.cjs.map +1 -1
- package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
- package/dist/chunk-BRY3W7N3.cjs.map +1 -1
- package/dist/chunk-BT3UAUEV.cjs.map +1 -1
- package/dist/chunk-CAMALM35.cjs.map +1 -1
- package/dist/chunk-CCN44NZJ.cjs.map +1 -1
- package/dist/chunk-CR3JBTP3.cjs.map +1 -1
- package/dist/chunk-DJASVBOJ.cjs.map +1 -1
- package/dist/{chunk-HXKNTSTZ.cjs → chunk-DQHT4FGI.cjs} +41 -1
- package/dist/chunk-DQHT4FGI.cjs.map +1 -0
- package/dist/chunk-EEB2HDYL.cjs.map +1 -1
- package/dist/chunk-ENPSUWTS.cjs.map +1 -1
- package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
- package/dist/chunk-EXPWQBI3.cjs.map +1 -1
- package/dist/chunk-EYHSXJMJ.cjs.map +1 -1
- package/dist/chunk-F3I5DOWV.cjs.map +1 -1
- package/dist/chunk-F46K5H3U.cjs.map +1 -1
- package/dist/chunk-F6S3WCCB.cjs.map +1 -1
- package/dist/chunk-FQRC4NJG.cjs.map +1 -1
- package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
- package/dist/chunk-FYISDU2Y.cjs.map +1 -1
- package/dist/chunk-GG52SAHA.cjs.map +1 -1
- package/dist/chunk-GK5FWN4H.cjs.map +1 -1
- package/dist/chunk-GSQN5EOO.cjs.map +1 -1
- package/dist/chunk-GW7IHYXR.cjs.map +1 -1
- package/dist/chunk-GWSVQXEY.cjs.map +1 -1
- package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
- package/dist/chunk-HLYGHP6F.cjs.map +1 -1
- package/dist/chunk-HSJABE7X.cjs.map +1 -1
- package/dist/chunk-I2W7AO4B.cjs.map +1 -1
- package/dist/chunk-I2XGNALG.cjs.map +1 -1
- package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
- package/dist/chunk-IR2LFKKA.cjs.map +1 -1
- package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
- package/dist/chunk-J5RPSRBQ.cjs.map +1 -1
- package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
- package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
- package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
- package/dist/chunk-KJDMNF2T.cjs.map +1 -1
- package/dist/chunk-KLONGJCL.cjs.map +1 -1
- package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
- package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
- package/dist/chunk-LYIBTVK6.cjs.map +1 -1
- package/dist/chunk-M3HWE7KT.cjs.map +1 -1
- package/dist/chunk-M3SJHFT4.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/{chunk-JNDYBMC4.js → chunk-MXSUWL6O.js} +7 -12
- package/dist/chunk-MXSUWL6O.js.map +1 -0
- package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/chunk-NYL3BNHR.cjs.map +1 -1
- package/dist/chunk-O4AYHLQX.cjs.map +1 -1
- package/dist/chunk-OAEKP665.cjs.map +1 -1
- package/dist/chunk-ODPNVNYE.cjs.map +1 -1
- package/dist/{chunk-DM75PLU4.js → chunk-OEREK6NU.js} +36 -1
- package/dist/chunk-OEREK6NU.js.map +1 -0
- package/dist/chunk-OG2KJAYD.cjs.map +1 -1
- package/dist/chunk-OYZP6NF6.cjs.map +1 -1
- package/dist/chunk-P4UILJVU.cjs.map +1 -1
- package/dist/chunk-P7DYLUUI.cjs.map +1 -1
- package/dist/chunk-PKAE6AQT.cjs.map +1 -1
- package/dist/chunk-PYNHK6AP.cjs.map +1 -1
- package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
- package/dist/chunk-QKUWFMZP.cjs.map +1 -1
- package/dist/{chunk-S2P7TRD4.js → chunk-QONQKUM3.js} +41 -1
- package/dist/chunk-QONQKUM3.js.map +1 -0
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/{chunk-TVBMXXGA.cjs → chunk-R3WHKS5S.cjs} +33 -12
- package/dist/chunk-R3WHKS5S.cjs.map +1 -0
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RHFUXHQN.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/chunk-S77LQWYC.cjs.map +1 -1
- package/dist/chunk-S7SBNOGS.cjs.map +1 -1
- package/dist/chunk-TMAJE5P2.cjs.map +1 -1
- package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
- package/dist/chunk-U3JK7NBG.cjs.map +1 -1
- package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
- package/dist/chunk-UKLZAOLW.cjs.map +1 -1
- package/dist/{chunk-VZ3BSIVU.cjs → chunk-UTCXNBID.cjs} +32 -1
- package/dist/chunk-UTCXNBID.cjs.map +1 -0
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VHMH4QMY.cjs.map +1 -1
- package/dist/{chunk-TZ6JAOOB.js → chunk-VPCHAUYO.js} +5 -5
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/{chunk-CIMLGIXJ.cjs → chunk-W7NMENTT.cjs} +3 -3
- package/dist/chunk-W7NMENTT.cjs.map +1 -0
- package/dist/chunk-WHDI3TMP.cjs.map +1 -1
- package/dist/chunk-WITCPKNL.cjs.map +1 -1
- package/dist/chunk-WX6NP7UU.cjs.map +1 -1
- package/dist/{chunk-VGN3KBFY.js → chunk-XE54RJL2.js} +5 -1
- package/dist/chunk-XE54RJL2.js.map +1 -0
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
- package/dist/{chunk-R3LVDOE2.js → chunk-YFQ3MKNB.js} +2 -2
- package/dist/{chunk-IGHAJNC6.cjs → chunk-YFRAI34Y.cjs} +36 -1
- package/dist/chunk-YFRAI34Y.cjs.map +1 -0
- package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
- package/dist/chunk-YW4DVKNT.cjs.map +1 -1
- package/dist/{chunk-IEVJVKC7.cjs → chunk-YWN76H2W.cjs} +7 -12
- package/dist/chunk-YWN76H2W.cjs.map +1 -0
- package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
- package/dist/chunk-ZUULK36E.cjs.map +1 -1
- package/dist/client.cjs +2 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/currencies.cjs.map +1 -1
- package/dist/enigmaCardForm.cjs.map +1 -1
- package/dist/error.cjs.map +1 -1
- package/dist/eventStream.cjs.map +1 -1
- package/dist/exportDownload.cjs.map +1 -1
- package/dist/feeProgram.cjs.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/internal/resources/admin.cjs.map +1 -1
- package/dist/internal/resources/admin.d.cts +1 -1
- package/dist/internal/resources/admin.d.ts +1 -1
- package/dist/internal/resources/adminBranding.cjs.map +1 -1
- package/dist/internal/resources/adminBranding.d.cts +1 -1
- package/dist/internal/resources/adminBranding.d.ts +1 -1
- package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
- package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
- package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
- package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
- package/dist/internal/resources/adminFeePlans.d.cts +1 -1
- package/dist/internal/resources/adminFeePlans.d.ts +1 -1
- package/dist/internal/resources/adminFileScans.cjs.map +1 -1
- package/dist/internal/resources/adminFileScans.d.cts +1 -1
- package/dist/internal/resources/adminFileScans.d.ts +1 -1
- package/dist/internal/resources/adminIndustries.cjs.map +1 -1
- package/dist/internal/resources/adminIndustries.d.cts +1 -1
- package/dist/internal/resources/adminIndustries.d.ts +1 -1
- package/dist/internal/resources/adminLive.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.d.cts +1 -1
- package/dist/internal/resources/adminNotices.d.ts +1 -1
- package/dist/internal/resources/adminPortal.cjs +2 -2
- package/dist/internal/resources/adminPortal.cjs.map +1 -1
- package/dist/internal/resources/adminPortal.d.cts +12 -2
- package/dist/internal/resources/adminPortal.d.ts +12 -2
- package/dist/internal/resources/adminPortal.js +1 -1
- package/dist/internal/resources/adminPricing.cjs +2 -2
- package/dist/internal/resources/adminPricing.cjs.map +1 -1
- package/dist/internal/resources/adminPricing.d.cts +5 -3
- package/dist/internal/resources/adminPricing.d.ts +5 -3
- package/dist/internal/resources/adminPricing.js +1 -1
- package/dist/internal/resources/adminSupport.cjs.map +1 -1
- package/dist/internal/resources/adminSupport.d.cts +1 -1
- package/dist/internal/resources/adminSupport.d.ts +1 -1
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.d.cts +1 -1
- package/dist/internal/resources/auditLogs.d.ts +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.d.cts +1 -1
- package/dist/internal/resources/cardIssuers.d.ts +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.d.cts +1 -1
- package/dist/internal/resources/diagnostic.d.ts +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/gsm.d.cts +1 -1
- package/dist/internal/resources/gsm.d.ts +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.d.cts +1 -1
- package/dist/internal/resources/nativeRenewals.d.ts +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.d.cts +1 -1
- package/dist/internal/resources/platformBilling.d.ts +1 -1
- package/dist/internal/resources/platformFees.cjs.map +1 -1
- package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.d.cts +1 -1
- package/dist/internal/resources/platformSettings.d.ts +1 -1
- package/dist/internal.cjs +12 -12
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +8 -8
- package/dist/listQuery.cjs.map +1 -1
- package/dist/panes.cjs.map +1 -1
- package/dist/paymentPresentation.cjs.map +1 -1
- package/dist/recordCounter.cjs.map +1 -1
- package/dist/resources/aiTools.cjs.map +1 -1
- package/dist/resources/analytics.cjs +2 -2
- package/dist/resources/analytics.cjs.map +1 -1
- package/dist/resources/analytics.js +1 -1
- package/dist/resources/analyticsDashboard.cjs.map +1 -1
- package/dist/resources/apiKeys.cjs.map +1 -1
- package/dist/resources/audit.cjs.map +1 -1
- package/dist/resources/authentication.cjs.map +1 -1
- package/dist/resources/availabilityOverrides.cjs.map +1 -1
- package/dist/resources/billing.cjs +2 -2
- package/dist/resources/billing.cjs.map +1 -1
- package/dist/resources/billing.d.cts +30 -1
- package/dist/resources/billing.d.ts +30 -1
- package/dist/resources/billing.js +1 -1
- package/dist/resources/buyerAccount.cjs.map +1 -1
- package/dist/resources/buyerBlocklist.cjs.map +1 -1
- package/dist/resources/buyerConversations.cjs.map +1 -1
- package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
- package/dist/resources/buyerPortal.cjs.map +1 -1
- package/dist/resources/cards.cjs.map +1 -1
- package/dist/resources/chargebackPrevention.cjs.map +1 -1
- package/dist/resources/checkoutDomains.cjs.map +1 -1
- package/dist/resources/checkoutMethods.cjs.map +1 -1
- package/dist/resources/checkoutRecovery.cjs.map +1 -1
- package/dist/resources/checkoutTemplates.cjs.map +1 -1
- package/dist/resources/connectors.cjs.map +1 -1
- package/dist/resources/contentEncryption.cjs.map +1 -1
- package/dist/resources/costRules.cjs.map +1 -1
- package/dist/resources/customers.cjs.map +1 -1
- package/dist/resources/deploymentBranding.cjs.map +1 -1
- package/dist/resources/disputes.cjs.map +1 -1
- package/dist/resources/ephemeralKeys.cjs.map +1 -1
- package/dist/resources/events.cjs.map +1 -1
- package/dist/resources/export.cjs.map +1 -1
- package/dist/resources/externalRecords.cjs.map +1 -1
- package/dist/resources/featureMatrix.cjs.map +1 -1
- package/dist/resources/fees.cjs.map +1 -1
- package/dist/resources/files.cjs.map +1 -1
- package/dist/resources/forex.cjs.map +1 -1
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/notices.cjs.map +1 -1
- package/dist/resources/operationLimits.cjs.map +1 -1
- package/dist/resources/paymentLinks.cjs.map +1 -1
- package/dist/resources/paymentMethods.cjs.map +1 -1
- package/dist/resources/payments.cjs +2 -2
- package/dist/resources/payments.cjs.map +1 -1
- package/dist/resources/payments.d.cts +17 -1
- package/dist/resources/payments.d.ts +17 -1
- package/dist/resources/payments.js +1 -1
- package/dist/resources/payoutDestinations.cjs.map +1 -1
- package/dist/resources/payouts.cjs.map +1 -1
- package/dist/resources/paypalDisputes.cjs.map +1 -1
- package/dist/resources/persons.cjs.map +1 -1
- package/dist/resources/poll.cjs.map +1 -1
- package/dist/resources/processorCosts.cjs.map +1 -1
- package/dist/resources/processorImports.cjs.map +1 -1
- package/dist/resources/products.cjs.map +1 -1
- package/dist/resources/profileAcquirers.cjs.map +1 -1
- package/dist/resources/profiles.cjs.map +1 -1
- package/dist/resources/projects.cjs.map +1 -1
- package/dist/resources/refunds.cjs.map +1 -1
- package/dist/resources/regions.cjs.map +1 -1
- package/dist/resources/relay.cjs.map +1 -1
- package/dist/resources/risk.cjs.map +1 -1
- package/dist/resources/routing.cjs.map +1 -1
- package/dist/resources/search.cjs.map +1 -1
- package/dist/resources/sellToRestrictions.cjs.map +1 -1
- package/dist/resources/settings.cjs.map +1 -1
- package/dist/resources/settlement.cjs.map +1 -1
- package/dist/resources/shareLinks.cjs.map +1 -1
- package/dist/resources/shopLabels.cjs.map +1 -1
- package/dist/resources/shopify.cjs +2 -2
- package/dist/resources/shopify.cjs.map +1 -1
- package/dist/resources/shopify.d.cts +31 -4
- package/dist/resources/shopify.d.ts +31 -4
- package/dist/resources/shopify.js +1 -1
- package/dist/resources/shops.cjs.map +1 -1
- package/dist/resources/stripeConnect.cjs.map +1 -1
- package/dist/resources/subscriptions.cjs.map +1 -1
- package/dist/resources/support.cjs.map +1 -1
- package/dist/resources/threeDsRules.cjs.map +1 -1
- package/dist/resources/users.cjs.map +1 -1
- package/dist/resources/vatRates.cjs.map +1 -1
- package/dist/resources/verification.cjs.map +1 -1
- package/dist/resources/webhooks.cjs.map +1 -1
- package/dist/resources/whopResolutionCases.cjs.map +1 -1
- package/dist/trustedOrigins.cjs.map +1 -1
- package/dist/{types-7WY9SUsl.d.ts → types-4T8JSWuZ.d.cts} +18 -87
- package/dist/{types-Cx6M3WF3.d.cts → types-D9ygoAbt.d.ts} +18 -87
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +650 -12
- package/dist/types.d.ts +650 -12
- package/package.json +1 -1
- package/dist/chunk-35U6FHUL.js.map +0 -1
- package/dist/chunk-36EJUE7E.cjs.map +0 -1
- package/dist/chunk-CIMLGIXJ.cjs.map +0 -1
- package/dist/chunk-DM75PLU4.js.map +0 -1
- package/dist/chunk-HXKNTSTZ.cjs.map +0 -1
- package/dist/chunk-IEVJVKC7.cjs.map +0 -1
- package/dist/chunk-IGHAJNC6.cjs.map +0 -1
- package/dist/chunk-JNDYBMC4.js.map +0 -1
- package/dist/chunk-R2AKKQ35.cjs.map +0 -1
- package/dist/chunk-S2P7TRD4.js.map +0 -1
- package/dist/chunk-TVBMXXGA.cjs.map +0 -1
- package/dist/chunk-VGN3KBFY.js.map +0 -1
- package/dist/chunk-VZ3BSIVU.cjs.map +0 -1
- package/dist/chunk-W4EASI7R.js.map +0 -1
- /package/dist/{chunk-TZ6JAOOB.js.map → chunk-VPCHAUYO.js.map} +0 -0
- /package/dist/{chunk-R3LVDOE2.js.map → chunk-YFQ3MKNB.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resources/payments.ts"],"sourcesContent":["import type {\n BuyerRiskEvaluationsResponse,\n BuyerRiskEvidenceQuery,\n BuyerRiskEvidenceResponse,\n BuyerRiskReleaseResponse,\n PaymentAgentSignalResponse,\n PaymentClientContextListResponse,\n PaymentCreateRequest,\n ProductPaymentCreateRequest,\n ProductsPaymentCreateRequest,\n PaymentListFilterConstraints,\n PaymentListFilteredResponse,\n ProfilePaymentListFilterConstraints,\n PaymentListResponse,\n PaymentResponse,\n PaymentProductLines,\n PaymentShopifyResponse,\n PaymentRetrieveOptions,\n PaymentUpdateRequest,\n PaymentConfirmRequest,\n PaymentCaptureRequest,\n PaymentCancelRequest,\n PaymentAbortRequest,\n PaymentIntegrationTestRequest,\n PaymentIntegrationTestResponse,\n PaymentListParams,\n PaymentAttemptsListResponse,\n PaymentConnectorSettlementResponse,\n PaymentsDeletePolicyResponse,\n PaymentsDeleteResponse,\n PaymentStatusHistoryResponse,\n PaymentLogsResponse,\n PaymentLogConnectorCallDetail,\n PaymentLogIncomingWebhookDetail,\n PaymentLogOutgoingWebhookDetail,\n PaymentRoutingDecisionsResponse,\n PaymentStatementDescriptorsResponse,\n ShipmentTrackingCreateRequest,\n ShipmentTrackingListResponse,\n ShipmentTrackingResponse,\n ShipmentTrackingUpdateRequest,\n ReplayPlaybackResponse,\n ReplaySliceResponse,\n PaymentListFiltersExt,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Manage payment intents — create, confirm, capture, cancel, and list payments. */\nexport class Payments {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a new payment intent.\n *\n * @param params - An explicit amount and currency, or a DeloPay one-time\n * product whose active price supplies both on the server.\n * @param options - Optional per-call extras: extra `headers` (e.g. an\n * `Idempotency-Key` to make the create safe to retry), a `timeout` override,\n * and an `AbortSignal`.\n * @returns The created payment intent.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.create(\n * { amount: 5000, currency: 'EUR', customer_id: 'cus_123' },\n * { headers: { 'Idempotency-Key': 'order_1001' } },\n * );\n * ```\n *\n * @example Charge the active default price of a shop-owned product without\n * copying the product to the payment provider:\n * ```typescript\n * const payment = await delopay.payments.create({\n * product_id: 'prd_123',\n * profile_id: 'pro_123',\n * payment_link: true,\n * });\n * ```\n *\n * @example Send `test_mode` to pick the environment per payment, so a staging\n * deploy cannot charge real cards and a forgotten processor toggle cannot\n * swallow production traffic:\n * ```typescript\n * const payment = await delopay.payments.create({\n * amount: 5000,\n * currency: 'EUR',\n * test_mode: process.env.NODE_ENV !== 'production',\n * });\n * ```\n *\n * A payment that pins one connector through `routing` (the `single` form)\n * is now checked against `test_mode` here rather than at confirm: if that\n * connector has no credentials for the environment asked for, create fails\n * instead of handing back a payment whose checkout the buyer cannot\n * complete. `priority` and `volume_split` name several accounts and are\n * still resolved at confirm.\n */\n async create(\n params: PaymentCreateRequest | ProductPaymentCreateRequest | ProductsPaymentCreateRequest,\n options?: RequestExtras,\n ): Promise<PaymentResponse> {\n return this.request('POST', '/payments', { body: params, ...options });\n }\n\n /**\n * Retrieve a payment by its ID.\n *\n * @param paymentId - The unique payment intent ID.\n * @param options - Optional query flags. `force_sync` reconciles the\n * intent's state with the connector before returning (useful to recover\n * a stuck intent when a webhook was lost). `all_keys_required` forces a\n * connector sync even for intents in early states like\n * `requires_payment_method` that would otherwise return the local\n * snapshot. Both flags work with JWT and API-key authentication.\n * @returns The payment intent.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.retrieve('pay_abc123');\n * const synced = await delopay.payments.retrieve('pay_abc123', {\n * force_sync: true,\n * all_keys_required: true,\n * });\n * ```\n */\n async retrieve(paymentId: string, options?: PaymentRetrieveOptions): Promise<PaymentResponse> {\n const path = `/payments/${encodeURIComponent(paymentId)}`;\n if (options === undefined) return this.request('GET', path);\n const query: Record<string, boolean> = {};\n if (options.force_sync !== undefined) query['force_sync'] = options.force_sync;\n if (options.all_keys_required !== undefined) {\n query['all_keys_required'] = options.all_keys_required;\n }\n if (Object.keys(query).length === 0) return this.request('GET', path);\n return this.request('GET', path, { query });\n }\n\n /**\n * The payment's buyer risk evaluations, newest first (at most 50): each\n * one's score from 0 to 100, its band, the action the merchant's model asks\n * for that band and the action that was taken, the signals that fired with\n * the points each added, and the model version it was scored with.\n *\n * A payment is scored at every confirm that is about to reach a processor;\n * a payment never scored answers an empty list. A caller scoped to one shop\n * reads only that shop's payments.\n *\n * `GET /payments/{paymentId}/buyer-risk`\n */\n async buyerRisk(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<BuyerRiskEvaluationsResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/buyer-risk`, options);\n }\n\n /**\n * Concrete evidence behind one fired buyer-risk signal on a payment:\n * IP addresses with location and VPN/proxy tags, earlier refused/disputed/\n * alerted/declined payments, 3-D Secure attempts, devices, masked cards\n * (brand and last four digits only), linked-group summaries, blocklist\n * entries, or identity verifications.\n *\n * Defaults to what the payment saw at scoring time (`view: 'scoring'`),\n * reports whether today's count differs (`changed_since_scoring`,\n * `current_count`), and accepts `view: 'current'` for the live view.\n * Enforces shop scoping, person/customer permissions, payment visibility,\n * and never names other merchants on `cross_merchant_fraud`.\n *\n * `GET /payments/{paymentId}/buyer-risk/evidence`\n */\n async buyerRiskEvidence(\n paymentId: string,\n params: BuyerRiskEvidenceQuery,\n options?: RequestExtras,\n ): Promise<BuyerRiskEvidenceResponse> {\n const query: Record<string, string | number> = { signal: params.signal };\n if (params.evaluation_id !== undefined && params.evaluation_id !== null) {\n query['evaluation_id'] = params.evaluation_id;\n }\n if (params.view !== undefined && params.view !== null) {\n query['view'] = params.view;\n }\n if (params.limit !== undefined && params.limit !== null) {\n query['limit'] = params.limit;\n }\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/buyer-risk/evidence`, {\n ...options,\n query,\n });\n }\n\n /**\n * Lift the holds put on an authorized payment when a chargeback prevention\n * alert or an AML hit on the same buyer arrived after it was scored and the\n * shop's `buyer_risk_source_changes` setting asked to hold it. Until then a\n * capture is refused with `IR_16`; after the release the payment can be\n * captured or cancelled as usual. A payment with no hold answers an empty\n * list. A caller scoped to one shop releases only that shop's payments.\n *\n * `POST /payments/{paymentId}/buyer-risk/release`\n */\n async releaseBuyerRiskHold(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<BuyerRiskReleaseResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/buyer-risk/release`,\n options,\n );\n }\n\n /**\n * What the payment's checkout client was, for AI shopping agents: a\n * verified agent (with its operator, protocol and key), an agent signature\n * that did not verify (with the reason), an automated client, or a browser.\n * The hosted checkout's render and the buyer's confirm are both judged, and\n * the strongest observation is kept.\n *\n * A payment never observed answers 404. A caller scoped to one shop reads\n * only that shop's payments.\n *\n * `GET /payments/{paymentId}/agent-signal`\n */\n async agentSignal(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentAgentSignalResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/agent-signal`, options);\n }\n\n /**\n * What a payment made from a Shopify store's cart was for: the cart lines,\n * shipping, discounts and totals as Shopify priced them, the Shopify order\n * made for it, and `order_sync`, where making that order stands. A payment\n * not made from a Shopify storefront answers 404.\n *\n * `GET /payments/{paymentId}/shopify`\n */\n async shopify(paymentId: string, options?: RequestExtras): Promise<PaymentShopifyResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/shopify`, options);\n }\n\n /** Product names and prices as frozen when the payment was created. */\n async productLines(paymentId: string): Promise<PaymentProductLines> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/lines`);\n }\n\n /**\n * List every attempt made on a payment, each with its full failure detail\n * (`error_code` / `error_message`, the Delopay-unified `unified_code` and\n * `unified_message`, and structured `error_details`).\n *\n * Useful for surfacing retries across connectors — e.g. \"attempt 1 stripe →\n * insufficient_funds, attempt 2 adyen → success\".\n *\n * `GET /payments/{paymentId}/attempts`\n *\n * @param paymentId - The payment intent ID whose attempts to list.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns The attempt list — `size` plus a `data` array of attempts.\n * @throws If the payment does not exist or belongs to another merchant (404).\n *\n * @example\n * ```typescript\n * const { size, data } = await delopay.payments.listAttempts('pay_abc123');\n * for (const attempt of data) {\n * console.log(attempt.status, attempt.unified_message ?? attempt.error_message);\n * }\n * ```\n */\n async listAttempts(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentAttemptsListResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/attempts`, options);\n }\n\n /**\n * The status timeline of a payment: every recorded creation / status\n * transition of the intent and its attempts, refunds and disputes, oldest\n * first. `complete: false` marks timelines partially reconstructed from\n * current records (payments created before the status log existed).\n *\n * @param paymentId - The payment intent ID.\n * @returns The ordered status-history events.\n *\n * @example\n * ```typescript\n * const { events, complete } = await delopay.payments.listStatusHistory('pay_abc123');\n * for (const event of events) {\n * console.log(event.timestamp, event.entity_type, event.status);\n * }\n * ```\n */\n async listStatusHistory(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentStatusHistoryResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/status-history`,\n options,\n );\n }\n\n /**\n * The traffic of a payment, oldest first: the requests DeloPay sent to the\n * payment provider, the webhooks the provider sent, and the webhooks DeloPay\n * sent to the shop with every delivery attempt. No payloads; read an entry\n * with {@link getLogConnectorCall}, {@link getLogIncomingWebhook} or\n * {@link getLogOutgoingWebhook}. Dashboard (JWT) only.\n *\n * @param paymentId - The payment intent ID.\n *\n * @example\n * ```typescript\n * const logs = await delopay.payments.listLogs('pay_abc123');\n * if (!logs.psp_traffic_recorded) console.log('provider traffic is not recorded');\n * ```\n */\n async listLogs(paymentId: string, options?: RequestExtras): Promise<PaymentLogsResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/logs`, options);\n }\n\n /** One provider request of a payment, with its masked request, response and error. */\n async getLogConnectorCall(\n paymentId: string,\n callId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogConnectorCallDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`,\n options,\n );\n }\n\n /** One provider webhook of a payment, with its masked headers and body. */\n async getLogIncomingWebhook(\n paymentId: string,\n eventId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`,\n options,\n );\n }\n\n /** Every delivery attempt of one shop webhook of a payment, with request and response. */\n async getLogOutgoingWebhook(\n paymentId: string,\n initialAttemptId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogOutgoingWebhookDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`,\n options,\n );\n }\n\n /**\n * What the payment's rail says about settling each attempt: whether the\n * money is still `pending` in the rail's hands, `available` in its balance\n * (**not** paid out), `paid_out` to a bank — with the payout's date and\n * reference — or came back as `payout_failed`; and, for the rest, which\n * kind of not-knowing applies (`unavailable`, `unknown`, `not_recorded`).\n * See {@link ConnectorSettlementStatus} for the seven values. The same\n * status for the active attempt rides on every list row and retrieve as\n * `connector_settlement_status`, and the list filters on it.\n *\n * Not the hosted-shop settlement API under `settlement.*`, which is host →\n * shop owner and manual; this is acquirer → merchant bank, per payment.\n *\n * Each attempt also carries what the rail itself took for it —\n * `processor_cost_amount` with its own `processor_cost_currency` and\n * `processor_cost_exponent`, the `processor_cost_source` that says how the\n * figure was obtained, the `processor_cost_basis` behind an estimate, and\n * the `connector_method_code` it was priced under. Recorded for **every**\n * merchant, not only those that host shops. Never present an `estimated`\n * cost as an observation, and read an absent `processor_cost_source` as\n * \"nothing was ever written\", which is not the `unavailable` the rail\n * answers with.\n *\n * `GET /payments/{paymentId}/settlement`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns The attempts this caller may see, oldest first, each with its\n * settlement status.\n * @throws If the payment does not exist (404), or the caller is a\n * profile-scoped (shop) role, who is refused rather than shown a redacted\n * body (403).\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.settlement('pay_abc123');\n * for (const attempt of attempts) {\n * if (attempt.status === 'paid_out') {\n * console.log(attempt.paid_out_at, attempt.payout_reference);\n * }\n * if (attempt.processor_cost_source === 'estimated') {\n * // Label it an estimate — it was derived from a cost schedule.\n * }\n * }\n * ```\n */\n async settlement(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentConnectorSettlementResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/settlement`, options);\n }\n\n /**\n * Update an existing payment intent before it is confirmed.\n *\n * @param paymentId - The payment intent ID to update.\n * @param params - Fields to update (amount, currency, metadata, etc.).\n * @returns The updated payment intent.\n */\n async update(paymentId: string, params: PaymentUpdateRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}`, { body: params });\n }\n\n /**\n * Confirm a payment intent, triggering authorisation with the selected gateway.\n *\n * @param paymentId - The payment intent ID to confirm.\n * @param params - Confirmation parameters (payment method data, return URL, etc.).\n * @returns The updated payment intent.\n *\n * A buyer the merchant's buyer risk model refuses fails before any processor\n * is called, with a `DelopayError` of code `DE_23` (`buyer_risk_refused`,\n * HTTP 422). The error does not say which signal fired; read the evaluation\n * with {@link Payments.buyerRisk}. A shop whose payments are switched off is\n * refused with `DE_21`.\n */\n async confirm(paymentId: string, params: PaymentConfirmRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/confirm`, {\n body: params,\n });\n }\n\n /**\n * Capture a previously authorised payment.\n *\n * @param paymentId - The payment intent ID to capture.\n * @param params - Optional capture parameters (partial capture amount, etc.).\n * @returns The updated payment intent.\n */\n async capture(paymentId: string, params?: PaymentCaptureRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/capture`, {\n body: params,\n });\n }\n\n /**\n * Cancel a payment intent that has not yet been captured.\n *\n * @param paymentId - The payment intent ID to cancel.\n * @param params - Optional cancellation reason.\n * @returns The updated payment intent.\n */\n async cancel(paymentId: string, params?: PaymentCancelRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/cancel`, {\n body: params,\n });\n }\n\n /**\n * Abort a payment nobody has paid. The payment becomes `aborted`: its hosted\n * checkout stops taking payments, a confirm is refused, and it can no longer\n * be reactivated. Every processor object a buyer could still pay is closed\n * where the processor allows it, and a `payment_aborted` webhook is sent.\n *\n * A success the processor confirms later still moves the payment to\n * `succeeded`, so the order can be fulfilled or refunded. Aborting an\n * aborted payment returns it unchanged. A payment that took money, holds an\n * authorisation or awaits a merchant decision is refused with `IR_16`\n * (HTTP 400).\n *\n * `POST /payments/{paymentId}/abort`\n *\n * @param paymentId - The payment intent ID to abort.\n * @param params - Optional `reason`, at most 255 characters, stored as the\n * attempt's cancellation reason (`merchant_aborted` when absent).\n * @returns The payment, with status `aborted`.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.abort('pay_123', { reason: 'order_cancelled' });\n * ```\n */\n async abort(paymentId: string, params?: PaymentAbortRequest): Promise<PaymentResponse> {\n // The route requires a JSON body, even an empty one.\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/abort`, {\n body: params ?? {},\n });\n }\n\n /**\n * Mark a payment as an integration test, or remove the mark.\n *\n * A marked payment stays live or test as it was; only analytics leave it\n * out, from their next refresh on. Every change is recorded in the\n * payment's status history with the person who made it. Needs a dashboard\n * JWT with write access to transactions. Asking for the mark the payment\n * already carries changes nothing (`changed: false`).\n *\n * `POST /payments/{paymentId}/integration-test`\n *\n * @example\n * ```typescript\n * const { is_integration_test } = await delopay.payments.setIntegrationTest('pay_123', {\n * is_integration_test: true,\n * });\n * ```\n */\n async setIntegrationTest(\n paymentId: string,\n params: PaymentIntegrationTestRequest,\n ): Promise<PaymentIntegrationTestResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/integration-test`, {\n body: params,\n });\n }\n\n /**\n * List payment intents, optionally filtered by customer, date range or\n * the integrations that created them (`integration_origin`).\n *\n * @param params - Optional filter and pagination parameters.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal` for cancellation.\n * @returns Paginated list of payment intents.\n *\n * @example\n * ```typescript\n * const { data } = await delopay.payments.list({ customer_id: 'cus_123', limit: 25 });\n * ```\n */\n async list(params?: PaymentListParams, options?: RequestExtras): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/list', {\n query: paymentListQuery(params),\n ...options,\n });\n }\n\n /**\n * The status timeline of client/device observations captured while the\n * buyer interacted with the payment (checkout opens, confirms, redirect\n * legs, reported client signals), oldest first.\n *\n * `GET /payments/{paymentId}/client-context`\n */\n async listClientContext(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentClientContextListResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/client-context`,\n options,\n );\n }\n\n /**\n * The routing decision recorded behind each attempt of a payment: which rule\n * matched, which candidates routing produced and which filter removed each,\n * which volume bucket was drawn and what the counters read, which\n * configuration version was live.\n *\n * This is the only truthful account of **how the connector was chosen**.\n * `routing_approach` on the payment is seeded on creation and several paths —\n * mandate, pre-routed and pinned-account among them — return before it is\n * overwritten, so it can still read `default_fallback` on a payment that was\n * routed by a rule. Read {@link RoutingDecision.decision_kind} instead.\n *\n * An attempt with `decision: null` simply has no record: the recorder is\n * best-effort, attempts that never reached routing have nothing to record,\n * and attempts predating the record exist in quantity. It is not an error.\n *\n * `GET /payments/{paymentId}/routing-decisions`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns Every attempt returned for this payment, with its decision.\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.routingDecisions('pay_abc123');\n * for (const attempt of attempts) {\n * if (!attempt.decision) continue;\n * console.log(attempt.connector, attempt.decision.decision_kind);\n * }\n * ```\n */\n async routingDecisions(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentRoutingDecisionsResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/routing-decisions`,\n options,\n );\n }\n\n /**\n * The statement name and suffix each attempt of a payment asked for and was\n * sent to its provider with. A name the merchant, the shop or the connector\n * account configures replaces the payment's own: `name_ignored` /\n * `suffix_ignored` say the payment's value was not used, and a `null` sent\n * value leaves the provider account's own default.\n *\n * Only attempts with a record are listed: one that carried no name and was\n * sent none, or ran before the record existed, is absent.\n *\n * `GET /payments/{paymentId}/statement-descriptors`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.statementDescriptors('pay_abc123');\n * const last = attempts.at(-1);\n * if (last?.name_ignored) console.log(`Sent as ${last.sent_name}`);\n * ```\n */\n async statementDescriptors(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentStatementDescriptorsResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/statement-descriptors`,\n options,\n );\n }\n\n /**\n * Every shipment tracking number added to a payment, oldest first. Cancelled\n * and replaced trackings are included, with `status: 'cancelled'`; a\n * replaced one names its correction in `replaced_by`.\n *\n * `GET /payments/{paymentId}/shipment-tracking`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const { data } = await delopay.payments.listShipmentTracking('pay_abc123');\n * const active = data.filter((t) => t.status === 'shipped');\n * ```\n */\n async listShipmentTracking(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingListResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/shipment-tracking`,\n options,\n );\n }\n\n /**\n * Add a shipment tracking number to a captured PayPal payment. PayPal shows\n * it to the buyer, and emails them when `notify_buyer` is `true`.\n *\n * Safe to retry: the same tracking number on the same payment returns the\n * tracking already added and never adds a second one at PayPal. The same\n * number with a different carrier or items is refused (`HE_01`); change it\n * with {@link Payments.updateShipmentTracking}.\n *\n * Refused with HTTP 400: `IR_06` for invalid input, `IR_16` for a payment\n * PayPal did not process or that is not captured, and a connector error,\n * carrying PayPal's reason, when PayPal refuses the tracking.\n *\n * `POST /payments/{paymentId}/shipment-tracking`\n *\n * @param paymentId - The payment intent ID.\n * @param params - The carrier, tracking number and, optionally, the items.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const tracking = await delopay.payments.addShipmentTracking('pay_abc123', {\n * carrier: 'UPS',\n * tracking_number: '1Z999AA10123456784',\n * notify_buyer: true,\n * });\n * if (tracking.sync_status === 'failed') console.log(tracking.sync_error);\n * ```\n */\n async addShipmentTracking(\n paymentId: string,\n params: ShipmentTrackingCreateRequest,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/shipment-tracking`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Correct, replace or cancel a shipment tracking added earlier.\n *\n * A new `tracking_number`, optionally with a new `carrier`, replaces the\n * tracking: a new tracking is added at PayPal and the old one is cancelled\n * there. A new `carrier` alone is refused once PayPal holds the tracking. The answer is then\n * the **new** tracking, with its own `tracking_id`; the old one reads\n * `status: 'cancelled'` with `replaced_by` set. New `items` replace every\n * item at PayPal. `status: 'cancelled'`, sent alone, withdraws the tracking\n * at PayPal. Safe to retry.\n *\n * `POST /payments/{paymentId}/shipment-tracking/{trackingId}`\n *\n * @param paymentId - The payment intent ID.\n * @param trackingId - The `trk_…` ID of the tracking to change.\n * @param params - At least one field to change.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * await delopay.payments.updateShipmentTracking('pay_abc123', 'trk_abc', {\n * status: 'cancelled',\n * });\n * ```\n */\n async updateShipmentTracking(\n paymentId: string,\n trackingId: string,\n params: ShipmentTrackingUpdateRequest,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/shipment-tracking/${encodeURIComponent(trackingId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Open a playback of the payment's stored checkout recording: the audited\n * act of watching. Answers the manifest — which slices exist, how long the\n * recording runs, whether a pause in it is expected — and the\n * `playback_id` every {@link Payments.replaySlice} call carries.\n *\n * A payment that was never recorded answers `200` with `slices: []` and\n * `session_id: null` — the ordinary case for every payment made before the\n * checkout started recording — not a `404`. `404` means the payment does not\n * exist. Fetch the slices in `sequence` order; a number missing from the\n * list is a gap, not the end.\n *\n * A `POST`, because it writes one audit row: the SDK retries `GET` on its\n * own, and a lost response must not open three playbacks. Calling this\n * again deliberately opens another playback.\n *\n * Requires the `PaymentReplay` permission on a dashboard session in addition\n * to payment read access.\n *\n * `POST /payments/{paymentId}/replay/playback`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n */\n async openReplayPlayback(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ReplayPlaybackResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/replay/playback`,\n options,\n );\n }\n\n /**\n * One slice of the payment's stored checkout recording, read against an\n * open playback: the rrweb events the checkout recorded under that number.\n * `playbackId` and the numbers come from {@link Payments.openReplayPlayback};\n * a `playbackId` that names no playback of this payment opened by this\n * caller, and a number the manifest does not list, both answer `404`.\n * Not audited per slice — the playback was.\n *\n * `GET /payments/{paymentId}/replay/playback/{playbackId}/slices/{sequence}`\n *\n * @param paymentId - The payment intent ID.\n * @param playbackId - The playback, from `openReplayPlayback`.\n * @param sequence - The slice number, from the playback's manifest.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n */\n async replaySlice(\n paymentId: string,\n playbackId: string,\n sequence: number,\n options?: RequestExtras,\n ): Promise<ReplaySliceResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/replay/playback/${encodeURIComponent(playbackId)}/slices/${encodeURIComponent(String(sequence))}`,\n options,\n );\n }\n\n /**\n * Soft-delete a payment. Only payments whose status is in the merchant's\n * delete policy (see {@link Payments.getDeletePolicy}) can be deleted;\n * anything else fails with a precondition error.\n *\n * `DELETE /payments/{paymentId}`\n */\n async delete(paymentId: string, options?: RequestExtras): Promise<PaymentsDeleteResponse> {\n return this.request('DELETE', `/payments/${encodeURIComponent(paymentId)}`, options);\n }\n\n /**\n * The effective deletable-status set for the calling merchant — lets a\n * dashboard show the delete action only where it is allowed.\n *\n * `GET /payments/delete-policy`\n */\n async getDeletePolicy(options?: RequestExtras): Promise<PaymentsDeletePolicyResponse> {\n return this.request('GET', '/payments/delete-policy', options);\n }\n\n // --- Advanced operations (Task 3.2) ---\n\n /** Generate session tokens. `POST /payments/session-tokens` */\n async sessionTokens(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payments/session-tokens', { body: params });\n }\n\n /** Retrieve payment with gateway credentials. `POST /payments/sync` */\n async sync(params: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', '/payments/sync', { body: params });\n }\n\n /** Cancel after partial capture. `POST /payments/{paymentId}/cancel-post-capture` */\n async cancelPostCapture(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/cancel-post-capture`, {\n body: params,\n });\n }\n\n /** Incrementally authorize more funds. `POST /payments/{paymentId}/incremental-authorization` */\n async incrementalAuthorization(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/incremental-authorization`,\n {\n body: params,\n },\n );\n }\n\n /** Extend authorization window. `POST /payments/{paymentId}/extend-authorization` */\n async extendAuthorization(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/extend-authorization`, {\n body: params,\n });\n }\n\n /** Complete authorization. `POST /payments/{paymentId}/complete-authorize` */\n async completeAuthorize(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/complete-authorize`, {\n body: params,\n });\n }\n\n /** Dynamic tax calculation. `POST /payments/{paymentId}/calculate-tax` */\n async calculateTax(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/calculate-tax`, {\n body: params,\n });\n }\n\n /** Update payment metadata. `POST /payments/{paymentId}/update-metadata` */\n async updateMetadata(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/update-metadata`, {\n body: params,\n });\n }\n\n /** Retrieve extended card info. `GET /payments/{paymentId}/extended-card-info` */\n async extendedCardInfo(paymentId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/extended-card-info`);\n }\n\n // --- OLAP extensions (Task 4.2) ---\n\n /** List payments (profile-scoped). `GET /payments/profile/list` */\n async listByProfile(params?: PaymentListParams): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/profile/list', {\n query: paymentListQuery(params),\n });\n }\n\n /** List payments across all shops. `GET /payments/list-all-shops` */\n async listAllShops(params?: PaymentListParams): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/list-all-shops', {\n query: paymentListQuery(params),\n });\n }\n\n /** List payments by filter (POST body). `POST /payments/list` */\n async listByFilter(params: PaymentListFilterConstraints): Promise<PaymentListFilteredResponse> {\n return this.request('POST', '/payments/list', { body: params });\n }\n\n /**\n * List payments by filter, scoped to the caller's profile (the shop-user\n * twin of `listByFilter`). The backend narrows to the profile from the\n * auth context, so `profile_id` / `project_id` must not be sent — and\n * neither may `connector_settlement_status`, which this route refuses\n * (403): a shop-scoped viewer is not shown the settlement state, and the\n * type leaves the key out so it cannot be probed through `total_count`.\n *\n * Not to be confused with {@link Payments.listByProfile}, which is the GET\n * cursor variant and rejects this body.\n *\n * `POST /payments/profile/list`\n */\n async listByProfileFilter(\n params: ProfilePaymentListFilterConstraints,\n options?: RequestExtras,\n ): Promise<PaymentListFilteredResponse> {\n return this.request('POST', '/payments/profile/list', { body: params, ...options });\n }\n\n /** Get payment filter options. `GET /payments/filter` */\n async getFilters(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentListFiltersExt> {\n return this.request('GET', '/payments/filter', { query: params });\n }\n\n /**\n * Get payment filter options, scoped to the caller's profile.\n * `GET /payments/profile/filter`\n */\n async getFiltersByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentListFiltersExt> {\n return this.request('GET', '/payments/profile/filter', { query: params });\n }\n\n /** Get payment aggregates. `GET /payments/aggregate` */\n async aggregate(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/payments/aggregate', { query: params });\n }\n\n /** Get payment aggregates (profile-scoped). `GET /payments/profile/aggregate` */\n async aggregateByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/payments/profile/aggregate', { query: params });\n }\n\n /** Manually update payment status. `PUT /payments/{paymentId}/manual-update` */\n async manualUpdate(paymentId: string, params: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('PUT', `/payments/${encodeURIComponent(paymentId)}/manual-update`, {\n body: params,\n });\n }\n\n /** Approve a payment waiting for review. `POST /payments/{paymentId}/approve` */\n async approve(paymentId: string, params?: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/approve`, {\n body: params,\n });\n }\n\n /** Reject a payment waiting for review. `POST /payments/{paymentId}/reject` */\n async reject(paymentId: string, params?: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/reject`, {\n body: params,\n });\n }\n\n /** Initiate external 3DS authentication. `POST /payments/{paymentId}/3ds/authentication` */\n async threeDsAuthentication(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/3ds/authentication`, {\n body: params,\n });\n }\n}\n\n/** The GET payment lists' query: `integration_origin` goes comma-separated. */\nfunction paymentListQuery(\n params?: PaymentListParams,\n): Record<string, string | number | null | undefined> | undefined {\n if (!params) return undefined;\n const { integration_origin, ...query } = params;\n return {\n ...query,\n ...(Array.isArray(integration_origin)\n ? integration_origin.length\n ? { integration_origin: integration_origin.join(',') }\n : {}\n : integration_origin != null\n ? { integration_origin }\n : {}),\n };\n}\n"],"mappings":";AAgDO,IAAM,WAAN,MAAe;AAAA,EACpB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgDlD,MAAM,OACJ,QACA,SAC0B;AAC1B,WAAO,KAAK,QAAQ,QAAQ,aAAa,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBA,MAAM,SAAS,WAAmB,SAA4D;AAC5F,UAAM,OAAO,aAAa,mBAAmB,SAAS,CAAC;AACvD,QAAI,YAAY,OAAW,QAAO,KAAK,QAAQ,OAAO,IA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k/dist/chunk-ABWAYMN5.cjs","sourcesContent":[null,"// **Payment panes** — merchant-configured payment methods that render as\n// DeloPay-drawn tiles in the embedded checkout instead of inside a connector's\n// own embedded form.\n//\n// Why they exist: Stripe only offers Apple Pay / Google Pay / Link when the\n// *top-level* document's domain is registered as a payment method domain on the\n// merchant's Stripe account. In an embedded iframe that domain is the\n// merchant's shop, not the DeloPay checkout — so the wallet silently\n// disappears. A pane replaces it with our own tile that opens the DeloPay\n// hosted checkout at the top level, in a focused single-method view.\n//\n// Nothing here is Apple-Pay-specific, and since the router published a\n// per-connector capability catalogue nothing here is Stripe-specific either:\n// the feature is \"which of a connector's payment methods render as a pane, and\n// how they look\".\n//\n// This module serves SDK consumers: merchants configuring\n// `metadata.native_panes` on a merchant connector account programmatically\n// (codec), reading the resolved `native_panes` off a checkout payload\n// ({@link PaneView}), or building the focused single-method link that goes\n// behind their own button ({@link focusedCheckoutUrl}).\n//\n// The wire shapes are owned by the API — `native_panes` in\n// the metadata key, the field names and the enum values are contracts with it\n// and with links already in buyers' hands, so the identifiers here were renamed\n// off \"native pane\" and the wire was not.\n//\n// Capability (which connector may publish which method, on which rail) comes\n// from the router at runtime through `connectors.getPanesCatalog()`, not from a\n// table here.\n\n// Type-only, so this module still emits no imports and can be executed\n// standalone. `types.ts` owns the catalogue's wire shapes because they are\n// generated-spec-paired (`scripts/validate-types.ts`); it imports nothing from\n// here, so the dependency runs one way.\nimport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n PaneNativeElement,\n} from './types';\n\nexport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n};\n\n// --- Wire types ---------------------------------------------------------\n\n/**\n * The values {@link decodePanes} recognises. Anything else — a value written by\n * a dashboard newer than this SDK — degrades to `always` rather than throwing\n * or dropping the row: an older SDK reading a newer blob is a normal state\n * during a rollout, and a hard failure there takes out a merchant's whole\n * connector config rather than one tile.\n */\nconst PANE_VISIBILITIES: readonly PaneVisibility[] = ['always', 'embedded_only', 'external_only'];\n\n/**\n * `same_page` and `popup` are kept as written; anything else — including the\n * absent key — is the default `tab`, as it always was.\n */\nfunction parseOpenTarget(raw: unknown): PaneOpenTarget {\n return raw === 'popup' || raw === 'same_page' ? raw : 'tab';\n}\n\nfunction parseVisibility(raw: unknown): PaneVisibility {\n return PANE_VISIBILITIES.find((value) => value === raw) ?? 'always';\n}\n\nconst PANE_NATIVE_ELEMENTS: readonly PaneNativeElement[] = [\n 'everywhere',\n 'embedded_only',\n 'external_only',\n];\n\n/**\n * Read a stored row's native-element choice, tolerantly.\n *\n * Absent decodes to `everywhere`, because that is what the router decodes a\n * missing key to (`admin::NativePaneNativeElement` defaults to it): a row\n * written before the field existed means \"the wallet's own button wherever\n * this pane is offered\", which is what the tile was always a stand-in for. An\n * unknown word degrades the same way rather than dropping the row — the\n * router's own decode is lenient for the same rolling-deploy reason.\n */\nfunction parseNativeElement(raw: unknown): PaneNativeElement {\n return PANE_NATIVE_ELEMENTS.find((value) => value === raw) ?? 'everywhere';\n}\n\n/**\n * One pane exactly as the merchant configures it. Persisted (JSON) under\n * `metadata.native_panes` on the merchant connector account.\n *\n * Field names are the wire contract — renaming one is a migration. The router\n * decodes strictly row by row: a row that fails strict decoding (e.g. a\n * wrong-typed field like `display_order: \"3\"`) is dropped whole with a server\n * log, and the remaining rows still render. This SDK's {@link decodePanes} is\n * additionally per-property tolerant — including clamping `display_order` into\n * the router's `i32` range — so a decode→encode round-trip through the SDK\n * repairs a blob the router would partially drop.\n */\nexport interface Pane {\n /** Catalogue key of the promoted method — see {@link paneMethodInfo}. */\n method: string;\n /** Disabled rows keep their tuning but never reach a buyer. */\n enabled: boolean;\n /** Default-language tile label. Empty falls back to the catalogue name. */\n label: string;\n /** Per-locale overrides of `label`, keyed by checkout locale (`de`, `de-AT`). */\n labelTranslations: Record<string, string>;\n /**\n * Secondary line under the label. `null` means \"use the catalogue default\";\n * an empty string means the merchant deliberately hid the line. That\n * distinction is the whole reason this is nullable and `label` is not.\n */\n sublabel: string | null;\n /** Per-locale overrides of `sublabel`. */\n sublabelTranslations: Record<string, string>;\n /** Section the tile groups under. Empty falls back to the catalogue category. */\n category: string;\n /** Built-in icon key — see {@link PANE_ICON_KEYS}. */\n icon: string;\n /** Custom inline SVG. Sanitized server-side before it reaches a buyer; a\n * rejected payload falls back to the built-in `icon`. */\n iconSvg: string;\n /** Lower renders first; ties break on catalogue order. */\n displayOrder: number;\n /** Where the tile is offered — see {@link PaneVisibility}. */\n visibility: PaneVisibility;\n /** How the embedded checkout opens the focused view — see {@link PaneOpenTarget}. */\n openIn: PaneOpenTarget;\n /**\n * Where the wallet's own button replaces this tile — see\n * {@link PaneNativeElement}. Only meaningful on a method whose catalogue\n * entry says {@link PaneCapability.supports_native_element}; the router\n * ignores it elsewhere. `everywhere` is the default and what a row stored\n * before the field existed decodes to.\n */\n nativeElement: PaneNativeElement;\n /** A shipped look instead of the icon (`paypal`, `card`); `''` or absent = none.\n * Optional because a `Pane` built before the field existed must still encode. */\n preset?: string;\n /** The preset's style; `''` or absent = the preset's default. */\n style?: string;\n}\n\n/**\n * Read a resolved tile's placement rule, across every payload version.\n *\n * Prefer this to touching either field. They are independent on the wire — a\n * payload may carry either, both or neither — and each alone loses a placement\n * rule: `embedded_only` cannot express `external_only`, so an `external_only`\n * tile read through it renders inside the merchant iframe the merchant asked\n * to keep it out of; `visibility` is absent on a router that predates it, so\n * an `embedded_only` tile read through it alone renders at top level too,\n * duplicating a method Stripe's own form already offers there.\n *\n * A recognised `visibility` wins. Otherwise the legacy boolean answers: absent\n * (old router) it carries the only placement that router could express, and\n * unrecognised (newer router) the router still sets it under its own fixed\n * rule. Neither path throws, and both degrade toward showing a tile — losing a\n * placement rule, never stranding a method.\n */\nexport function paneViewVisibility(\n view: Pick<PaneView, 'visibility' | 'embedded_only'>,\n): PaneVisibility {\n const declared = PANE_VISIBILITIES.find((value) => value === view.visibility);\n if (declared) return declared;\n return view.embedded_only === true ? 'embedded_only' : 'always';\n}\n\n// --- Catalogue ----------------------------------------------------------\n\n/**\n * A method the frozen Stripe fallback table knows, with the compiled copy the\n * router shipped for it at the time.\n *\n * Only {@link STRIPE_FALLBACK_PANE_METHODS} is typed with this. The live\n * catalogue (`connectors.getPanesCatalog()`) carries capability facts and no\n * copy at all, by design — see {@link PaneCapability}.\n */\nexport interface PaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethod: string;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethodType: string;\n /** The focused checkout has to collect a billing country to confirm this. */\n requiresBillingCountry: boolean;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * What this SDK assumes when the router cannot answer.\n *\n * The capability endpoint does not exist on an older router, which answers\n * `connectors.getPanesCatalog()` with a 404.\n * Rather than leaving a caller with nothing, the pane helpers default to\n * exactly the behaviour they had before that endpoint existed: panes on the\n * Stripe connector only, with the method set the router's Stripe catalogue had\n * at the time.\n *\n * **This is a degradation path, not a mirror. Do not keep it in sync by hand,\n * and do not add a connector or a method to it** — that is what this table was\n * before the capability endpoint, and adding to it would quietly rebuild the mirror. A\n * connector the router serves panes for arrives through the endpoint and needs\n * no entry here; a connector that needs an entry here to appear is a connector\n * the router will not deliver panes for anyway.\n *\n * The only reason to touch this list is to correct what Stripe's catalogue\n * looked like *before* the endpoint existed, and that is history, so there is\n * no such reason. Once the endpoint is reachable it is never consulted for a\n * connector the router answered for.\n *\n * The redirect-rail set is deliberately narrow — every entry is a variant the\n * Stripe connector accepts and that needs no extra buyer input beyond a\n * billing country. `eps` / `p24` / `bancontact` are absent because Stripe\n * hard-requires billing fields the focused checkout never collects (a full\n * name for EPS and Bancontact, an email for Przelewy24), so their tiles could\n * never succeed.\n *\n * `defaultLabel` / `defaultSublabel` are the copy the router compiled at that\n * time and are frozen with the rest of the table. Copy for a method the live\n * catalogue reports belongs to the consumer's own locale files, keyed by\n * `key` — the router ships none.\n */\nexport const STRIPE_FALLBACK_PANE_METHODS: readonly PaneMethodInfo[] = [\n {\n key: 'apple_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'apple_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Apple Pay',\n defaultSublabel: 'Pay with Apple Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'apple',\n },\n {\n key: 'google_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'google_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Google Pay',\n defaultSublabel: 'Pay with Google Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'google',\n },\n {\n key: 'link',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'link',\n requiresBillingCountry: false,\n defaultLabel: 'Link',\n defaultSublabel: 'Pay with saved details',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'klarna',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'klarna',\n // Stripe's Klarna needs the buyer's country echoed into the confirm body.\n requiresBillingCountry: true,\n defaultLabel: 'Klarna',\n // NOT the router's current \"Pay later or in 3 instalments\". This table is\n // what a router predating the capability endpoint renders, and that copy\n // only gained the \"3\" in the same release that added the endpoint.\n // Restating the new string here\n // would put copy no reachable router emits in front of a merchant, and\n // would change what the deprecated `nativePaneMethodInfo` has returned\n // since 0.106.0.\n defaultSublabel: 'Pay later or in instalments',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'affirm',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'affirm',\n requiresBillingCountry: false,\n defaultLabel: 'Affirm',\n defaultSublabel: 'Pay over time',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'ideal',\n rail: 'redirect',\n paymentMethod: 'bank_redirect',\n paymentMethodType: 'ideal',\n requiresBillingCountry: false,\n defaultLabel: 'iDEAL',\n defaultSublabel: 'Pay from your bank',\n defaultCategory: 'bank_redirect',\n defaultIcon: 'bank',\n },\n {\n key: 'alipay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'ali_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Alipay',\n defaultSublabel: 'Pay with Alipay',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'revolut_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'revolut_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Revolut Pay',\n defaultSublabel: 'Pay with Revolut',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'amazon_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'amazon_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Amazon Pay',\n defaultSublabel: 'Pay with Amazon',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n];\n\n/**\n * {@link STRIPE_FALLBACK_PANE_METHODS} in the shape the live endpoint returns,\n * so every helper below takes one type of catalogue and the degradation path\n * is not a second code path. Derived, not written out: two spellings of one\n * table is exactly the drift this design removes.\n */\nexport const STRIPE_FALLBACK_PANE_CATALOG: PanesConnectorCatalog = {\n connector: 'stripe',\n allowed_rails: ['wallet', 'redirect'],\n methods: STRIPE_FALLBACK_PANE_METHODS.map((info) => ({\n key: info.key,\n rail: info.rail,\n payment_method: info.paymentMethod,\n payment_method_type: info.paymentMethodType,\n requires_billing_country: info.requiresBillingCountry,\n })),\n};\n\n/**\n * An empty catalogue — a connector the router does not offer panes for.\n * Exported so callers can express \"asked, and the answer was no\" without\n * reaching for `null` in the middle of a computation.\n */\nexport function emptyPaneCatalog(connector: string): PanesConnectorCatalog {\n return { connector, allowed_rails: [], methods: [] };\n}\n\n/**\n * Pull one connector's entry out of a `connectors.getPanesCatalog()` response.\n *\n * Returns {@link emptyPaneCatalog} for a connector the response does not name:\n * \"the router knows this connector and publishes no panes for it\" and \"the\n * router has never heard of it\" are the same answer to a caller building an\n * editor, and both mean \"offer nothing\".\n */\nexport function paneCatalogFor(\n response: PanesCatalogResponse,\n connector: string,\n): PanesConnectorCatalog {\n return (\n response.connectors.find((entry) => entry.connector === connector) ??\n emptyPaneCatalog(connector)\n );\n}\n\n/**\n * Built-in tile icon keys the buyer-facing checkout ships a glyph for.\n *\n * Reconciled against both ends: every key here has a branch in the checkout's\n * `NativePaneIcon.svelte`, and every `default_icon` the router's catalogue\n * publishes is in this list. An icon key the checkout does not ship falls\n * through to `wallet` there, so a key that drifts in renders as the wrong\n * glyph rather than as nothing.\n */\nexport const PANE_ICON_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n // Brand marks, not category glyphs: the checkout draws PayPal's monogram,\n // Klarna's squircle-K and the Bitcoin mark for these, the same logos the\n // bespoke panes they replace already drew. Listed here so a merchant's own\n // dashboard can offer them; the router decides which one a tile *defaults*\n // to, and a router predating them simply keeps sending the old default.\n 'paypal',\n 'klarna',\n 'crypto',\n];\n\n/**\n * Section keys a pane's tile may group under.\n *\n * Reconciled against the router's actual `default_category` values rather than\n * against what the Stripe table happened to need. `crypto` and `game_items`\n * are router defaults (the Cryptomus/NowPayments and Skinsback catalogues) and\n * were missing here, so a merchant configuring one of those panes was shown a\n * category their editor did not recognise.\n *\n * A custom value is allowed and renders as its own section under that literal\n * text. The buyer-facing checkout translates a subset of these into a section\n * header and falls through to the raw key for the rest — `crypto` and\n * `game_items` are the two it has yet to add.\n */\nexport const PANE_CATEGORY_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bnpl',\n 'bank_redirect',\n 'bank_transfer',\n 'crypto',\n 'game_items',\n 'cash',\n];\n\n/**\n * Mirror of the router's per-connector cap. Counted differently on each side:\n * {@link decodePanes} stops after 12 *decoded* rows (entries with a usable,\n * non-duplicate `method` — junk and duplicate entries don't consume a slot),\n * while the router caps *accepted* panes (enabled, known, deduplicated) at 12\n * — so an oversized hand-written blob may render a pane this decoder drops.\n * Blobs the SDK itself encodes never exceed the cap.\n */\nexport const PANES_MAX = 12;\n\n/**\n * Look a method up in one connector's catalogue.\n *\n * Pass the entry for the connector being configured, from\n * `connectors.getPanesCatalog()` via {@link paneCatalogFor}. The default is\n * the degradation path and only correct for Stripe on a router that predates\n * the endpoint — see {@link STRIPE_FALLBACK_PANE_CATALOG}.\n */\nexport function paneMethodInfo(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneCapability | undefined {\n return catalog.methods.find((info) => info.key === method);\n}\n\n/** Whether this connector may declare a pane on `rail` at all. A wallet pane\n * on a connector outside its `allowed_rails` is refused at save time — the\n * wallet rail rides on Stripe's Express Checkout Element charging the *same*\n * payment intent the embedded checkout holds, which does not generalise. */\nexport function paneRailAllowed(rail: PaneRail, catalog: PanesConnectorCatalog): boolean {\n return catalog.allowed_rails.includes(rail);\n}\n\n/**\n * The methods a caller may actually offer for this connector: the catalogue's\n * own list, minus anything on a rail the connector does not allow.\n *\n * The router should not report such a pair in the first place, but the two\n * fields are independent in the response and a save that crosses them is\n * refused at the API with an error naming the connector and the method. Filter\n * rather than trust, so a merchant never configures a tile the save will\n * bounce.\n */\nexport function offerablePaneMethods(catalog: PanesConnectorCatalog): PaneCapability[] {\n return catalog.methods.filter((info) => paneRailAllowed(info.rail, catalog));\n}\n\n/** Non-copy display defaults for a tile: which built-in glyph and which\n * section heading a new pane starts on. */\nexport interface PaneDisplayDefaults {\n icon: string;\n category: string;\n}\n\n/**\n * Per-method overrides, for the handful whose brand glyph is not what their\n * payment method would suggest. Everything else is derived from the catalogue\n * entry's `payment_method` below, so a connector the SDK has never heard of\n * still gets a sensible tile rather than a blank one.\n *\n * These have to be keyed by method and not by `payment_method`: `wallet` also\n * routes Link, Alipay, Revolut Pay and Amazon Pay, and `pay_later` also routes\n * Affirm — none of which the SDK has a mark for. Getting this wrong is not a\n * cosmetic slip that the next release fixes, because {@link defaultPane}\n * materialises the value and {@link encodePanes} writes it to\n * `metadata.native_panes`, where a stored `icon` outranks the router's\n * `default_icon` for the life of the pane.\n */\nconst DISPLAY_DEFAULTS_BY_KEY: Readonly<Record<string, PaneDisplayDefaults>> = {\n apple_pay: { icon: 'apple', category: 'wallet' },\n google_pay: { icon: 'google', category: 'wallet' },\n paypal: { icon: 'paypal', category: 'wallet' },\n // Both the Klarna connector's own tile and Stripe's Klarna. Affirm stays on\n // the generic `bnpl` glyph — same rail, no mark of its own.\n klarna: { icon: 'klarna', category: 'bnpl' },\n};\n\n/**\n * Derived from the `payment_method` half of the catalogue's routing pair.\n * Every value here reproduces the router's own `default_icon` /\n * `default_category` for the methods it publishes today, so a tile the SDK\n * lays out and a tile the router lays out agree.\n */\nconst DISPLAY_DEFAULTS_BY_PAYMENT_METHOD: Readonly<Record<string, PaneDisplayDefaults>> = {\n wallet: { icon: 'wallet', category: 'wallet' },\n card: { icon: 'card', category: 'card' },\n card_redirect: { icon: 'card', category: 'card' },\n pay_later: { icon: 'bnpl', category: 'bnpl' },\n bank_redirect: { icon: 'bank', category: 'bank_redirect' },\n bank_transfer: { icon: 'bank', category: 'bank_transfer' },\n bank_debit: { icon: 'bank', category: 'bank_transfer' },\n // Cryptomus and NowPayments publish the same `crypto` key on this rail, and\n // the router defaults both to the Bitcoin mark.\n crypto: { icon: 'crypto', category: 'crypto' },\n // Skinsback, which has no mark: the router defaults it to `wallet` too.\n game_items: { icon: 'wallet', category: 'game_items' },\n cash: { icon: 'cash', category: 'cash' },\n voucher: { icon: 'cash', category: 'cash' },\n};\n\nconst DISPLAY_DEFAULTS_FALLBACK: PaneDisplayDefaults = { icon: 'wallet', category: 'wallet' };\n\n/**\n * What a new tile looks like before the merchant designs it.\n *\n * The router serves capability, not presentation, so the glyph and the section\n * come from here and the accompanying text comes from the caller's own locale\n * files. A method with no entry at all still resolves — that is the point of\n * deriving from `payment_method`: a connector added to the router's catalogue\n * tomorrow needs no SDK release to be designable today.\n */\nexport function paneDisplayDefaults(info: PaneCapability | undefined): PaneDisplayDefaults {\n if (!info) return DISPLAY_DEFAULTS_FALLBACK;\n return (\n DISPLAY_DEFAULTS_BY_KEY[info.key] ??\n DISPLAY_DEFAULTS_BY_PAYMENT_METHOD[info.payment_method] ??\n DISPLAY_DEFAULTS_FALLBACK\n );\n}\n\n// --- Validation ---------------------------------------------------------\n\n/**\n * Why a configured pane would not survive a save or a render.\n *\n * - `method_unknown` — the connector's catalogue does not publish this key, so\n * the router drops the row at render.\n * - `rail_not_allowed` — the method's rail is not in the connector's\n * `allowed_rails`; the API refuses this at save time.\n * - `over_cap` — past the router's per-connector cap of {@link PANES_MAX}; the\n * row is stored but never rendered.\n * - `duplicate_method` — an earlier enabled row already claims this method.\n * The router skips disabled rows and then dedupes, so the first *enabled*\n * row renders and every later one is dropped in silence. Reported on the\n * losing rows, never on the one that survives.\n */\nexport type PaneIssueCode = 'method_unknown' | 'rail_not_allowed' | 'over_cap' | 'duplicate_method';\n\nexport interface PaneIssue {\n /** Index into the list handed to {@link validatePanes}. */\n index: number;\n method: string;\n code: PaneIssueCode;\n}\n\n/**\n * Check a configured list against one connector's catalogue, before writing it\n * to `metadata.native_panes`.\n *\n * The API applies the same rules at save time, so this changes where the\n * merchant finds out, not whether they do — and an SDK caller building an\n * editor would otherwise learn it from a bounced request with no row to point\n * at. An empty result means nothing here will be refused or silently dropped.\n */\nexport function validatePanes(\n panes: readonly Pane[],\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneIssue[] {\n const issues: PaneIssue[] = [];\n // Keyed on the catalogue's own key rather than the raw string, because that\n // is what the router dedupes on. Only enabled rows are recorded: a disabled\n // row never reaches the router's `seen` set, so it neither claims a method\n // nor loses to one.\n const claimedBy = new Set<string>();\n panes.forEach((pane, index) => {\n const info = paneMethodInfo(pane.method, catalog);\n if (!info) {\n issues.push({ index, method: pane.method, code: 'method_unknown' });\n } else if (!paneRailAllowed(info.rail, catalog)) {\n issues.push({ index, method: pane.method, code: 'rail_not_allowed' });\n } else if (pane.enabled) {\n // Unknown and rail-refused rows are dropped before the router dedupes,\n // so they cannot claim a key — and reporting two codes for one row would\n // point the merchant at the wrong repair.\n if (claimedBy.has(info.key)) {\n issues.push({ index, method: pane.method, code: 'duplicate_method' });\n } else {\n claimedBy.add(info.key);\n }\n }\n if (index >= PANES_MAX) issues.push({ index, method: pane.method, code: 'over_cap' });\n });\n return issues;\n}\n\n// --- Codec --------------------------------------------------------------\n\n/**\n * A new pane for `method`, with its glyph and section resolved from the\n * connector's catalogue entry rather than from a Stripe-keyed table — so\n * `defaultPane('creem_checkout', catalog)` is a designed tile and not a blank\n * one.\n *\n * Pass the catalogue entry for the connector being configured; the default is\n * the degradation path (see {@link STRIPE_FALLBACK_PANE_CATALOG}). Labels are\n * deliberately left empty: empty means \"use the catalogue default\", which the\n * router resolves at render, and the router ships no copy for a caller to\n * mirror.\n */\nexport function defaultPane(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): Pane {\n const defaults = paneDisplayDefaults(paneMethodInfo(method, catalog));\n return {\n method,\n enabled: true,\n label: '',\n labelTranslations: {},\n sublabel: null,\n sublabelTranslations: {},\n category: defaults.category,\n icon: defaults.icon,\n iconSvg: '',\n displayOrder: 0,\n visibility: 'always',\n openIn: 'tab',\n nativeElement: 'everywhere',\n preset: '',\n style: '',\n };\n}\n\nexport function clonePane(pane: Pane): Pane {\n return {\n ...pane,\n labelTranslations: { ...pane.labelTranslations },\n sublabelTranslations: { ...pane.sublabelTranslations },\n };\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction parseTranslations(raw: unknown): Record<string, string> {\n if (!isObject(raw)) return {};\n const out: Record<string, string> = {};\n for (const [locale, value] of Object.entries(raw)) {\n if (typeof value === 'string' && value.length > 0) out[locale] = value;\n }\n return out;\n}\n\nfunction str(raw: unknown): string {\n return typeof raw === 'string' ? raw : '';\n}\n\n// `display_order` is a 32-bit signed integer on the wire, and a\n// fractional or out-of-range value fails its strict row decode — dropping the\n// whole row server-side while an SDK round-trip would keep the blob looking\n// healthy. Clamped on BOTH decode and encode so this codec never emits a\n// value the router rejects, regardless of where the number came from.\nconst DISPLAY_ORDER_MIN = -2147483648;\nconst DISPLAY_ORDER_MAX = 2147483647;\n\nfunction clampDisplayOrder(raw: number): number {\n if (!Number.isFinite(raw)) return 0;\n return Math.min(DISPLAY_ORDER_MAX, Math.max(DISPLAY_ORDER_MIN, Math.trunc(raw)));\n}\n\n/**\n * Decode the stored `metadata.native_panes` blob into editor rows.\n *\n * Tolerant like the branding codecs: anything malformed falls back per\n * property, rows without a usable `method` are dropped, duplicates keep the\n * first occurrence — except that an enabled row wins over an earlier disabled\n * one for the same method, because that is the row the router renders — and\n * decoding stops after {@link PANES_MAX} decoded rows (dropped junk/duplicate\n * entries don't consume a slot). That is more forgiving than the router, which\n * drops a strict-decode-failing row whole (keeping the rest) and caps accepted\n * panes rather than decoded rows — see {@link Pane} and {@link PANES_MAX}.\n * Returns `null` when the input is not an array so the caller can distinguish\n * \"never configured\" from \"cleared\".\n */\nexport function decodePanes(raw: unknown): Pane[] | null {\n if (!Array.isArray(raw)) return null;\n const decodeRow = (entry: Record<string, unknown>, method: string): Pane => ({\n method,\n enabled: entry['enabled'] !== false,\n label: str(entry['label']),\n labelTranslations: parseTranslations(entry['label_translations']),\n sublabel: typeof entry['sublabel'] === 'string' ? entry['sublabel'] : null,\n sublabelTranslations: parseTranslations(entry['sublabel_translations']),\n category: str(entry['category']),\n icon: str(entry['icon']),\n iconSvg: str(entry['icon_svg']),\n displayOrder: clampDisplayOrder(Number(entry['display_order'])),\n // Anything unrecognised degrades to `always` rather than dropping the row.\n visibility: parseVisibility(entry['visibility']),\n // Same tolerance: an unknown value degrades to the default `tab`.\n openIn: parseOpenTarget(entry['open_in']),\n nativeElement: parseNativeElement(entry['native_element']),\n preset: str(entry['preset']),\n style: str(entry['style']),\n });\n\n const indexByMethod = new Map<string, number>();\n const out: Pane[] = [];\n for (const entry of raw) {\n if (out.length >= PANES_MAX) break;\n if (!isObject(entry)) continue;\n const method = str(entry['method']).trim();\n if (!method) continue;\n const kept = indexByMethod.get(method);\n if (kept !== undefined) {\n // Duplicate method. Keep the row the ROUTER would render: it skips\n // disabled rows BEFORE deduping, so where a blob\n // holds both a disabled and an enabled row for one method, buyers see\n // the enabled one. Keeping the disabled row here would show the merchant\n // a pane that is off while it is live, and persist that on the next save.\n const enabled = entry['enabled'] !== false;\n const existing = out[kept];\n if (enabled && existing && !existing.enabled) out[kept] = decodeRow(entry, method);\n continue;\n }\n indexByMethod.set(method, out.length);\n out.push(decodeRow(entry, method));\n }\n return out;\n}\n\n/**\n * Encode editor rows back into the snake_case blob the connector account\n * stores. Empty optional strings are omitted so the metadata stays small and a\n * merchant who typed nothing round-trips as \"use the catalogue default\" rather\n * than as an explicit empty override.\n *\n * `sublabel` is the exception: an explicitly-empty value is preserved (as `\"\"`)\n * because that is how a merchant hides the second line.\n */\nexport function encodePanes(panes: Pane[]): Record<string, unknown>[] {\n const nonEmpty = (map: Record<string, string>): Record<string, string> | undefined => {\n const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n };\n return panes.slice(0, PANES_MAX).map((pane) => {\n const labelTranslations = nonEmpty(pane.labelTranslations);\n const sublabelTranslations = nonEmpty(pane.sublabelTranslations);\n return {\n method: pane.method,\n enabled: pane.enabled,\n ...(pane.label.trim() ? { label: pane.label.trim() } : {}),\n ...(labelTranslations ? { label_translations: labelTranslations } : {}),\n // `null` omits the key entirely (catalogue default wins); `''` is sent\n // as-is because that is how the merchant hides the second line.\n ...(pane.sublabel !== null ? { sublabel: pane.sublabel } : {}),\n ...(sublabelTranslations ? { sublabel_translations: sublabelTranslations } : {}),\n ...(pane.category.trim() ? { category: pane.category.trim() } : {}),\n ...(pane.icon.trim() ? { icon: pane.icon.trim() } : {}),\n ...(pane.iconSvg.trim() ? { icon_svg: pane.iconSvg.trim() } : {}),\n // Clamped on encode too, not only decode: the router's strict i32 row\n // decode drops a row whole for a fractional or out-of-range value, so\n // writing e.g. 3.5 or Date.now() verbatim would silently delete the\n // pane at render while every read surface shows it healthy.\n display_order: clampDisplayOrder(pane.displayOrder),\n // Normalised on encode for the same reason `display_order` is clamped:\n // the router's strict row decode drops a row whole on a value outside\n // its enum, and a caller who built a `Pane` by hand (or in plain JS)\n // never went through `decodePanes`. A decoded pane always holds a valid\n // value, so this is a no-op on the round-trip path.\n visibility: parseVisibility(pane.visibility),\n open_in: parseOpenTarget(pane.openIn),\n // Omitted at the default: `everywhere` is what the router decodes an\n // absent key to, so leaving it out changes nothing — and keeps a blob\n // stored before the field existed byte-identical on re-encode, which\n // is what the wire-compatibility test pins.\n ...(parseNativeElement(pane.nativeElement) === 'everywhere'\n ? {}\n : { native_element: parseNativeElement(pane.nativeElement) }),\n // Absent and blank both mean \"no look\": a pane shaped before the fields\n // existed encodes exactly as it always did.\n ...((pane.preset ?? '').trim() ? { preset: (pane.preset ?? '').trim() } : {}),\n ...((pane.style ?? '').trim() ? { style: (pane.style ?? '').trim() } : {}),\n };\n });\n}\n\n// --- Focused checkout URL ----------------------------------------------\n\n/**\n * A payment link id the hosted checkout serves on its own, as\n * `/pay/{payment_link_id}`: the lowercase, hyphenated UUID the API issues.\n */\nconst OPAQUE_PAYMENT_LINK_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nexport interface FocusedCheckoutUrlParams {\n /**\n * Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`.\n *\n * Take it from the payment itself when you can: the origin of its\n * `payment_link.link` (`new URL(payment.payment_link.link).origin`). A\n * shop can have its own checkout address, and its links open there, not on\n * the default one. A fixed base sends the buyer to a different address\n * than the payment's own link.\n */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /**\n * The payment's `payment_link.payment_link_id`. When it is the opaque id the\n * API issues (a lowercase, hyphenated UUID), the link is\n * `/pay/{payment_link_id}`, which names neither the merchant nor the\n * payment. Omitted, or an older `plink_` id, keeps\n * `/pay/{merchantId}/{paymentId}`, which the checkout still serves.\n */\n paymentLinkId?: string | null;\n /** Pane method key to focus on (`apple_pay`, `klarna`, …). */\n method: string;\n /**\n * Connector that owns the tile, forwarded as `connector=`.\n *\n * A bare `pane=` resolves to the **first payable match in server-sorted\n * order**, which is unambiguous only while one connector publishes a given\n * key. Stripe publishes `klarna` and so does the Klarna connector, so a deep\n * link that names neither charges through whichever tile happens to sort\n * first. Name the connector whenever you know it.\n *\n * Optional because links minted before this parameter existed are already in\n * merchants' pages and still have to resolve.\n */\n connector?: string;\n /**\n * Merchant connector ACCOUNT that owns the tile, forwarded as `mca=`.\n *\n * Needed for the same reason `connector` is, one level down: a profile may\n * hold two enabled accounts of one connector, each publishing its own tile,\n * and the two links would otherwise be identical. Only meaningful alongside\n * `connector`.\n */\n merchantConnectorId?: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n /**\n * Set when the merchant's checkout-custom-field answers are already\n * persisted on the payment — forwarded as `cf=1` so the focused view skips\n * asking a second time. Purely a UI hint: the values live on the intent\n * either way, and the backend only accepts the merchant's configured field\n * keys from a client, so a wrongly-set flag can at worst skip an\n * informational prompt. This is the same hint the embedded pane sets when\n * it opens the focused view.\n */\n customFieldsCollected?: boolean;\n}\n\n/**\n * Build the link to the **focused single-method checkout**: the DeloPay hosted\n * checkout rendered with one payment method, one button, no picker.\n *\n * Two callers:\n * - the embedded checkout, which opens this in a new tab when a buyer clicks\n * a pane tile, and\n * - a merchant running their own checkout, who puts it behind their own\n * button — the same mechanism without an iframe.\n *\n * `method` is not limited to configured panes. A configured pane gets the\n * focused one-button view; `card`, `paypal`, `crypto_currency` and the\n * local-methods catalogs (by method key or vendor code) open the checkout\n * pinned to that method. Methods that exist only as a tab inside a connector's\n * own embedded form — iDEAL, Bancontact, P24 and the like, unless promoted to\n * a pane — cannot be isolated, because the connector owns that surface. An\n * unknown or unavailable method is never a dead end: the checkout shows a\n * notice with a visible \"show all payment methods\" action.\n *\n * Pass {@link FocusedCheckoutUrlParams.connector} (and\n * {@link FocusedCheckoutUrlParams.merchantConnectorId}) whenever you know\n * them. Without them the method key alone picks the first payable match, and\n * more than one connector can publish the same key. Omitting them produces\n * exactly the URL this function has always produced, so links already minted\n * are unaffected.\n *\n * Open it **at the top level** (a new tab or a full-page navigation). The whole\n * point is that the top-level domain is the registered payment method domain;\n * rendering it in an iframe puts you back where you started.\n *\n * If you open it with `window.open`, call that **synchronously inside the click\n * handler** or the popup blocker will eat it, and make sure any iframe you\n * render DeloPay in permits popups (`allow-popups`, plus\n * `allow-popups-to-escape-sandbox` under a restrictive `sandbox`).\n */\nexport function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ pane: params.method });\n // Parameter order matches the embedded checkout's own `focusedUrl`\n // (`NativePanesPane.svelte`), so a merchant's deep link and a tile click\n // produce the same string for the same tile. A blank value is treated as\n // absent rather than emitted empty: `connector=` would otherwise read as a\n // connector named \"\" instead of as \"not specified\".\n const connector = params.connector?.trim();\n if (connector) query.set('connector', connector);\n const merchantConnectorId = params.merchantConnectorId?.trim();\n if (merchantConnectorId) query.set('mca', merchantConnectorId);\n if (params.locale) query.set('locale', params.locale);\n if (params.customFieldsCollected) query.set('cf', '1');\n return `${path}?${query.toString()}`;\n}\n\n// --- Checkout entries --------------------------------------------------\n\nexport interface CheckoutEntryUrlParams {\n /**\n * Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`.\n * Take it from the payment's `payment_link.link`, as\n * {@link FocusedCheckoutUrlParams.checkoutBaseUrl} explains.\n */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /** The payment's `payment_link.payment_link_id`; see {@link FocusedCheckoutUrlParams.paymentLinkId}. */\n paymentLinkId?: string | null;\n /** The entry's `key`, as configured on the shop (`CheckoutEntry.key`). */\n entry: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n}\n\n/**\n * The link to one of the shop's **checkout entries** for a payment: the hosted\n * checkout with `?entry=<key>`, showing only that entry's methods in its\n * named look. Every entry of one payment charges the same payment, so the\n * buyer can move between them and still pays once.\n *\n * A `card` entry is meant for an iframe in your own page\n * (`<iframe src={checkoutEntryUrl(...)} allow=\"payment\">`, with your page's\n * origin in the shop's iframe origins). Its \"Other payment methods\" action\n * opens the entry the shop configured in a new tab, and also posts\n * {@link CheckoutOpenEntryMessage} to your page, so you can navigate yourself\n * instead. Give a sandboxed iframe `allow-popups` and\n * `allow-popups-to-escape-sandbox`, or the tab is refused and the buyer gets\n * a plain link. Open a `methods` entry at the top level.\n *\n * An entry key the shop does not have, and an entry with nothing for this\n * payment, show an explanation and no methods: an entry never falls back to\n * the full checkout.\n */\nexport function checkoutEntryUrl(params: CheckoutEntryUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ entry: params.entry.trim() });\n if (params.locale) query.set('locale', params.locale);\n return `${path}?${query.toString()}`;\n}\n\n/**\n * What an embedded card entry posts to your page when the buyer presses\n * \"Other payment methods\": the payment, the entry the shop configured and its\n * link. Sent only to the shop's iframe origins. `source` names the sending\n * checkout and follows the deployment's branding, so match on `type`.\n */\nexport interface CheckoutOpenEntryMessage {\n source: string;\n type: 'open_entry';\n payment_id: string;\n entry: string;\n url: string;\n}\n\n/** Whether a `message` event's `data` is a {@link CheckoutOpenEntryMessage}. */\nexport function isCheckoutOpenEntryMessage(data: unknown): data is CheckoutOpenEntryMessage {\n if (typeof data !== 'object' || data === null) return false;\n const message = data as Record<string, unknown>;\n return (\n message.type === 'open_entry' &&\n typeof message.source === 'string' &&\n typeof message.payment_id === 'string' &&\n typeof message.entry === 'string' &&\n typeof message.url === 'string'\n );\n}\n\n// --- Buyer-side checkout events ----------------------------------------\n\n/**\n * The closed vocabulary of buyer-side checkout events recorded on the payment's\n * status timeline. Written through\n * `POST /payment-link/{merchant_id}/{payment_id}/checkout-events`, authorized\n * with the payment's `client_secret` as a bearer token.\n *\n * The `native_pane_` prefix is the router's enum on the wire and does not move\n * with the rename — see the module header.\n */\nexport const CHECKOUT_EVENT_KINDS = [\n 'native_pane_selected',\n 'native_pane_tab_opened',\n 'native_pane_tab_blocked',\n 'native_pane_abandoned',\n 'native_pane_returned',\n 'checkout_cancelled',\n] as const;\n\nexport type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];\n\n// --- Deprecated aliases -------------------------------------------------\n//\n// The pre-0.109.0 names, kept so an external `@delopay/sdk` consumer upgrades\n// on their own schedule rather than on ours. **Scheduled for removal in\n// 0.112.0** — see CHANGELOG.md. Nothing in this repo uses them.\n\n/** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */\nexport type StripeNativePane = Pane;\n/** @deprecated Renamed to {@link PaneView}. Removed in 0.112.0. */\nexport type NativePaneView = PaneView;\n/** @deprecated Renamed to {@link PaneVisibility}. Removed in 0.112.0. */\nexport type NativePaneVisibility = PaneVisibility;\n/** @deprecated Renamed to {@link PaneOpenTarget}. Removed in 0.112.0. */\nexport type NativePaneOpenTarget = PaneOpenTarget;\n/** @deprecated Spelt {@link PaneNativeElement} on the SDK side. Removed in 0.112.0. */\nexport type NativePaneNativeElement = PaneNativeElement;\n/**\n * @deprecated Superseded by {@link PaneMethodInfo}. Removed in 0.112.0.\n *\n * Deliberately **not** an alias of `PaneMethodInfo`: that type gained three\n * required routing fields (`paymentMethod`, `paymentMethodType`,\n * `requiresBillingCountry`), and a consumer who wrote an object literal or a\n * function return against the 0.108 shape would stop compiling on a deprecated\n * name that promises the opposite. This stays the six fields that shape had.\n *\n * `PaneMethodInfo` is structurally assignable to it, so everything this SDK\n * hands back — including {@link nativePaneMethodInfo} — still satisfies it.\n */\nexport interface NativePaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * @deprecated Renamed to {@link STRIPE_FALLBACK_PANE_METHODS}, which is a\n * degradation path and not a catalogue mirror. Removed in 0.112.0.\n */\nexport const STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;\n/** @deprecated Renamed to {@link PANE_ICON_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;\n/** @deprecated Renamed to {@link PANE_CATEGORY_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_CATEGORY_KEYS = PANE_CATEGORY_KEYS;\n/** @deprecated Renamed to {@link PANES_MAX}. Removed in 0.112.0. */\nexport const NATIVE_PANES_MAX = PANES_MAX;\n\n/**\n * @deprecated Superseded by {@link paneMethodInfo}, which takes the connector's\n * catalogue and answers for every connector rather than only for Stripe.\n * Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old return type: it answers out of the frozen Stripe table and carries that\n * table's compiled copy, which the live catalogue deliberately does not have.\n */\nexport function nativePaneMethodInfo(method: string): PaneMethodInfo | undefined {\n return STRIPE_FALLBACK_PANE_METHODS.find((info) => info.key === method);\n}\n\n/**\n * @deprecated Superseded by {@link defaultPane}. Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old behaviour: it leaves `category` empty and resolves `icon` out of the\n * frozen Stripe table only. `defaultPane` fills both from the connector's\n * catalogue, which is the fix — but a caller on the old name encodes whatever\n * it is handed, and quietly turning a blank field into a stored override is\n * not something a deprecated alias should do to a merchant's saved config.\n */\nexport function defaultNativePane(method: string): Pane {\n const info = nativePaneMethodInfo(method);\n return {\n ...defaultPane(method),\n category: '',\n icon: info?.defaultIcon ?? '',\n };\n}\n\n/** @deprecated Renamed to {@link clonePane}. Removed in 0.112.0. */\nexport const cloneNativePane = clonePane;\n/** @deprecated Renamed to {@link decodePanes}. Removed in 0.112.0. */\nexport const decodeNativePanes = decodePanes;\n/** @deprecated Renamed to {@link encodePanes}. Removed in 0.112.0. */\nexport const encodeNativePanes = encodePanes;\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ABWAYMN5.cjs","../src/panes.ts"],"names":[],"mappings":"AAAA;ACqEA,IAAM,kBAAA,EAA+C,CAAC,QAAA,EAAU,eAAA,EAAiB,eAAe,CAAA;AAMhG,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,OAAO,IAAA,IAAQ,QAAA,GAAW,IAAA,IAAQ,YAAA,EAAc,IAAA,EAAM,KAAA;AACxD;AAEA,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,wBAAO,iBAAA,CAAkB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU,GAAG,CAAA,UAAK,UAAA;AAC7D;AAEA,IAAM,qBAAA,EAAqD;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D,EAAA,MAAM,KAAA,EACJ,MAAA,CAAO,cAAA,GAAiB,sBAAA,CAAuB,IAAA,CAAK,MAAA,CAAO,aAAa,EAAA,EACpE,CAAA,EAAA;AAES,IAAA;AACR,EAAA;AACkD,EAAA;AAMhB,EAAA;AACM,EAAA;AACc,EAAA;AACA,EAAA;AACT,EAAA;AACC,EAAA;AACnB,EAAA;AACpC;AAwCyE;AACjB,EAAA;AAGhD,EAAA;AAES,IAAA;AACR,EAAA;AACyD,EAAA;AACZ,EAAA;AAClB,EAAA;AACpC;AAiB4F;AACpC,EAAA;AACtC,EAAA;AAIP,EAAA;AAIX;AAaoC;AAClC,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACF;AAiD0C;AAEL;AAEI;AAET;AAWiD;AACT,EAAA;AACxE;AAYwD;AACd,EAAA;AACjC,EAAA;AACgB,IAAA;AACX,IAAA;AACiB,IAAA;AAC7B,EAAA;AACF;AAG+B;AAEE;AAEA;ADztB2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ABWAYMN5.cjs","sourcesContent":[null,"// **Payment panes** — merchant-configured payment methods that render as\n// DeloPay-drawn tiles in the embedded checkout instead of inside a connector's\n// own embedded form.\n//\n// Why they exist: Stripe only offers Apple Pay / Google Pay / Link when the\n// *top-level* document's domain is registered as a payment method domain on the\n// merchant's Stripe account. In an embedded iframe that domain is the\n// merchant's shop, not the DeloPay checkout — so the wallet silently\n// disappears. A pane replaces it with our own tile that opens the DeloPay\n// hosted checkout at the top level, in a focused single-method view.\n//\n// Nothing here is Apple-Pay-specific, and since the router published a\n// per-connector capability catalogue nothing here is Stripe-specific either:\n// the feature is \"which of a connector's payment methods render as a pane, and\n// how they look\".\n//\n// This module serves SDK consumers: merchants configuring\n// `metadata.native_panes` on a merchant connector account programmatically\n// (codec), reading the resolved `native_panes` off a checkout payload\n// ({@link PaneView}), or building the focused single-method link that goes\n// behind their own button ({@link focusedCheckoutUrl}).\n//\n// The wire shapes are owned by the API — `native_panes` in\n// the metadata key, the field names and the enum values are contracts with it\n// and with links already in buyers' hands, so the identifiers here were renamed\n// off \"native pane\" and the wire was not.\n//\n// Capability (which connector may publish which method, on which rail) comes\n// from the router at runtime through `connectors.getPanesCatalog()`, not from a\n// table here.\n\n// Type-only, so this module still emits no imports and can be executed\n// standalone. `types.ts` owns the catalogue's wire shapes because they are\n// generated-spec-paired (`scripts/validate-types.ts`); it imports nothing from\n// here, so the dependency runs one way.\nimport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n PaneNativeElement,\n} from './types';\n\nexport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n};\n\n// --- Wire types ---------------------------------------------------------\n\n/**\n * The values {@link decodePanes} recognises. Anything else — a value written by\n * a dashboard newer than this SDK — degrades to `always` rather than throwing\n * or dropping the row: an older SDK reading a newer blob is a normal state\n * during a rollout, and a hard failure there takes out a merchant's whole\n * connector config rather than one tile.\n */\nconst PANE_VISIBILITIES: readonly PaneVisibility[] = ['always', 'embedded_only', 'external_only'];\n\n/**\n * `same_page` and `popup` are kept as written; anything else — including the\n * absent key — is the default `tab`, as it always was.\n */\nfunction parseOpenTarget(raw: unknown): PaneOpenTarget {\n return raw === 'popup' || raw === 'same_page' ? raw : 'tab';\n}\n\nfunction parseVisibility(raw: unknown): PaneVisibility {\n return PANE_VISIBILITIES.find((value) => value === raw) ?? 'always';\n}\n\nconst PANE_NATIVE_ELEMENTS: readonly PaneNativeElement[] = [\n 'everywhere',\n 'embedded_only',\n 'external_only',\n];\n\n/**\n * Read a stored row's native-element choice, tolerantly.\n *\n * Absent decodes to `everywhere`, because that is what the router decodes a\n * missing key to (`admin::NativePaneNativeElement` defaults to it): a row\n * written before the field existed means \"the wallet's own button wherever\n * this pane is offered\", which is what the tile was always a stand-in for. An\n * unknown word degrades the same way rather than dropping the row — the\n * router's own decode is lenient for the same rolling-deploy reason.\n */\nfunction parseNativeElement(raw: unknown): PaneNativeElement {\n return PANE_NATIVE_ELEMENTS.find((value) => value === raw) ?? 'everywhere';\n}\n\n/**\n * One pane exactly as the merchant configures it. Persisted (JSON) under\n * `metadata.native_panes` on the merchant connector account.\n *\n * Field names are the wire contract — renaming one is a migration. The router\n * decodes strictly row by row: a row that fails strict decoding (e.g. a\n * wrong-typed field like `display_order: \"3\"`) is dropped whole with a server\n * log, and the remaining rows still render. This SDK's {@link decodePanes} is\n * additionally per-property tolerant — including clamping `display_order` into\n * the router's `i32` range — so a decode→encode round-trip through the SDK\n * repairs a blob the router would partially drop.\n */\nexport interface Pane {\n /** Catalogue key of the promoted method — see {@link paneMethodInfo}. */\n method: string;\n /** Disabled rows keep their tuning but never reach a buyer. */\n enabled: boolean;\n /** Default-language tile label. Empty falls back to the catalogue name. */\n label: string;\n /** Per-locale overrides of `label`, keyed by checkout locale (`de`, `de-AT`). */\n labelTranslations: Record<string, string>;\n /**\n * Secondary line under the label. `null` means \"use the catalogue default\";\n * an empty string means the merchant deliberately hid the line. That\n * distinction is the whole reason this is nullable and `label` is not.\n */\n sublabel: string | null;\n /** Per-locale overrides of `sublabel`. */\n sublabelTranslations: Record<string, string>;\n /** Section the tile groups under. Empty falls back to the catalogue category. */\n category: string;\n /** Built-in icon key — see {@link PANE_ICON_KEYS}. */\n icon: string;\n /** Custom inline SVG. Sanitized server-side before it reaches a buyer; a\n * rejected payload falls back to the built-in `icon`. */\n iconSvg: string;\n /** Lower renders first; ties break on catalogue order. */\n displayOrder: number;\n /** Where the tile is offered — see {@link PaneVisibility}. */\n visibility: PaneVisibility;\n /** How the embedded checkout opens the focused view — see {@link PaneOpenTarget}. */\n openIn: PaneOpenTarget;\n /**\n * Where the wallet's own button replaces this tile — see\n * {@link PaneNativeElement}. Only meaningful on a method whose catalogue\n * entry says {@link PaneCapability.supports_native_element}; the router\n * ignores it elsewhere. `everywhere` is the default and what a row stored\n * before the field existed decodes to.\n */\n nativeElement: PaneNativeElement;\n /** A shipped look instead of the icon (`paypal`, `card`); `''` or absent = none.\n * Optional because a `Pane` built before the field existed must still encode. */\n preset?: string;\n /** The preset's style; `''` or absent = the preset's default. */\n style?: string;\n}\n\n/**\n * Read a resolved tile's placement rule, across every payload version.\n *\n * Prefer this to touching either field. They are independent on the wire — a\n * payload may carry either, both or neither — and each alone loses a placement\n * rule: `embedded_only` cannot express `external_only`, so an `external_only`\n * tile read through it renders inside the merchant iframe the merchant asked\n * to keep it out of; `visibility` is absent on a router that predates it, so\n * an `embedded_only` tile read through it alone renders at top level too,\n * duplicating a method Stripe's own form already offers there.\n *\n * A recognised `visibility` wins. Otherwise the legacy boolean answers: absent\n * (old router) it carries the only placement that router could express, and\n * unrecognised (newer router) the router still sets it under its own fixed\n * rule. Neither path throws, and both degrade toward showing a tile — losing a\n * placement rule, never stranding a method.\n */\nexport function paneViewVisibility(\n view: Pick<PaneView, 'visibility' | 'embedded_only'>,\n): PaneVisibility {\n const declared = PANE_VISIBILITIES.find((value) => value === view.visibility);\n if (declared) return declared;\n return view.embedded_only === true ? 'embedded_only' : 'always';\n}\n\n// --- Catalogue ----------------------------------------------------------\n\n/**\n * A method the frozen Stripe fallback table knows, with the compiled copy the\n * router shipped for it at the time.\n *\n * Only {@link STRIPE_FALLBACK_PANE_METHODS} is typed with this. The live\n * catalogue (`connectors.getPanesCatalog()`) carries capability facts and no\n * copy at all, by design — see {@link PaneCapability}.\n */\nexport interface PaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethod: string;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethodType: string;\n /** The focused checkout has to collect a billing country to confirm this. */\n requiresBillingCountry: boolean;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * What this SDK assumes when the router cannot answer.\n *\n * The capability endpoint does not exist on an older router, which answers\n * `connectors.getPanesCatalog()` with a 404.\n * Rather than leaving a caller with nothing, the pane helpers default to\n * exactly the behaviour they had before that endpoint existed: panes on the\n * Stripe connector only, with the method set the router's Stripe catalogue had\n * at the time.\n *\n * **This is a degradation path, not a mirror. Do not keep it in sync by hand,\n * and do not add a connector or a method to it** — that is what this table was\n * before the capability endpoint, and adding to it would quietly rebuild the mirror. A\n * connector the router serves panes for arrives through the endpoint and needs\n * no entry here; a connector that needs an entry here to appear is a connector\n * the router will not deliver panes for anyway.\n *\n * The only reason to touch this list is to correct what Stripe's catalogue\n * looked like *before* the endpoint existed, and that is history, so there is\n * no such reason. Once the endpoint is reachable it is never consulted for a\n * connector the router answered for.\n *\n * The redirect-rail set is deliberately narrow — every entry is a variant the\n * Stripe connector accepts and that needs no extra buyer input beyond a\n * billing country. `eps` / `p24` / `bancontact` are absent because Stripe\n * hard-requires billing fields the focused checkout never collects (a full\n * name for EPS and Bancontact, an email for Przelewy24), so their tiles could\n * never succeed.\n *\n * `defaultLabel` / `defaultSublabel` are the copy the router compiled at that\n * time and are frozen with the rest of the table. Copy for a method the live\n * catalogue reports belongs to the consumer's own locale files, keyed by\n * `key` — the router ships none.\n */\nexport const STRIPE_FALLBACK_PANE_METHODS: readonly PaneMethodInfo[] = [\n {\n key: 'apple_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'apple_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Apple Pay',\n defaultSublabel: 'Pay with Apple Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'apple',\n },\n {\n key: 'google_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'google_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Google Pay',\n defaultSublabel: 'Pay with Google Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'google',\n },\n {\n key: 'link',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'link',\n requiresBillingCountry: false,\n defaultLabel: 'Link',\n defaultSublabel: 'Pay with saved details',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'klarna',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'klarna',\n // Stripe's Klarna needs the buyer's country echoed into the confirm body.\n requiresBillingCountry: true,\n defaultLabel: 'Klarna',\n // NOT the router's current \"Pay later or in 3 instalments\". This table is\n // what a router predating the capability endpoint renders, and that copy\n // only gained the \"3\" in the same release that added the endpoint.\n // Restating the new string here\n // would put copy no reachable router emits in front of a merchant, and\n // would change what the deprecated `nativePaneMethodInfo` has returned\n // since 0.106.0.\n defaultSublabel: 'Pay later or in instalments',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'affirm',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'affirm',\n requiresBillingCountry: false,\n defaultLabel: 'Affirm',\n defaultSublabel: 'Pay over time',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'ideal',\n rail: 'redirect',\n paymentMethod: 'bank_redirect',\n paymentMethodType: 'ideal',\n requiresBillingCountry: false,\n defaultLabel: 'iDEAL',\n defaultSublabel: 'Pay from your bank',\n defaultCategory: 'bank_redirect',\n defaultIcon: 'bank',\n },\n {\n key: 'alipay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'ali_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Alipay',\n defaultSublabel: 'Pay with Alipay',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'revolut_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'revolut_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Revolut Pay',\n defaultSublabel: 'Pay with Revolut',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'amazon_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'amazon_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Amazon Pay',\n defaultSublabel: 'Pay with Amazon',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n];\n\n/**\n * {@link STRIPE_FALLBACK_PANE_METHODS} in the shape the live endpoint returns,\n * so every helper below takes one type of catalogue and the degradation path\n * is not a second code path. Derived, not written out: two spellings of one\n * table is exactly the drift this design removes.\n */\nexport const STRIPE_FALLBACK_PANE_CATALOG: PanesConnectorCatalog = {\n connector: 'stripe',\n allowed_rails: ['wallet', 'redirect'],\n methods: STRIPE_FALLBACK_PANE_METHODS.map((info) => ({\n key: info.key,\n rail: info.rail,\n payment_method: info.paymentMethod,\n payment_method_type: info.paymentMethodType,\n requires_billing_country: info.requiresBillingCountry,\n })),\n};\n\n/**\n * An empty catalogue — a connector the router does not offer panes for.\n * Exported so callers can express \"asked, and the answer was no\" without\n * reaching for `null` in the middle of a computation.\n */\nexport function emptyPaneCatalog(connector: string): PanesConnectorCatalog {\n return { connector, allowed_rails: [], methods: [] };\n}\n\n/**\n * Pull one connector's entry out of a `connectors.getPanesCatalog()` response.\n *\n * Returns {@link emptyPaneCatalog} for a connector the response does not name:\n * \"the router knows this connector and publishes no panes for it\" and \"the\n * router has never heard of it\" are the same answer to a caller building an\n * editor, and both mean \"offer nothing\".\n */\nexport function paneCatalogFor(\n response: PanesCatalogResponse,\n connector: string,\n): PanesConnectorCatalog {\n return (\n response.connectors.find((entry) => entry.connector === connector) ??\n emptyPaneCatalog(connector)\n );\n}\n\n/**\n * Built-in tile icon keys the buyer-facing checkout ships a glyph for.\n *\n * Reconciled against both ends: every key here has a branch in the checkout's\n * `NativePaneIcon.svelte`, and every `default_icon` the router's catalogue\n * publishes is in this list. An icon key the checkout does not ship falls\n * through to `wallet` there, so a key that drifts in renders as the wrong\n * glyph rather than as nothing.\n */\nexport const PANE_ICON_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n // Brand marks, not category glyphs: the checkout draws PayPal's monogram,\n // Klarna's squircle-K and the Bitcoin mark for these, the same logos the\n // bespoke panes they replace already drew. Listed here so a merchant's own\n // dashboard can offer them; the router decides which one a tile *defaults*\n // to, and a router predating them simply keeps sending the old default.\n 'paypal',\n 'klarna',\n 'crypto',\n];\n\n/**\n * Section keys a pane's tile may group under.\n *\n * Reconciled against the router's actual `default_category` values rather than\n * against what the Stripe table happened to need. `crypto` and `game_items`\n * are router defaults (the Cryptomus/NowPayments and Skinsback catalogues) and\n * were missing here, so a merchant configuring one of those panes was shown a\n * category their editor did not recognise.\n *\n * A custom value is allowed and renders as its own section under that literal\n * text. The buyer-facing checkout translates a subset of these into a section\n * header and falls through to the raw key for the rest — `crypto` and\n * `game_items` are the two it has yet to add.\n */\nexport const PANE_CATEGORY_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bnpl',\n 'bank_redirect',\n 'bank_transfer',\n 'crypto',\n 'game_items',\n 'cash',\n];\n\n/**\n * Mirror of the router's per-connector cap. Counted differently on each side:\n * {@link decodePanes} stops after 12 *decoded* rows (entries with a usable,\n * non-duplicate `method` — junk and duplicate entries don't consume a slot),\n * while the router caps *accepted* panes (enabled, known, deduplicated) at 12\n * — so an oversized hand-written blob may render a pane this decoder drops.\n * Blobs the SDK itself encodes never exceed the cap.\n */\nexport const PANES_MAX = 12;\n\n/**\n * Look a method up in one connector's catalogue.\n *\n * Pass the entry for the connector being configured, from\n * `connectors.getPanesCatalog()` via {@link paneCatalogFor}. The default is\n * the degradation path and only correct for Stripe on a router that predates\n * the endpoint — see {@link STRIPE_FALLBACK_PANE_CATALOG}.\n */\nexport function paneMethodInfo(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneCapability | undefined {\n return catalog.methods.find((info) => info.key === method);\n}\n\n/** Whether this connector may declare a pane on `rail` at all. A wallet pane\n * on a connector outside its `allowed_rails` is refused at save time — the\n * wallet rail rides on Stripe's Express Checkout Element charging the *same*\n * payment intent the embedded checkout holds, which does not generalise. */\nexport function paneRailAllowed(rail: PaneRail, catalog: PanesConnectorCatalog): boolean {\n return catalog.allowed_rails.includes(rail);\n}\n\n/**\n * The methods a caller may actually offer for this connector: the catalogue's\n * own list, minus anything on a rail the connector does not allow.\n *\n * The router should not report such a pair in the first place, but the two\n * fields are independent in the response and a save that crosses them is\n * refused at the API with an error naming the connector and the method. Filter\n * rather than trust, so a merchant never configures a tile the save will\n * bounce.\n */\nexport function offerablePaneMethods(catalog: PanesConnectorCatalog): PaneCapability[] {\n return catalog.methods.filter((info) => paneRailAllowed(info.rail, catalog));\n}\n\n/** Non-copy display defaults for a tile: which built-in glyph and which\n * section heading a new pane starts on. */\nexport interface PaneDisplayDefaults {\n icon: string;\n category: string;\n}\n\n/**\n * Per-method overrides, for the handful whose brand glyph is not what their\n * payment method would suggest. Everything else is derived from the catalogue\n * entry's `payment_method` below, so a connector the SDK has never heard of\n * still gets a sensible tile rather than a blank one.\n *\n * These have to be keyed by method and not by `payment_method`: `wallet` also\n * routes Link, Alipay, Revolut Pay and Amazon Pay, and `pay_later` also routes\n * Affirm — none of which the SDK has a mark for. Getting this wrong is not a\n * cosmetic slip that the next release fixes, because {@link defaultPane}\n * materialises the value and {@link encodePanes} writes it to\n * `metadata.native_panes`, where a stored `icon` outranks the router's\n * `default_icon` for the life of the pane.\n */\nconst DISPLAY_DEFAULTS_BY_KEY: Readonly<Record<string, PaneDisplayDefaults>> = {\n apple_pay: { icon: 'apple', category: 'wallet' },\n google_pay: { icon: 'google', category: 'wallet' },\n paypal: { icon: 'paypal', category: 'wallet' },\n // Both the Klarna connector's own tile and Stripe's Klarna. Affirm stays on\n // the generic `bnpl` glyph — same rail, no mark of its own.\n klarna: { icon: 'klarna', category: 'bnpl' },\n};\n\n/**\n * Derived from the `payment_method` half of the catalogue's routing pair.\n * Every value here reproduces the router's own `default_icon` /\n * `default_category` for the methods it publishes today, so a tile the SDK\n * lays out and a tile the router lays out agree.\n */\nconst DISPLAY_DEFAULTS_BY_PAYMENT_METHOD: Readonly<Record<string, PaneDisplayDefaults>> = {\n wallet: { icon: 'wallet', category: 'wallet' },\n card: { icon: 'card', category: 'card' },\n card_redirect: { icon: 'card', category: 'card' },\n pay_later: { icon: 'bnpl', category: 'bnpl' },\n bank_redirect: { icon: 'bank', category: 'bank_redirect' },\n bank_transfer: { icon: 'bank', category: 'bank_transfer' },\n bank_debit: { icon: 'bank', category: 'bank_transfer' },\n // Cryptomus and NowPayments publish the same `crypto` key on this rail, and\n // the router defaults both to the Bitcoin mark.\n crypto: { icon: 'crypto', category: 'crypto' },\n // Skinsback, which has no mark: the router defaults it to `wallet` too.\n game_items: { icon: 'wallet', category: 'game_items' },\n cash: { icon: 'cash', category: 'cash' },\n voucher: { icon: 'cash', category: 'cash' },\n};\n\nconst DISPLAY_DEFAULTS_FALLBACK: PaneDisplayDefaults = { icon: 'wallet', category: 'wallet' };\n\n/**\n * What a new tile looks like before the merchant designs it.\n *\n * The router serves capability, not presentation, so the glyph and the section\n * come from here and the accompanying text comes from the caller's own locale\n * files. A method with no entry at all still resolves — that is the point of\n * deriving from `payment_method`: a connector added to the router's catalogue\n * tomorrow needs no SDK release to be designable today.\n */\nexport function paneDisplayDefaults(info: PaneCapability | undefined): PaneDisplayDefaults {\n if (!info) return DISPLAY_DEFAULTS_FALLBACK;\n return (\n DISPLAY_DEFAULTS_BY_KEY[info.key] ??\n DISPLAY_DEFAULTS_BY_PAYMENT_METHOD[info.payment_method] ??\n DISPLAY_DEFAULTS_FALLBACK\n );\n}\n\n// --- Validation ---------------------------------------------------------\n\n/**\n * Why a configured pane would not survive a save or a render.\n *\n * - `method_unknown` — the connector's catalogue does not publish this key, so\n * the router drops the row at render.\n * - `rail_not_allowed` — the method's rail is not in the connector's\n * `allowed_rails`; the API refuses this at save time.\n * - `over_cap` — past the router's per-connector cap of {@link PANES_MAX}; the\n * row is stored but never rendered.\n * - `duplicate_method` — an earlier enabled row already claims this method.\n * The router skips disabled rows and then dedupes, so the first *enabled*\n * row renders and every later one is dropped in silence. Reported on the\n * losing rows, never on the one that survives.\n */\nexport type PaneIssueCode = 'method_unknown' | 'rail_not_allowed' | 'over_cap' | 'duplicate_method';\n\nexport interface PaneIssue {\n /** Index into the list handed to {@link validatePanes}. */\n index: number;\n method: string;\n code: PaneIssueCode;\n}\n\n/**\n * Check a configured list against one connector's catalogue, before writing it\n * to `metadata.native_panes`.\n *\n * The API applies the same rules at save time, so this changes where the\n * merchant finds out, not whether they do — and an SDK caller building an\n * editor would otherwise learn it from a bounced request with no row to point\n * at. An empty result means nothing here will be refused or silently dropped.\n */\nexport function validatePanes(\n panes: readonly Pane[],\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneIssue[] {\n const issues: PaneIssue[] = [];\n // Keyed on the catalogue's own key rather than the raw string, because that\n // is what the router dedupes on. Only enabled rows are recorded: a disabled\n // row never reaches the router's `seen` set, so it neither claims a method\n // nor loses to one.\n const claimedBy = new Set<string>();\n panes.forEach((pane, index) => {\n const info = paneMethodInfo(pane.method, catalog);\n if (!info) {\n issues.push({ index, method: pane.method, code: 'method_unknown' });\n } else if (!paneRailAllowed(info.rail, catalog)) {\n issues.push({ index, method: pane.method, code: 'rail_not_allowed' });\n } else if (pane.enabled) {\n // Unknown and rail-refused rows are dropped before the router dedupes,\n // so they cannot claim a key — and reporting two codes for one row would\n // point the merchant at the wrong repair.\n if (claimedBy.has(info.key)) {\n issues.push({ index, method: pane.method, code: 'duplicate_method' });\n } else {\n claimedBy.add(info.key);\n }\n }\n if (index >= PANES_MAX) issues.push({ index, method: pane.method, code: 'over_cap' });\n });\n return issues;\n}\n\n// --- Codec --------------------------------------------------------------\n\n/**\n * A new pane for `method`, with its glyph and section resolved from the\n * connector's catalogue entry rather than from a Stripe-keyed table — so\n * `defaultPane('creem_checkout', catalog)` is a designed tile and not a blank\n * one.\n *\n * Pass the catalogue entry for the connector being configured; the default is\n * the degradation path (see {@link STRIPE_FALLBACK_PANE_CATALOG}). Labels are\n * deliberately left empty: empty means \"use the catalogue default\", which the\n * router resolves at render, and the router ships no copy for a caller to\n * mirror.\n */\nexport function defaultPane(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): Pane {\n const defaults = paneDisplayDefaults(paneMethodInfo(method, catalog));\n return {\n method,\n enabled: true,\n label: '',\n labelTranslations: {},\n sublabel: null,\n sublabelTranslations: {},\n category: defaults.category,\n icon: defaults.icon,\n iconSvg: '',\n displayOrder: 0,\n visibility: 'always',\n openIn: 'tab',\n nativeElement: 'everywhere',\n preset: '',\n style: '',\n };\n}\n\nexport function clonePane(pane: Pane): Pane {\n return {\n ...pane,\n labelTranslations: { ...pane.labelTranslations },\n sublabelTranslations: { ...pane.sublabelTranslations },\n };\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction parseTranslations(raw: unknown): Record<string, string> {\n if (!isObject(raw)) return {};\n const out: Record<string, string> = {};\n for (const [locale, value] of Object.entries(raw)) {\n if (typeof value === 'string' && value.length > 0) out[locale] = value;\n }\n return out;\n}\n\nfunction str(raw: unknown): string {\n return typeof raw === 'string' ? raw : '';\n}\n\n// `display_order` is a 32-bit signed integer on the wire, and a\n// fractional or out-of-range value fails its strict row decode — dropping the\n// whole row server-side while an SDK round-trip would keep the blob looking\n// healthy. Clamped on BOTH decode and encode so this codec never emits a\n// value the router rejects, regardless of where the number came from.\nconst DISPLAY_ORDER_MIN = -2147483648;\nconst DISPLAY_ORDER_MAX = 2147483647;\n\nfunction clampDisplayOrder(raw: number): number {\n if (!Number.isFinite(raw)) return 0;\n return Math.min(DISPLAY_ORDER_MAX, Math.max(DISPLAY_ORDER_MIN, Math.trunc(raw)));\n}\n\n/**\n * Decode the stored `metadata.native_panes` blob into editor rows.\n *\n * Tolerant like the branding codecs: anything malformed falls back per\n * property, rows without a usable `method` are dropped, duplicates keep the\n * first occurrence — except that an enabled row wins over an earlier disabled\n * one for the same method, because that is the row the router renders — and\n * decoding stops after {@link PANES_MAX} decoded rows (dropped junk/duplicate\n * entries don't consume a slot). That is more forgiving than the router, which\n * drops a strict-decode-failing row whole (keeping the rest) and caps accepted\n * panes rather than decoded rows — see {@link Pane} and {@link PANES_MAX}.\n * Returns `null` when the input is not an array so the caller can distinguish\n * \"never configured\" from \"cleared\".\n */\nexport function decodePanes(raw: unknown): Pane[] | null {\n if (!Array.isArray(raw)) return null;\n const decodeRow = (entry: Record<string, unknown>, method: string): Pane => ({\n method,\n enabled: entry['enabled'] !== false,\n label: str(entry['label']),\n labelTranslations: parseTranslations(entry['label_translations']),\n sublabel: typeof entry['sublabel'] === 'string' ? entry['sublabel'] : null,\n sublabelTranslations: parseTranslations(entry['sublabel_translations']),\n category: str(entry['category']),\n icon: str(entry['icon']),\n iconSvg: str(entry['icon_svg']),\n displayOrder: clampDisplayOrder(Number(entry['display_order'])),\n // Anything unrecognised degrades to `always` rather than dropping the row.\n visibility: parseVisibility(entry['visibility']),\n // Same tolerance: an unknown value degrades to the default `tab`.\n openIn: parseOpenTarget(entry['open_in']),\n nativeElement: parseNativeElement(entry['native_element']),\n preset: str(entry['preset']),\n style: str(entry['style']),\n });\n\n const indexByMethod = new Map<string, number>();\n const out: Pane[] = [];\n for (const entry of raw) {\n if (out.length >= PANES_MAX) break;\n if (!isObject(entry)) continue;\n const method = str(entry['method']).trim();\n if (!method) continue;\n const kept = indexByMethod.get(method);\n if (kept !== undefined) {\n // Duplicate method. Keep the row the ROUTER would render: it skips\n // disabled rows BEFORE deduping, so where a blob\n // holds both a disabled and an enabled row for one method, buyers see\n // the enabled one. Keeping the disabled row here would show the merchant\n // a pane that is off while it is live, and persist that on the next save.\n const enabled = entry['enabled'] !== false;\n const existing = out[kept];\n if (enabled && existing && !existing.enabled) out[kept] = decodeRow(entry, method);\n continue;\n }\n indexByMethod.set(method, out.length);\n out.push(decodeRow(entry, method));\n }\n return out;\n}\n\n/**\n * Encode editor rows back into the snake_case blob the connector account\n * stores. Empty optional strings are omitted so the metadata stays small and a\n * merchant who typed nothing round-trips as \"use the catalogue default\" rather\n * than as an explicit empty override.\n *\n * `sublabel` is the exception: an explicitly-empty value is preserved (as `\"\"`)\n * because that is how a merchant hides the second line.\n */\nexport function encodePanes(panes: Pane[]): Record<string, unknown>[] {\n const nonEmpty = (map: Record<string, string>): Record<string, string> | undefined => {\n const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n };\n return panes.slice(0, PANES_MAX).map((pane) => {\n const labelTranslations = nonEmpty(pane.labelTranslations);\n const sublabelTranslations = nonEmpty(pane.sublabelTranslations);\n return {\n method: pane.method,\n enabled: pane.enabled,\n ...(pane.label.trim() ? { label: pane.label.trim() } : {}),\n ...(labelTranslations ? { label_translations: labelTranslations } : {}),\n // `null` omits the key entirely (catalogue default wins); `''` is sent\n // as-is because that is how the merchant hides the second line.\n ...(pane.sublabel !== null ? { sublabel: pane.sublabel } : {}),\n ...(sublabelTranslations ? { sublabel_translations: sublabelTranslations } : {}),\n ...(pane.category.trim() ? { category: pane.category.trim() } : {}),\n ...(pane.icon.trim() ? { icon: pane.icon.trim() } : {}),\n ...(pane.iconSvg.trim() ? { icon_svg: pane.iconSvg.trim() } : {}),\n // Clamped on encode too, not only decode: the router's strict i32 row\n // decode drops a row whole for a fractional or out-of-range value, so\n // writing e.g. 3.5 or Date.now() verbatim would silently delete the\n // pane at render while every read surface shows it healthy.\n display_order: clampDisplayOrder(pane.displayOrder),\n // Normalised on encode for the same reason `display_order` is clamped:\n // the router's strict row decode drops a row whole on a value outside\n // its enum, and a caller who built a `Pane` by hand (or in plain JS)\n // never went through `decodePanes`. A decoded pane always holds a valid\n // value, so this is a no-op on the round-trip path.\n visibility: parseVisibility(pane.visibility),\n open_in: parseOpenTarget(pane.openIn),\n // Omitted at the default: `everywhere` is what the router decodes an\n // absent key to, so leaving it out changes nothing — and keeps a blob\n // stored before the field existed byte-identical on re-encode, which\n // is what the wire-compatibility test pins.\n ...(parseNativeElement(pane.nativeElement) === 'everywhere'\n ? {}\n : { native_element: parseNativeElement(pane.nativeElement) }),\n // Absent and blank both mean \"no look\": a pane shaped before the fields\n // existed encodes exactly as it always did.\n ...((pane.preset ?? '').trim() ? { preset: (pane.preset ?? '').trim() } : {}),\n ...((pane.style ?? '').trim() ? { style: (pane.style ?? '').trim() } : {}),\n };\n });\n}\n\n// --- Focused checkout URL ----------------------------------------------\n\n/**\n * A payment link id the hosted checkout serves on its own, as\n * `/pay/{payment_link_id}`: the lowercase, hyphenated UUID the API issues.\n */\nconst OPAQUE_PAYMENT_LINK_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nexport interface FocusedCheckoutUrlParams {\n /**\n * Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`.\n *\n * Take it from the payment itself when you can: the origin of its\n * `payment_link.link` (`new URL(payment.payment_link.link).origin`). A\n * shop can have its own checkout address, and its links open there, not on\n * the default one. A fixed base sends the buyer to a different address\n * than the payment's own link.\n */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /**\n * The payment's `payment_link.payment_link_id`. When it is the opaque id the\n * API issues (a lowercase, hyphenated UUID), the link is\n * `/pay/{payment_link_id}`, which names neither the merchant nor the\n * payment. Omitted, or an older `plink_` id, keeps\n * `/pay/{merchantId}/{paymentId}`, which the checkout still serves.\n */\n paymentLinkId?: string | null;\n /** Pane method key to focus on (`apple_pay`, `klarna`, …). */\n method: string;\n /**\n * Connector that owns the tile, forwarded as `connector=`.\n *\n * A bare `pane=` resolves to the **first payable match in server-sorted\n * order**, which is unambiguous only while one connector publishes a given\n * key. Stripe publishes `klarna` and so does the Klarna connector, so a deep\n * link that names neither charges through whichever tile happens to sort\n * first. Name the connector whenever you know it.\n *\n * Optional because links minted before this parameter existed are already in\n * merchants' pages and still have to resolve.\n */\n connector?: string;\n /**\n * Merchant connector ACCOUNT that owns the tile, forwarded as `mca=`.\n *\n * Needed for the same reason `connector` is, one level down: a profile may\n * hold two enabled accounts of one connector, each publishing its own tile,\n * and the two links would otherwise be identical. Only meaningful alongside\n * `connector`.\n */\n merchantConnectorId?: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n /**\n * Set when the merchant's checkout-custom-field answers are already\n * persisted on the payment — forwarded as `cf=1` so the focused view skips\n * asking a second time. Purely a UI hint: the values live on the intent\n * either way, and the backend only accepts the merchant's configured field\n * keys from a client, so a wrongly-set flag can at worst skip an\n * informational prompt. This is the same hint the embedded pane sets when\n * it opens the focused view.\n */\n customFieldsCollected?: boolean;\n}\n\n/**\n * Build the link to the **focused single-method checkout**: the DeloPay hosted\n * checkout rendered with one payment method, one button, no picker.\n *\n * Two callers:\n * - the embedded checkout, which opens this in a new tab when a buyer clicks\n * a pane tile, and\n * - a merchant running their own checkout, who puts it behind their own\n * button — the same mechanism without an iframe.\n *\n * `method` is not limited to configured panes. A configured pane gets the\n * focused one-button view; `card`, `paypal`, `crypto_currency` and the\n * local-methods catalogs (by method key or vendor code) open the checkout\n * pinned to that method. Methods that exist only as a tab inside a connector's\n * own embedded form — iDEAL, Bancontact, P24 and the like, unless promoted to\n * a pane — cannot be isolated, because the connector owns that surface. An\n * unknown or unavailable method is never a dead end: the checkout shows a\n * notice with a visible \"show all payment methods\" action.\n *\n * Pass {@link FocusedCheckoutUrlParams.connector} (and\n * {@link FocusedCheckoutUrlParams.merchantConnectorId}) whenever you know\n * them. Without them the method key alone picks the first payable match, and\n * more than one connector can publish the same key. Omitting them produces\n * exactly the URL this function has always produced, so links already minted\n * are unaffected.\n *\n * Open it **at the top level** (a new tab or a full-page navigation). The whole\n * point is that the top-level domain is the registered payment method domain;\n * rendering it in an iframe puts you back where you started.\n *\n * If you open it with `window.open`, call that **synchronously inside the click\n * handler** or the popup blocker will eat it, and make sure any iframe you\n * render DeloPay in permits popups (`allow-popups`, plus\n * `allow-popups-to-escape-sandbox` under a restrictive `sandbox`).\n */\nexport function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ pane: params.method });\n // Parameter order matches the embedded checkout's own `focusedUrl`\n // (`NativePanesPane.svelte`), so a merchant's deep link and a tile click\n // produce the same string for the same tile. A blank value is treated as\n // absent rather than emitted empty: `connector=` would otherwise read as a\n // connector named \"\" instead of as \"not specified\".\n const connector = params.connector?.trim();\n if (connector) query.set('connector', connector);\n const merchantConnectorId = params.merchantConnectorId?.trim();\n if (merchantConnectorId) query.set('mca', merchantConnectorId);\n if (params.locale) query.set('locale', params.locale);\n if (params.customFieldsCollected) query.set('cf', '1');\n return `${path}?${query.toString()}`;\n}\n\n// --- Checkout entries --------------------------------------------------\n\nexport interface CheckoutEntryUrlParams {\n /**\n * Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`.\n * Take it from the payment's `payment_link.link`, as\n * {@link FocusedCheckoutUrlParams.checkoutBaseUrl} explains.\n */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /** The payment's `payment_link.payment_link_id`; see {@link FocusedCheckoutUrlParams.paymentLinkId}. */\n paymentLinkId?: string | null;\n /** The entry's `key`, as configured on the shop (`CheckoutEntry.key`). */\n entry: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n}\n\n/**\n * The link to one of the shop's **checkout entries** for a payment: the hosted\n * checkout with `?entry=<key>`, showing only that entry's methods in its\n * named look. Every entry of one payment charges the same payment, so the\n * buyer can move between them and still pays once.\n *\n * A `card` entry is meant for an iframe in your own page\n * (`<iframe src={checkoutEntryUrl(...)} allow=\"payment\">`, with your page's\n * origin in the shop's iframe origins). Its \"Other payment methods\" action\n * opens the entry the shop configured in a new tab, and also posts\n * {@link CheckoutOpenEntryMessage} to your page, so you can navigate yourself\n * instead. Give a sandboxed iframe `allow-popups` and\n * `allow-popups-to-escape-sandbox`, or the tab is refused and the buyer gets\n * a plain link. Open a `methods` entry at the top level.\n *\n * An entry key the shop does not have, and an entry with nothing for this\n * payment, show an explanation and no methods: an entry never falls back to\n * the full checkout.\n */\nexport function checkoutEntryUrl(params: CheckoutEntryUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ entry: params.entry.trim() });\n if (params.locale) query.set('locale', params.locale);\n return `${path}?${query.toString()}`;\n}\n\n/**\n * What an embedded card entry posts to your page when the buyer presses\n * \"Other payment methods\": the payment, the entry the shop configured and its\n * link. Sent only to the shop's iframe origins. `source` names the sending\n * checkout and follows the deployment's branding, so match on `type`.\n */\nexport interface CheckoutOpenEntryMessage {\n source: string;\n type: 'open_entry';\n payment_id: string;\n entry: string;\n url: string;\n}\n\n/** Whether a `message` event's `data` is a {@link CheckoutOpenEntryMessage}. */\nexport function isCheckoutOpenEntryMessage(data: unknown): data is CheckoutOpenEntryMessage {\n if (typeof data !== 'object' || data === null) return false;\n const message = data as Record<string, unknown>;\n return (\n message.type === 'open_entry' &&\n typeof message.source === 'string' &&\n typeof message.payment_id === 'string' &&\n typeof message.entry === 'string' &&\n typeof message.url === 'string'\n );\n}\n\n// --- Buyer-side checkout events ----------------------------------------\n\n/**\n * The closed vocabulary of buyer-side checkout events recorded on the payment's\n * status timeline. Written through\n * `POST /payment-link/{merchant_id}/{payment_id}/checkout-events`, authorized\n * with the payment's `client_secret` as a bearer token.\n *\n * The `native_pane_` prefix is the router's enum on the wire and does not move\n * with the rename — see the module header.\n */\nexport const CHECKOUT_EVENT_KINDS = [\n 'native_pane_selected',\n 'native_pane_tab_opened',\n 'native_pane_tab_blocked',\n 'native_pane_abandoned',\n 'native_pane_returned',\n 'checkout_cancelled',\n] as const;\n\nexport type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];\n\n// --- Deprecated aliases -------------------------------------------------\n//\n// The pre-0.109.0 names, kept so an external `@delopay/sdk` consumer upgrades\n// on their own schedule rather than on ours. **Scheduled for removal in\n// 0.112.0** — see CHANGELOG.md. Nothing in this repo uses them.\n\n/** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */\nexport type StripeNativePane = Pane;\n/** @deprecated Renamed to {@link PaneView}. Removed in 0.112.0. */\nexport type NativePaneView = PaneView;\n/** @deprecated Renamed to {@link PaneVisibility}. Removed in 0.112.0. */\nexport type NativePaneVisibility = PaneVisibility;\n/** @deprecated Renamed to {@link PaneOpenTarget}. Removed in 0.112.0. */\nexport type NativePaneOpenTarget = PaneOpenTarget;\n/** @deprecated Spelt {@link PaneNativeElement} on the SDK side. Removed in 0.112.0. */\nexport type NativePaneNativeElement = PaneNativeElement;\n/**\n * @deprecated Superseded by {@link PaneMethodInfo}. Removed in 0.112.0.\n *\n * Deliberately **not** an alias of `PaneMethodInfo`: that type gained three\n * required routing fields (`paymentMethod`, `paymentMethodType`,\n * `requiresBillingCountry`), and a consumer who wrote an object literal or a\n * function return against the 0.108 shape would stop compiling on a deprecated\n * name that promises the opposite. This stays the six fields that shape had.\n *\n * `PaneMethodInfo` is structurally assignable to it, so everything this SDK\n * hands back — including {@link nativePaneMethodInfo} — still satisfies it.\n */\nexport interface NativePaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * @deprecated Renamed to {@link STRIPE_FALLBACK_PANE_METHODS}, which is a\n * degradation path and not a catalogue mirror. Removed in 0.112.0.\n */\nexport const STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;\n/** @deprecated Renamed to {@link PANE_ICON_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;\n/** @deprecated Renamed to {@link PANE_CATEGORY_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_CATEGORY_KEYS = PANE_CATEGORY_KEYS;\n/** @deprecated Renamed to {@link PANES_MAX}. Removed in 0.112.0. */\nexport const NATIVE_PANES_MAX = PANES_MAX;\n\n/**\n * @deprecated Superseded by {@link paneMethodInfo}, which takes the connector's\n * catalogue and answers for every connector rather than only for Stripe.\n * Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old return type: it answers out of the frozen Stripe table and carries that\n * table's compiled copy, which the live catalogue deliberately does not have.\n */\nexport function nativePaneMethodInfo(method: string): PaneMethodInfo | undefined {\n return STRIPE_FALLBACK_PANE_METHODS.find((info) => info.key === method);\n}\n\n/**\n * @deprecated Superseded by {@link defaultPane}. Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old behaviour: it leaves `category` empty and resolves `icon` out of the\n * frozen Stripe table only. `defaultPane` fills both from the connector's\n * catalogue, which is the fix — but a caller on the old name encodes whatever\n * it is handed, and quietly turning a blank field into a stored override is\n * not something a deprecated alias should do to a merchant's saved config.\n */\nexport function defaultNativePane(method: string): Pane {\n const info = nativePaneMethodInfo(method);\n return {\n ...defaultPane(method),\n category: '',\n icon: info?.defaultIcon ?? '',\n };\n}\n\n/** @deprecated Renamed to {@link clonePane}. Removed in 0.112.0. */\nexport const cloneNativePane = clonePane;\n/** @deprecated Renamed to {@link decodePanes}. Removed in 0.112.0. */\nexport const decodeNativePanes = decodePanes;\n/** @deprecated Renamed to {@link encodePanes}. Removed in 0.112.0. */\nexport const encodeNativePanes = encodePanes;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","../src/resources/sellToRestrictions.ts"],"names":[],"mappings":"AAAA;ACsBO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EAC9B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,QAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAuB,CAAA;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAA,CACJ,MAAA,EACA,OAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gCAAA,EAAkC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,kBAAA,CACJ,SAAA,EACA,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,4BAAA,EAA+B,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC/E,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUkC,EAAA;AACpB,IAAA;AACV,MAAA;AAC4D,MAAA;AAC5D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAM4E,EAAA;AACM,IAAA;AAClF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaqC,EAAA;AAC6C,IAAA;AACxE,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUqC,EAAA;AACvB,IAAA;AACV,MAAA;AAC+D,MAAA;AAC/D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQgG,EAAA;AAClF,IAAA;AACV,MAAA;AAC2E,MAAA;AAC7E,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAChD,MAAA;AAC7B,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAC3E,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOqE,EAAA;AACJ,IAAA;AACjE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOoF,EAAA;AACtE,IAAA;AACV,MAAA;AAC+D,MAAA;AACjE,IAAA;AACF,EAAA;AACF;ADtD4F;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","sourcesContent":[null,"import type {\n ConnectorSellToRestriction,\n ProjectSellToRestriction,\n SellToRestrictionCapabilitiesResponse,\n SellToRestrictionDecisionsResponse,\n SellToRestrictionPolicyRequest,\n SellToRestrictionsResponse,\n ShopSellToRestriction,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Sell-to restrictions: the buyer countries a merchant refuses to sell to,\n * merchant-wide, per project and per shop. A refused payment fails with error\n * code `DE_10`.\n *\n * Every route needs a dashboard session. Reading needs the `SellToRestrictions`\n * area at `Read`, overriding a shop needs `Edit` (a shop-scoped role may\n * override only its own shop), a project's policy needs `Edit` at merchant\n * level (no shop-scoped role, project members included), and changing the\n * merchant-wide policy needs `Write`.\n */\nexport class SellToRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant-wide policy and every shop's effective policy. A caller\n * scoped to one shop receives that shop alone, and no merchant-wide policy.\n * `GET /sell-to-restrictions`\n */\n async retrieve(): Promise<SellToRestrictionsResponse> {\n return this.request('GET', '/sell-to-restrictions');\n }\n\n /**\n * Replace the merchant-wide policy every shop without an override inherits.\n * The change is recorded in the audit log before it is made.\n * `PUT /sell-to-restrictions/merchant`\n */\n async updateMerchantPolicy(\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<SellToRestrictionsResponse> {\n return this.request('PUT', '/sell-to-restrictions/merchant', { body: params, ...options });\n }\n\n /**\n * Give one shop its own policy, replacing the merchant-wide policy for that\n * shop. An empty `blocked_countries` lifts every restriction for it.\n * `PUT /sell-to-restrictions/shops/{profile_id}`\n */\n async updateShopOverride(\n profileId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one shop's override, so it inherits the merchant-wide policy again.\n * Removing an override the shop does not have changes nothing.\n * `DELETE /sell-to-restrictions/shops/{profile_id}`\n */\n async deleteShopOverride(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`,\n options,\n );\n }\n\n /**\n * One project's own policy, if it has one.\n * `GET /sell-to-restrictions/projects/{project_id}`\n */\n async retrieveProject(projectId: string): Promise<ProjectSellToRestriction> {\n return this.request('GET', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`);\n }\n\n /**\n * Give one project its own policy. It replaces the merchant-wide policy for\n * every shop of the project's subtree without an override or a nearer\n * project policy, from their next payment on. An empty `blocked_countries`\n * lifts every restriction for them. Recorded in the audit log first.\n * `PUT /sell-to-restrictions/projects/{project_id}`\n */\n async updateProjectPolicy(\n projectId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one project's policy, so its subtree inherits from above again.\n * Removing a policy the project does not have changes nothing.\n * `DELETE /sell-to-restrictions/projects/{project_id}`\n */\n async deleteProjectPolicy(\n projectId: string,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`,\n options,\n );\n }\n\n /**\n * One payment connector account's own policy, and which buyer\n * signals its payments can be judged on. Needs the merchant-level `Read`\n * rung; a shop-scoped role is refused.\n * `GET /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async retrieveConnectorPolicy(merchantConnectorId: string): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Give one payment connector account its own policy. It applies on top of\n * each shop's policy, in every shop the account serves, from the next\n * payment on: a buyer it refuses is routed to another account of the shop.\n * Needs the merchant-wide `Write` rung and write visibility for the\n * processor; recorded in the audit log first.\n * `PUT /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async updateConnectorPolicy(\n merchantConnectorId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'PUT',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Remove one connector account's own policy; each shop's policy still\n * applies. Removing a policy the account does not have changes nothing.\n * `DELETE /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async deleteConnectorPolicy(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n options,\n );\n }\n\n /**\n * Which checks each payment path performs, and how this deployment resolves\n * a buyer's country — read before relying on a restriction for a path.\n * `GET /sell-to-restrictions/capabilities`\n */\n async capabilities(): Promise<SellToRestrictionCapabilitiesResponse> {\n return this.request('GET', '/sell-to-restrictions/capabilities');\n }\n\n /**\n * Why a payment was refused: where, by which signal, for which country and\n * under which policy. A shop-scoped caller sees only refusals in its shop.\n * `GET /sell-to-restrictions/payments/{payment_id}/decisions`\n */\n async listDecisions(paymentId: string): Promise<SellToRestrictionDecisionsResponse> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/payments/${encodeURIComponent(paymentId)}/decisions`,\n );\n }\n}\n"]}
|
|
@@ -215,6 +215,10 @@ var AdminPricing = class {
|
|
|
215
215
|
async getMerchantBrand(merchantId) {
|
|
216
216
|
return this.request("GET", `${merchantBasePath(merchantId)}/brand`);
|
|
217
217
|
}
|
|
218
|
+
/** Read the exact Pricing page view a merchant sees (read-only staff mirror). `GET /admin-portal/pricing/merchants/{merchant_id}/view` */
|
|
219
|
+
async getMerchantView(merchantId) {
|
|
220
|
+
return this.request("GET", `${merchantBasePath(merchantId)}/view`);
|
|
221
|
+
}
|
|
218
222
|
/** Assign a merchant's pricing brand (`'delopay'` / `'spicepay'`), or `null` to inherit the deployment brand. `PUT /admin-portal/pricing/merchants/{merchant_id}/brand` */
|
|
219
223
|
async setMerchantBrand(merchantId, brand) {
|
|
220
224
|
return this.request("PUT", `${merchantBasePath(merchantId)}/brand`, {
|
|
@@ -244,4 +248,4 @@ var AdminPricing = class {
|
|
|
244
248
|
|
|
245
249
|
|
|
246
250
|
exports.AdminPricing = AdminPricing;
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
251
|
+
//# sourceMappingURL=chunk-ANQRR2BG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ANQRR2BG.cjs","../src/internal/resources/adminPricing.ts"],"names":[],"mappings":"AAAA;ACoBA,IAAM,KAAA,EAAO,uBAAA;AACb,IAAM,UAAA,EAAY,CAAC,KAAA,EAAqB,OAAA,EAAA,GACtC,CAAA,EAAA;AACwB;AAEmB;AAED;AAEH;AAGT;AAED;AACR,EAAA;AACvB;AAEoC;AACJ,EAAA;AACrB,IAAA;AACT,EAAA;AACgB,EAAA;AACF,EAAA;AACF,IAAA;AACR,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACT;AAE6E;AACtC,EAAA;AAC5B,IAAA;AACT,EAAA;AACiB,EAAA;AACU,EAAA;AAC7B;AAEuE;AAChD,EAAA;AACd,IAAA;AACe,MAAA;AACI,QAAA;AACtB,MAAA;AAC4B,MAAA;AACzB,IAAA;AACqB,MAAA;AACF,QAAA;AACtB,MAAA;AAC4B,MAAA;AACzB,IAAA;AACwB,MAAA;AACL,QAAA;AACtB,MAAA;AAC4B,MAAA;AACzB,IAAA;AACwB,MAAA;AACL,QAAA;AACtB,MAAA;AAC4B,MAAA;AAChC,EAAA;AACF;AAU0B;AACyB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGsB,EAAA;AACrC,IAAA;AACxB,MAAA;AACgB,QAAA;AACH,QAAA;AACA,QAAA;AACpB,MAAA;AACD,IAAA;AACH,EAAA;AAAA;AAGkF,EAAA;AAClD,IAAA;AACrB,MAAA;AACe,QAAA;AACD,QAAA;AACA,QAAA;AACF,QAAA;AACN,QAAA;AACb,MAAA;AACD,IAAA;AACH,EAAA;AAAA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tB,QAAA;AACY,QAAA;AACJ,UAAA;AACA,UAAA;AACN,UAAA;AACA,UAAA;AACA,UAAA;AACF,QAAA;AACJ,IAAA;AACF,EAAA;AAAA;AAKE,EAAA;AAKmB,IAAA;AACO,IAAA;AACO,IAAA;AACxB,MAAA;AACK,QAAA;AACA,QAAA;AACP,QAAA;AACgB,QAAA;AACrB,MAAA;AACD,IAAA;AACH,EAAA;AAAA;AAGkF,EAAA;AAClD,IAAA;AAChC,EAAA;AAAA;AAGgF,EAAA;AAChD,IAAA;AAChC,EAAA;AAAA;AAKE,EAAA;AAE8B,IAAA;AACd,MAAA;AACf,IAAA;AACH,EAAA;AAAA;AAK0C,EAAA;AACV,IAAA;AACrB,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAKwC,EAAA;AACP,IAAA;AACvB,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG8F,EAAA;AAC7D,IAAA;AACvB,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADpHqC;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ANQRR2BG.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type { MerchantPricingViewResponse, PricingFeeType } from '../../types';\nimport type {\n AdminServiceUsageListQuery,\n AdminServiceUsageListResponse,\n AdminServiceUsageRecord,\n EffectivePricingQuery,\n EffectivePricingResponse,\n MerchantPricingBrandResponse,\n PricingBrand,\n PricingOverview,\n PricingOverviewQuery,\n PricingSaveRequest,\n PricingScope,\n PricingScopeView,\n ServiceUsagePreviewRequest,\n ServiceUsagePreviewResponse,\n ServiceUsageRecordRequest,\n} from '../types';\n\nconst BASE = '/admin-portal/pricing';\nconst brandPath = (brand: PricingBrand, feeType: PricingFeeType): string =>\n `${BASE}/brands/${encodeURIComponent(brand)}/${encodeURIComponent(feeType)}`;\nconst merchantBasePath = (merchantId: string): string =>\n `${BASE}/merchants/${encodeURIComponent(merchantId)}`;\nconst merchantFeePath = (merchantId: string, feeType: PricingFeeType): string =>\n `${merchantBasePath(merchantId)}/${encodeURIComponent(feeType)}`;\nconst projectFeePath = (merchantId: string, projectId: string, feeType: PricingFeeType): string =>\n `${merchantBasePath(merchantId)}/projects/${encodeURIComponent(projectId)}/${encodeURIComponent(feeType)}`;\nconst shopFeePath = (merchantId: string, profileId: string, feeType: PricingFeeType): string =>\n `${merchantBasePath(merchantId)}/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(feeType)}`;\n\nconst UNICODE_EDGE_WHITESPACE = /^\\p{White_Space}+|\\p{White_Space}+$/gu;\n\nfunction trimUnicodeWhitespace(value: string): string {\n return value.replace(UNICODE_EDGE_WHITESPACE, '');\n}\n\nfunction assertOptionalProviderSlug(provider: string | null | undefined): string | undefined {\n if (provider === undefined || provider === null) {\n return undefined;\n }\n const trimmed = trimUnicodeWhitespace(provider);\n if (!trimmed) {\n throw new TypeError(\n 'Provider slug cannot be empty or whitespace; omit provider (or pass null when saving) for a service-wide rule.',\n );\n }\n return trimmed;\n}\n\nfunction validateSaveRequest(params: PricingSaveRequest): PricingSaveRequest {\n if (params.provider === undefined || params.provider === null) {\n return params;\n }\n const provider = assertOptionalProviderSlug(params.provider);\n return provider === params.provider ? params : { ...params, provider };\n}\n\nfunction scopeCancelQuery(scope: PricingScope): Record<string, string> {\n switch (scope.level) {\n case 'brand_default':\n if (!scope.brand) {\n throw new TypeError('Brand default scope requires brand.');\n }\n return { brand: scope.brand };\n case 'merchant':\n if (!scope.merchant_id) {\n throw new TypeError('Merchant scope requires merchant_id.');\n }\n return { merchant_id: scope.merchant_id };\n case 'project':\n if (!scope.merchant_id || !scope.project_id) {\n throw new TypeError('Project scope requires merchant_id and project_id.');\n }\n return { merchant_id: scope.merchant_id, project_id: scope.project_id };\n case 'shop':\n if (!scope.merchant_id || !scope.profile_id) {\n throw new TypeError('Shop scope requires merchant_id and profile_id.');\n }\n return { merchant_id: scope.merchant_id, profile_id: scope.profile_id };\n }\n}\n\n/**\n * Unified platform pricing hierarchy across every fee type: brand default\n * (`delopay` / `spicepay`), merchant, project, and shop, plus the Effective\n * Price View showing where every price comes from.\n *\n * Every write carries the scope's optimistic `expected_revision` token; a write\n * against an older revision is refused with `412 Precondition Failed`.\n */\nexport class AdminPricing {\n constructor(private readonly request: RequestFn) {}\n\n /** Brand defaults, active/scheduled exceptions, and older setups. `GET /admin-portal/pricing` */\n async overview(params?: PricingOverviewQuery): Promise<PricingOverview> {\n return this.request('GET', BASE, {\n query: {\n merchant_id: params?.merchant_id,\n fee_type: params?.fee_type,\n provider: params?.provider,\n },\n });\n }\n\n /** Effective price view naming the exact source of every fee type. `GET /admin-portal/pricing/effective` */\n async effective(params: EffectivePricingQuery): Promise<EffectivePricingResponse> {\n return this.request('GET', `${BASE}/effective`, {\n query: {\n merchant_id: params.merchant_id,\n project_id: params.project_id,\n profile_id: params.profile_id,\n provider: params.provider,\n at: params.at,\n },\n });\n }\n\n /** Save a brand default price (service-wide or for one provider). `PUT /admin-portal/pricing/brands/{brand}/{fee_type}` */\n async saveBrand(\n brand: PricingBrand,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', brandPath(brand, feeType), { body: validateSaveRequest(params) });\n }\n\n /** Remove a provider-specific brand default override. Service-wide brand defaults cannot be removed. `DELETE /admin-portal/pricing/brands/{brand}/{fee_type}` */\n async removeBrand(\n brand: PricingBrand,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider: string,\n ): Promise<PricingScopeView> {\n const trimmed = trimUnicodeWhitespace(provider);\n if (!trimmed) {\n throw new TypeError(\n 'Removing a brand pricing rule requires a provider slug; service-wide brand defaults cannot be removed.',\n );\n }\n return this.request('DELETE', brandPath(brand, feeType), {\n query: { expected_revision: expectedRevision, provider: trimmed },\n });\n }\n\n /** Save a merchant exception. `PUT /admin-portal/pricing/merchants/{merchant_id}/{fee_type}` */\n async saveMerchant(\n merchantId: string,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', merchantFeePath(merchantId, feeType), {\n body: validateSaveRequest(params),\n });\n }\n\n /** Remove a merchant exception (service-wide or for one provider). `DELETE /admin-portal/pricing/merchants/{merchant_id}/{fee_type}` */\n async removeMerchant(\n merchantId: string,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', merchantFeePath(merchantId, feeType), {\n query: { expected_revision: expectedRevision, provider: validatedProvider },\n });\n }\n\n /** Save a project exception. `PUT /admin-portal/pricing/merchants/{merchant_id}/projects/{project_id}/{fee_type}` */\n async saveProject(\n merchantId: string,\n projectId: string,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', projectFeePath(merchantId, projectId, feeType), {\n body: validateSaveRequest(params),\n });\n }\n\n /** Remove a project exception (service-wide or for one provider). `DELETE /admin-portal/pricing/merchants/{merchant_id}/projects/{project_id}/{fee_type}` */\n async removeProject(\n merchantId: string,\n projectId: string,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', projectFeePath(merchantId, projectId, feeType), {\n query: { expected_revision: expectedRevision, provider: validatedProvider },\n });\n }\n\n /** Save a shop exception. `PUT /admin-portal/pricing/merchants/{merchant_id}/shops/{profile_id}/{fee_type}` */\n async saveShop(\n merchantId: string,\n profileId: string,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', shopFeePath(merchantId, profileId, feeType), {\n body: validateSaveRequest(params),\n });\n }\n\n /** Remove a shop exception (service-wide or for one provider). `DELETE /admin-portal/pricing/merchants/{merchant_id}/shops/{profile_id}/{fee_type}` */\n async removeShop(\n merchantId: string,\n profileId: string,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', shopFeePath(merchantId, profileId, feeType), {\n query: { expected_revision: expectedRevision, provider: validatedProvider },\n });\n }\n\n /** Save a price at any scope in the hierarchy (brand default, merchant, project, or shop). */\n async save(\n scope: PricingScope,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n switch (scope.level) {\n case 'brand_default':\n if (!scope.brand) {\n throw new TypeError('Brand default scope requires brand.');\n }\n return this.saveBrand(scope.brand, feeType, params);\n case 'merchant':\n if (!scope.merchant_id) {\n throw new TypeError('Merchant scope requires merchant_id.');\n }\n return this.saveMerchant(scope.merchant_id, feeType, params);\n case 'project':\n if (!scope.merchant_id || !scope.project_id) {\n throw new TypeError('Project scope requires merchant_id and project_id.');\n }\n return this.saveProject(scope.merchant_id, scope.project_id, feeType, params);\n case 'shop':\n if (!scope.merchant_id || !scope.profile_id) {\n throw new TypeError('Shop scope requires merchant_id and profile_id.');\n }\n return this.saveShop(scope.merchant_id, scope.profile_id, feeType, params);\n }\n }\n\n /** Remove an exception scope or a provider-specific brand override; service-wide brand defaults cannot be removed. */\n async remove(\n scope: PricingScope,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n switch (scope.level) {\n case 'brand_default':\n if (!scope.brand) {\n throw new TypeError('Brand default scope requires brand.');\n }\n if (!provider || !trimUnicodeWhitespace(provider)) {\n throw new TypeError('A brand default price cannot be removed without a provider.');\n }\n return this.removeBrand(scope.brand, feeType, expectedRevision, provider);\n case 'merchant':\n if (!scope.merchant_id) {\n throw new TypeError('Merchant scope requires merchant_id.');\n }\n return this.removeMerchant(scope.merchant_id, feeType, expectedRevision, provider);\n case 'project':\n if (!scope.merchant_id || !scope.project_id) {\n throw new TypeError('Project scope requires merchant_id and project_id.');\n }\n return this.removeProject(\n scope.merchant_id,\n scope.project_id,\n feeType,\n expectedRevision,\n provider,\n );\n case 'shop':\n if (!scope.merchant_id || !scope.profile_id) {\n throw new TypeError('Shop scope requires merchant_id and profile_id.');\n }\n return this.removeShop(\n scope.merchant_id,\n scope.profile_id,\n feeType,\n expectedRevision,\n provider,\n );\n }\n }\n\n /** Cancel a future scheduled version. `DELETE /admin-portal/pricing/versions/{version_id}` */\n async cancelVersion(\n versionId: string,\n feeType: PricingFeeType,\n scope: PricingScope,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const scopeQuery = scopeCancelQuery(scope);\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', `${BASE}/versions/${encodeURIComponent(versionId)}`, {\n query: {\n fee_type: feeType,\n provider: validatedProvider,\n ...scopeQuery,\n expected_revision: expectedRevision,\n },\n });\n }\n\n /** Read a merchant's effective and explicit pricing brand. `GET /admin-portal/pricing/merchants/{merchant_id}/brand` */\n async getMerchantBrand(merchantId: string): Promise<MerchantPricingBrandResponse> {\n return this.request('GET', `${merchantBasePath(merchantId)}/brand`);\n }\n\n /** Read the exact Pricing page view a merchant sees (read-only staff mirror). `GET /admin-portal/pricing/merchants/{merchant_id}/view` */\n async getMerchantView(merchantId: string): Promise<MerchantPricingViewResponse> {\n return this.request('GET', `${merchantBasePath(merchantId)}/view`);\n }\n\n /** Assign a merchant's pricing brand (`'delopay'` / `'spicepay'`), or `null` to inherit the deployment brand. `PUT /admin-portal/pricing/merchants/{merchant_id}/brand` */\n async setMerchantBrand(\n merchantId: string,\n brand: PricingBrand | null,\n ): Promise<MerchantPricingBrandResponse> {\n return this.request('PUT', `${merchantBasePath(merchantId)}/brand`, {\n body: { brand },\n });\n }\n\n /** List recorded third-party service uses across merchants with separate provider cost and markup. `GET /admin-portal/pricing/service-usages` */\n async listServiceUsages(\n params?: AdminServiceUsageListQuery,\n ): Promise<AdminServiceUsageListResponse> {\n return this.request('GET', `${BASE}/service-usages`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /** Dry-run calculate the provider cost, platform markup, and total charge for a third-party service use. `POST /admin-portal/pricing/service-usages/preview` */\n async previewServiceUsage(\n params: ServiceUsagePreviewRequest,\n ): Promise<ServiceUsagePreviewResponse> {\n return this.request('POST', `${BASE}/service-usages/preview`, {\n body: params,\n });\n }\n\n /** Record and settle one third-party service use idempotently by `reference_id`. `POST /admin-portal/pricing/service-usages` */\n async recordServiceUsage(params: ServiceUsageRecordRequest): Promise<AdminServiceUsageRecord> {\n return this.request('POST', `${BASE}/service-usages`, {\n body: params,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","../src/internal/resources/adminFileScans.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACYO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAA,EAAkC;AACtC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iCAAiC,CAAA;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,IAAA,CAAK,KAAA,EAA+B,CAAC,CAAA,EAA8B;AACvE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAA,CAAQ,MAAA,EAA0B,CAAC,CAAA,EAA6B;AACpE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,kCAAA,EAAoC;AAAA,MAC7D,KAAA,EAAO,wCAAA,KAAS,EAAO,CAAC,MAAA,EAAQ,MAAM,CAAC;AAAA,IACzC,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADXA;AACA;AACE;AACF,wCAAC","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n BlockedFileList,\n BlockedFileQuery,\n FileScannerCheck,\n FileScannerTestRequest,\n FileScanStatus,\n} from '../types';\nimport { csvQuery } from '../../listQuery';\n\n/**\n * Malware scanning of uploaded files: buyer evidence, buyer conversation\n * attachments and support attachments. The scanner's status and its test\n * need an operator who may change operations settings; the list of blocked\n * files takes any internal platform-operator role (`403` otherwise).\n */\nexport class AdminFileScans {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The scanner settings in force and where they come from, a check of the\n * scanner made for this answer, when it last finished a file and how many\n * files wait for their scan. `GET /admin-portal/file-scans/status`\n */\n async status(): Promise<FileScanStatus> {\n return this.request('GET', '/admin-portal/file-scans/status');\n }\n\n /**\n * Ask a scanner whether it answers, before it is saved. Only the connection\n * is tested: no file content is sent. A field left out takes the value in\n * force. An address outside the deployment's private network is refused\n * without a connection (`problem: 'public_address'`).\n * `POST /admin-portal/file-scans/test`\n */\n async test(body: FileScannerTestRequest = {}): Promise<FileScannerCheck> {\n return this.request('POST', '/admin-portal/file-scans/test', { body });\n }\n\n /**\n * Uploaded files their scan blocked, of every kind, latest result first\n * unless `sort_by` says otherwise, with what the scanner found. Several\n * `kind` or `side` values match a file with any of them. A blocked file's\n * content is never handed out. `GET /admin-portal/file-scans/blocked`\n */\n async blocked(query: BlockedFileQuery = {}): Promise<BlockedFileList> {\n return this.request('GET', '/admin-portal/file-scans/blocked', {\n query: csvQuery(query, ['kind', 'side']),\n });\n }\n}\n"]}
|