@delopay/sdk 0.451.0 → 0.455.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-WYR27JGG.js → chunk-222YMG36.js} +31 -2
- package/dist/chunk-222YMG36.js.map +1 -0
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/{chunk-OOC7ZT4T.js → chunk-2JRB5APG.js} +2 -2
- 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-BY3BENXH.js → chunk-57S5IX5S.js} +17 -1
- package/dist/chunk-57S5IX5S.js.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-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-7JV6VVO7.cjs.map +1 -1
- package/dist/{chunk-KT2WXUWG.cjs → chunk-7QYHQL3L.cjs} +17 -1
- package/dist/chunk-7QYHQL3L.cjs.map +1 -0
- package/dist/chunk-7QZCUXWB.cjs.map +1 -1
- package/dist/chunk-7VXF5D67.cjs.map +1 -1
- package/dist/chunk-ABWAYMN5.cjs.map +1 -1
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/chunk-AVR2GPXU.cjs.map +1 -1
- 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-R46A6AGY.cjs → chunk-BSRHVNPD.cjs} +3 -3
- package/dist/chunk-BSRHVNPD.cjs.map +1 -0
- package/dist/chunk-CAMALM35.cjs.map +1 -1
- package/dist/chunk-CCN44NZJ.cjs.map +1 -1
- package/dist/chunk-CKKNFFKP.cjs.map +1 -1
- package/dist/chunk-CR3JBTP3.cjs.map +1 -1
- package/dist/chunk-DJASVBOJ.cjs.map +1 -1
- 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-F3I5DOWV.cjs.map +1 -1
- package/dist/chunk-F46K5H3U.cjs.map +1 -1
- package/dist/chunk-F6S3WCCB.cjs.map +1 -1
- package/dist/chunk-FG7YBXJQ.cjs.map +1 -1
- package/dist/chunk-FQRC4NJG.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-HLHML5ES.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-JPRSNCYP.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-KOB6MOAV.cjs.map +1 -1
- package/dist/chunk-KSJ7JLR3.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-MCNDMK7F.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/chunk-NKDUQ2BI.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-OG2KJAYD.cjs.map +1 -1
- package/dist/{chunk-OKFOU6F7.cjs → chunk-OJFPRXOP.cjs} +3 -3
- package/dist/chunk-OJFPRXOP.cjs.map +1 -0
- package/dist/chunk-OWP7XBY2.cjs.map +1 -1
- package/dist/chunk-OYZP6NF6.cjs.map +1 -1
- package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
- package/dist/chunk-P7DYLUUI.cjs.map +1 -1
- package/dist/chunk-PKAE6AQT.cjs.map +1 -1
- package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
- package/dist/chunk-QKUWFMZP.cjs.map +1 -1
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R4FE6K43.cjs.map +1 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/{chunk-EBA6DJKI.js → chunk-RGHFGXTB.js} +2 -2
- package/dist/chunk-RHFUXHQN.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/chunk-RSVLVW4L.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-V47G7P6L.cjs.map +1 -1
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VHMH4QMY.cjs.map +1 -1
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/{chunk-KZHLKMVX.cjs → chunk-W3MSASG4.cjs} +32 -3
- package/dist/chunk-W3MSASG4.cjs.map +1 -0
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/chunk-WCAIY7DR.cjs.map +1 -1
- 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-XQLRIBVR.cjs.map +1 -1
- package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
- package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
- 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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/internal/resources/admin.cjs.map +1 -1
- package/dist/internal/resources/adminBranding.cjs.map +1 -1
- package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
- package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
- package/dist/internal/resources/adminFileScans.cjs.map +1 -1
- package/dist/internal/resources/adminIndustries.cjs.map +1 -1
- package/dist/internal/resources/adminLive.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.cjs.map +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 +18 -1
- package/dist/internal/resources/adminPortal.d.ts +18 -1
- package/dist/internal/resources/adminPortal.js +1 -1
- package/dist/internal/resources/adminSupport.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +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.cjs +7 -7
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +4 -4
- 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.map +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.map +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.map +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 +2 -2
- package/dist/resources/settlement.cjs.map +1 -1
- package/dist/resources/settlement.d.cts +12 -1
- package/dist/resources/settlement.d.ts +12 -1
- package/dist/resources/settlement.js +1 -1
- package/dist/resources/shopLabels.cjs.map +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.cjs.map +1 -1
- package/dist/types.d.cts +11 -2
- package/dist/types.d.ts +11 -2
- package/package.json +19 -17
- package/dist/chunk-BY3BENXH.js.map +0 -1
- package/dist/chunk-KT2WXUWG.cjs.map +0 -1
- package/dist/chunk-KZHLKMVX.cjs.map +0 -1
- package/dist/chunk-OKFOU6F7.cjs.map +0 -1
- package/dist/chunk-R46A6AGY.cjs.map +0 -1
- package/dist/chunk-WYR27JGG.js.map +0 -1
- /package/dist/{chunk-OOC7ZT4T.js.map → chunk-2JRB5APG.js.map} +0 -0
- /package/dist/{chunk-EBA6DJKI.js.map → chunk-RGHFGXTB.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-7QYHQL3L.cjs","../src/resources/settlement.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACqFO,SAAS,kBAAA,CAAmB,MAAA,EAAgE;AACjG,EAAA,OAAO,wCAAA;AAAA,IACL;AAAA,MACE,SAAA,EAAW,MAAA,CAAO,SAAA;AAAA,MAClB,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,MACnB,KAAA,EAAO,MAAA,CAAO,KAAA;AAAA,MACd,MAAA,EAAQ,MAAA,CAAO,MAAA;AAAA,MACf,aAAA,EAAe,MAAA,CAAO,aAAA;AAAA,MACtB,WAAA,EAAa,MAAA,CAAO,WAAA;AAAA,MACpB,SAAA,EAAW,MAAA,CAAO,SAAA;AA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AAA;AAC3B,IAAA;AACV,MAAA;AAC0D,MAAA;AAC1D,MAAA;AACK,QAAA;AAC+C,QAAA;AACpD,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYoC,EAAA;AACN,IAAA;AAC9B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW6B,EAAA;AACC,IAAA;AACpB,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY6B,EAAA;AACC,IAAA;AACpB,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe6B,EAAA;AACC,IAAA;AACpB,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWyC,EAAA;AACZ,IAAA;AACgC,MAAA;AACtD,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAc6B,EAAA;AACf,IAAA;AACV,MAAA;AACwD,MAAA;AACvB,MAAA;AACnC,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW6B,EAAA;AACf,IAAA;AACV,MAAA;AACwD,MAAA;AACvB,MAAA;AACnC,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW6C,EAAA;AAChB,IAAA;AAC+B,MAAA;AACrD,MAAA;AACJ,IAAA;AACH,EAAA;AACF;ADnTgE;AACA;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-7QYHQL3L.cjs","sourcesContent":[null,"import type {\n NativeReserve,\n NativeReserveCreateRequest,\n NativeReserveListResponse,\n NativeReserveMovement,\n NativeReserveOverview,\n NativeReserveOverviewRequest,\n NativeReserveReleaseRequest,\n NativeReserveUpdateRequest,\n NativeSettlementPreviewRequest,\n NativeSettlementPreviewResponse,\n NativeSettlementReportCreateRequest,\n NativeSettlementPeriodReportRequest,\n NativeSettlementCombinedRequest,\n NativeSettlementCombinedResponse,\n NativeSettlementReport,\n NativeSettlementReportExport,\n NativeSettlementListRequest,\n NativeSettlementReportListResponse,\n NativeSettlementPayoutCreateRequest,\n NativeSettlementPayout,\n NativeSettlementPayoutListResponse,\n NativeSettlementFeeRefreshRequest,\n NativeSettlementFeeRefreshResponse,\n NativeSettlementPdfRequest,\n NativeShopReport,\n NativeShopReportListRequest,\n NativeShopReportListResponse,\n NativeShopReserveListRequest,\n NativeShopReserveListResponse,\n ProcessorCostEventsRequest,\n ProcessorCostEventsResponse,\n ProcessorCostPeriodRequest,\n ProcessorCostPeriodResponse,\n ProviderHoldsRequest,\n ProviderHoldsResponse,\n FeeStatementDetail,\n SettlementBackfillRequest,\n SettlementBackfillResponse,\n SettlementCostParams,\n SettlementCostResponse,\n SettlementCurrentParams,\n SettlementCurrentResponse,\n SettlementLineListParams,\n SettlementLineListResponse,\n SettlementOverviewParams,\n SettlementOverviewResponse,\n SettlementStatementListParams,\n SettlementStatementListResponse,\n ShopFeeConfigParams,\n ShopFeeConfigResponse,\n ShopVisibilityResponse,\n ShopVisibilityUpdateRequest,\n StatementAdjustment,\n StatementAdjustmentCreateRequest,\n StatementAdjustmentListResponse,\n StatementGenerateRequest,\n StatementPayoutUpdateRequest,\n StatementPayoutRecordRequest,\n StatementPayoutListResponse,\n StatementAdvance,\n StatementAdvanceRecordRequest,\n SettlementAdvanceListRequest,\n SettlementAdvanceListResponse,\n SettlementPeriodListParams,\n SettlementPeriodPreviewParams,\n SettlementPeriodPreviewResponse,\n SettlementPeriodListResponse,\n StatementPdfParams,\n ShopTermConsentUpdateRequest,\n ShopTermConsentResponse,\n ShopTermProposalRequest,\n ShopTermFeeChange,\n ShopTermSettlementChange,\n ShopTermBuilderChange,\n ShopTermProposal,\n ShopTermProposalListRequest,\n ShopTermProposalListResponse,\n ShopTermProposalDecisionRequest,\n ShopTermConsentEventListRequest,\n ShopTermConsentEventListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn, RequestOptions } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/**\n * The statement list's query: `test_mode` always travels, `false` included,\n * and several payout statuses travel as one comma-separated value.\n */\nexport function statementListQuery(params: SettlementStatementListParams): RequestOptions['query'] {\n return csvQuery(\n {\n test_mode: params.test_mode,\n profile_id: params.profile_id,\n limit: params.limit,\n offset: params.offset,\n payout_status: params.payout_status,\n period_from: params.period_from,\n period_to: params.period_to,\n sort_by: params.sort_by,\n sort_order: params.sort_order,\n },\n ['payout_status'],\n );\n}\n\n/** The query of a native report or payout list. */\nfunction nativeListQuery(params: NativeSettlementListRequest): RequestOptions['query'] {\n return {\n profile_id: params.profile_id,\n currency: params.currency,\n test_mode: params.test_mode,\n limit: params.limit,\n offset: params.offset,\n sort_by: params.sort_by,\n sort_order: params.sort_order,\n };\n}\n\nfunction exportHeaders(options: RequestExtras | undefined, accept: string): Record<string, string> {\n const headers = new Headers(options?.headers);\n headers.set('Accept', accept);\n const output: Record<string, string> = {};\n headers.forEach((value, key) => {\n output[key] = value;\n });\n return output;\n}\n\n/**\n * Hosted-shop settlement: monthly statements, the live current-period\n * rollup, per-line detail, fee schedules and backfills.\n *\n * Every read takes an explicit `test_mode` — test and live figures must\n * never blend, so the environment lives in the signature rather than in a\n * default. `false` is transmitted, not dropped.\n *\n * Shop-owner responses are redacted server-side: absent platform-fee fields\n * are a permission boundary, not a gap — never re-derive them client-side.\n */\nexport class Settlement {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Read signed refund/dispute processor fees and report availability.\n * Merchant scope and connector grants apply. Empty movements confirm zero\n * only when the source is reported and complete.\n * Supply payment_id without year/month for all history. force_sync reads\n * provider reports for this page; it requires payment_id and limit <= 20,\n * and never issues a payment, refund or dispute action.\n * Omit test_mode for every reporting partition of one payment; period\n * queries default to live. Each source states its reporting partition.\n */\n async listProcessorCostEvents(\n params: ProcessorCostEventsRequest,\n options?: RequestExtras,\n ): Promise<ProcessorCostEventsResponse> {\n return this.request('GET', '/settlement/processor-cost-events', {\n query: {\n profile_id: params.profile_id,\n payment_id: params.payment_id,\n year: params.year,\n month: params.month,\n test_mode: params.test_mode,\n limit: params.limit,\n offset: params.offset,\n force_sync: params.force_sync,\n },\n ...options,\n });\n }\n\n /**\n * Per-shop settlement rollup for the host merchant: unpaid totals and the\n * running current period, one row per shop.\n *\n * `GET /settlement/overview`\n */\n async overview(\n params: SettlementOverviewParams,\n options?: RequestExtras,\n ): Promise<SettlementOverviewResponse> {\n return this.request('GET', '/settlement/overview', {\n query: { test_mode: params.test_mode },\n ...options,\n });\n }\n\n /**\n * Live rollup of the current (not yet statemented) period.\n *\n * `GET /settlement/current`\n */\n async current(\n params: SettlementCurrentParams,\n options?: RequestExtras,\n ): Promise<SettlementCurrentResponse> {\n return this.request('GET', '/settlement/current', {\n query: { test_mode: params.test_mode, profile_id: params.profile_id },\n ...options,\n });\n }\n\n /**\n * What a period's payments cost, and what was left over: gross, the\n * platform fee, hosting fees, what the rails took, and the margin, with a\n * per-connector breakdown.\n *\n * Send `year` and `month` together to report one UTC calendar month, or\n * neither for the running month so far.\n *\n * **Host-only.** The response is the host's cost base, which a shop owner\n * must never see, so a profile-scoped caller is refused with a 403 rather\n * than given a redacted shell. Gate the surface on the caller's scope\n * instead of calling it and handling the failure. Connector-restricted\n * roles cannot read this merchant-wide aggregate; fee-event reads retain\n * their connector grants.\n *\n * Two things not to flatten when rendering the result:\n * `margin_usd` is absent — not zero — whenever `margin_quality` is\n * `'unknown'`, and `unlined_captured_attempt_count` (cost definitely\n * missing) means something different from `unlined_unresolved_attempt_count`\n * (mostly ordinary abandonment).\n *\n * `GET /settlement/cost`\n *\n * @example\n * ```typescript\n * const cost = await delopay.settlement.cost({ test_mode: false, year: 2026, month: 7 });\n * if (cost.margin_quality === 'unknown') {\n * // cost.margin_usd is absent — say so, do not render 0.00\n * }\n * ```\n */\n async cost(\n params?: SettlementCostParams,\n options?: RequestExtras,\n ): Promise<SettlementCostResponse> {\n return this.request('GET', '/settlement/cost', {\n query: {\n profile_id: params?.profile_id,\n test_mode: params?.test_mode,\n year: params?.year,\n month: params?.month,\n },\n ...options,\n });\n }\n\n /**\n * What a period's payments cost at the rails, grouped by shop, connector\n * and payment method. Answers for **every** merchant, including one that\n * hosts nobody — it reads the per-attempt settlement record rather than the\n * settlement lines, which exist only where hosting fees are configured.\n *\n * A sibling of {@link Settlement.cost} rather than a widening of it. That\n * endpoint is a profit statement whose revenue term is hosting income, and\n * a merchant who hosts nobody has none. This publishes cost and never\n * margin.\n *\n * Send `year` and `month` together to report one UTC calendar month, or\n * neither for the running month so far.\n *\n * **The response carries no period total, and a caller must not compute\n * one here.** Every figure keeps the unit the rail reported it in, and the\n * unit is part of each bucket's key, so adding two buckets is not addition.\n * Convert caller-side if you need one number, and say which rates you used.\n * The counts are totalled, because a count has no unit.\n *\n * Two distinctions not to flatten when rendering a bucket:\n * `cost_amount` covers `reported_count + estimated_count` attempts out of\n * `attempt_count` and is a lower bound whenever those disagree; and\n * `unavailable_count` (the rail says it has no figure) means something\n * different from `unwritten_count` (a gap in our own recording).\n *\n * **Merchant scope.** A token scoped to a single shop, a role narrowed to\n * specific connector accounts, or a role without the settlement-read\n * permission group is refused `403`: what a rail charged is the merchant's\n * own cost base, and here it is the whole response, so there is nothing\n * coherent to redact down to. Gate the surface on the caller's scope rather\n * than calling it and handling the failure.\n *\n * `GET /settlement/processor-cost`\n *\n * @example\n * ```typescript\n * const period = await delopay.settlement.processorCost({\n * test_mode: false,\n * year: 2026,\n * month: 7,\n * });\n * for (const bucket of period.buckets) {\n * // Each bucket is its own unit — render per bucket, never a sum.\n * console.log(bucket.connector, bucket.cost_amount, bucket.cost_currency);\n * }\n * ```\n */\n async processorCost(\n params?: ProcessorCostPeriodRequest,\n options?: RequestExtras,\n ): Promise<ProcessorCostPeriodResponse> {\n return this.request('GET', '/settlement/processor-cost', {\n query: {\n profile_id: params?.profile_id,\n test_mode: params?.test_mode,\n year: params?.year,\n month: params?.month,\n },\n ...options,\n });\n }\n\n /**\n * What the payment providers say about one period's money, per connector\n * account and currency: of the payments made in the period, how much the\n * provider still holds, has released into its balance, has paid out to a\n * bank, or says nothing about.\n *\n * Amounts are the payments' gross in their own currency, never converted,\n * so render per bucket and never sum across currencies. A provider that\n * reports no settlement is `unknown`, never available. An amount is `null`\n * where no payment of the bucket carried one, never `0`.\n *\n * Give both `from` and `to`, or neither for the running calendar month.\n *\n * `GET /settlement/provider-holds`\n */\n async providerHolds(\n params?: ProviderHoldsRequest,\n options?: RequestExtras,\n ): Promise<ProviderHoldsResponse> {\n return this.request('GET', '/settlement/provider-holds', {\n query: {\n profile_id: params?.profile_id,\n test_mode: params?.test_mode,\n from: params?.from,\n to: params?.to,\n },\n ...options,\n });\n }\n\n /**\n * List generated settlement statements, the newest period first unless\n * `sort_by` says otherwise. Several `payout_status` values match a\n * statement in any of them.\n *\n * `GET /settlement/statements`\n */\n async listStatements(\n params: SettlementStatementListParams,\n options?: RequestExtras,\n ): Promise<SettlementStatementListResponse> {\n return this.request('GET', '/settlement/statements', {\n query: statementListQuery(params),\n ...options,\n });\n }\n\n /**\n * One statement with its per-connector/currency breakdown.\n *\n * `GET /settlement/statements/{statementId}`\n */\n async retrieveStatement(\n statementId: string,\n options?: RequestExtras,\n ): Promise<FeeStatementDetail> {\n return this.request(\n 'GET',\n `/settlement/statements/${encodeURIComponent(statementId)}`,\n options,\n );\n }\n\n /**\n * Generate (or regenerate) the statement for one shop and period: a\n * calendar month by `year` and `month`, or any period by its `period_start`.\n *\n * `POST /settlement/statements/generate`\n */\n async generateStatement(\n params: StatementGenerateRequest,\n options?: RequestExtras,\n ): Promise<FeeStatementDetail> {\n return this.request('POST', '/settlement/statements/generate', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Record payout progress on a statement (`unpaid` / `partial` / `paid`).\n *\n * Subject to the caller's `settlement_payout` operation limit — a\n * per-operation ceiling, a windowed total, a windowed count, or any\n * combination: an over-limit call fails with `DE_01` and nothing is\n * recorded. There is no approval route out of it — four-eyes needs an\n * executor that can run the operation once somebody says yes, and only\n * refunds have one, so a settlement rule can only block.\n *\n * `POST /settlement/statements/{statementId}/payout`\n */\n async updateStatementPayout(\n statementId: string,\n params: StatementPayoutUpdateRequest,\n options?: RequestExtras,\n ): Promise<FeeStatementDetail> {\n return this.request(\n 'POST',\n `/settlement/statements/${encodeURIComponent(statementId)}/payout`,\n { body: params, ...options },\n );\n }\n\n /** Append one external transfer record. Send a stable idempotency_key for safe retries. */\n async recordStatementPayout(\n statementId: string,\n params: StatementPayoutRecordRequest,\n options?: RequestExtras,\n ): Promise<FeeStatementDetail> {\n return this.request(\n 'POST',\n `/settlement/statements/${encodeURIComponent(statementId)}/payout`,\n {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key ?? null,\n },\n );\n }\n\n /** Read individual transfer records, their signed total, and any overpayment. */\n async listStatementPayouts(\n statementId: string,\n options?: RequestExtras,\n ): Promise<StatementPayoutListResponse> {\n return this.request(\n 'GET',\n `/settlement/statements/${encodeURIComponent(statementId)}/payouts`,\n options,\n );\n }\n\n /** Record a transfer against a shop's period before its statement exists. */\n async recordAdvance(\n params: StatementAdvanceRecordRequest,\n options?: RequestExtras,\n ): Promise<StatementAdvance> {\n return this.request('POST', '/settlement/advances', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key ?? null,\n });\n }\n\n async listAdvances(\n params: SettlementAdvanceListRequest,\n options?: RequestExtras,\n ): Promise<SettlementAdvanceListResponse> {\n return this.request('GET', '/settlement/advances', {\n query: {\n profile_id: params.profile_id,\n year: params.year,\n month: params.month,\n period_start: params.period_start,\n test_mode: params.test_mode,\n },\n ...options,\n });\n }\n\n /**\n * A shop's statement periods, newest first: the running one and those that\n * closed in the last twelve months. Each `period_start` names its period to\n * {@link generateStatement}, {@link recordAdvance} and {@link listAdvances}.\n *\n * `GET /settlement/periods`\n */\n async listPeriods(\n params: SettlementPeriodListParams,\n options?: RequestExtras,\n ): Promise<SettlementPeriodListResponse> {\n return this.request('GET', '/settlement/periods', {\n query: { profile_id: params.profile_id },\n ...options,\n });\n }\n\n /**\n * The next six statement periods a value of the `settlement.statement_period`\n * setting would make, before it is saved: for a shop, the rest of its running\n * period and the change at its next boundary. The value is judged as a save\n * would judge it, so a value the account cannot save is refused here too.\n * Writes nothing.\n *\n * `POST /settlement/periods/preview`\n */\n async previewPeriods(\n params: SettlementPeriodPreviewParams,\n options?: RequestExtras,\n ): Promise<SettlementPeriodPreviewResponse> {\n return this.request('POST', '/settlement/periods/preview', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Export a statement as PDF, or with `format` as CSV, JSON\n * (`StatementDocument`) or XLSX. Returns the raw bytes as a `Blob`, with\n * the same auth, retries and error handling as every other call — persist\n * or object-URL it caller-side.\n *\n * `GET /settlement/statements/{statementId}/pdf`\n *\n * @example\n * ```typescript\n * const pdf = await delopay.settlement.downloadStatementPdf('stmt_1', {\n * currency: 'EUR',\n * include_transactions: true,\n * });\n * const url = URL.createObjectURL(pdf);\n * ```\n */\n async downloadStatementPdf(\n statementId: string,\n params?: StatementPdfParams,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request('GET', `/settlement/statements/${encodeURIComponent(statementId)}/pdf`, {\n query: {\n currency: params?.currency,\n include_transactions: params?.include_transactions,\n format: params?.format,\n },\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * The individual settled attempts of one shop's calendar month.\n *\n * `GET /settlement/lines`\n */\n async listLines(\n params: SettlementLineListParams,\n options?: RequestExtras,\n ): Promise<SettlementLineListResponse> {\n return this.request('GET', '/settlement/lines', {\n query: {\n profile_id: params.profile_id,\n year: params.year,\n month: params.month,\n period_start: params.period_start,\n test_mode: params.test_mode,\n limit: params.limit,\n offset: params.offset,\n },\n ...options,\n });\n }\n\n /**\n * The fee schedules that currently apply to a shop.\n *\n * `GET /settlement/fee-config`\n */\n async feeConfig(\n params: ShopFeeConfigParams,\n options?: RequestExtras,\n ): Promise<ShopFeeConfigResponse> {\n return this.request('GET', '/settlement/fee-config', {\n query: { profile_id: params.profile_id },\n ...options,\n });\n }\n\n /**\n * Enqueue a settlement-line backfill over historical attempts. Attempts\n * already covered by a line are always skipped.\n *\n * `POST /settlement/backfill`\n */\n async backfill(\n params?: SettlementBackfillRequest,\n options?: RequestExtras,\n ): Promise<SettlementBackfillResponse> {\n return this.request('POST', '/settlement/backfill', { body: params, ...options });\n }\n\n /**\n * Toggle whether a shop's owner can see their own settlement figures.\n *\n * `POST /settlement/shops/visibility`\n */\n async setShopVisibility(\n params: ShopVisibilityUpdateRequest,\n options?: RequestExtras,\n ): Promise<ShopVisibilityResponse> {\n return this.request('POST', '/settlement/shops/visibility', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Manual adjustments recorded on a statement.\n *\n * `GET /settlement/statements/{statementId}/adjustments`\n */\n async listStatementAdjustments(\n statementId: string,\n options?: RequestExtras,\n ): Promise<StatementAdjustmentListResponse> {\n return this.request(\n 'GET',\n `/settlement/statements/${encodeURIComponent(statementId)}/adjustments`,\n options,\n );\n }\n\n /**\n * Add a manual adjustment to a statement. Positive `amount_usd` charges\n * the shop (reducing their payout); negative credits them.\n *\n * Subject to the caller's `settlement_adjustment` operation limit: an\n * over-limit call fails with `DE_01` and no adjustment is added. Both\n * windows count every add, and a credit counts at its magnitude. A\n * settlement rule can only block — approval is refund-only, for the reason\n * given on `updateStatementPayout()`. When another add by the same user\n * changes the window while this one is being admitted, the call fails with\n * HTTP 412 and nothing is written; retrying the same request is safe.\n *\n * `POST /settlement/statements/{statementId}/adjustments`\n */\n async createStatementAdjustment(\n statementId: string,\n params: StatementAdjustmentCreateRequest,\n options?: RequestExtras,\n ): Promise<StatementAdjustment> {\n return this.request(\n 'POST',\n `/settlement/statements/${encodeURIComponent(statementId)}/adjustments`,\n { body: params, ...options },\n );\n }\n\n /**\n * Remove a manual adjustment from a statement.\n *\n * The adjustment still counts against the caller's `settlement_adjustment`\n * limit window it was added in: removing it does not give back its count or\n * amount.\n *\n * `DELETE /settlement/statements/{statementId}/adjustments/{adjustmentId}`\n */\n async deleteStatementAdjustment(\n statementId: string,\n adjustmentId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/settlement/statements/${encodeURIComponent(statementId)}/adjustments/${encodeURIComponent(adjustmentId)}`,\n options,\n );\n }\n\n /**\n * Calculate a period in its transaction currency. Requires a host-level\n * dashboard JWT and settlement read permission. Profile users and roles\n * restricted to selected connector accounts cannot read this aggregate.\n * Rates apply once to the period total. Unknown or estimated fees keep\n * dependent amounts provisional. Native money values remain integer strings.\n */\n async previewNative(\n params: NativeSettlementPreviewRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementPreviewResponse> {\n return this.request('POST', '/settlement/native/preview', { body: params, ...options });\n }\n\n /**\n * Recalculate and freeze an immutable report version. Requires settlement\n * edit permission. Explicitly allow provisional figures when source fees\n * are incomplete. A report records a calculation and sends no money.\n * Reuse the same idempotency key when retrying the same request.\n */\n async createNativeReport(\n params: NativeSettlementReportCreateRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementReport> {\n return this.request('POST', '/settlement/native/reports', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /**\n * Freeze a report for exactly one ended statement period of a shop, under\n * its saved settlement structure. Requires settlement edit permission. A\n * period that is not in the shop's plan or has not ended yet is refused.\n * Reuse the same idempotency key when retrying the same request.\n *\n * `POST /settlement/native/reports/period`\n */\n async createNativePeriodReport(\n params: NativeSettlementPeriodReportRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementReport> {\n return this.request('POST', '/settlement/native/reports/period', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /**\n * Add up the shops' period reports for one window and currency. Reads\n * only. A shop whose period crosses the window or lacks a report is listed\n * with that status and left out of the totals.\n *\n * `POST /settlement/native/reports/combined`\n */\n async combineNativeReports(\n params: NativeSettlementCombinedRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementCombinedResponse> {\n return this.request('POST', '/settlement/native/reports/combined', {\n body: params,\n ...options,\n });\n }\n\n async retrieveNativeReport(\n reportId: string,\n options?: RequestExtras,\n ): Promise<NativeSettlementReport> {\n return this.request(\n 'GET',\n `/settlement/native/reports/${encodeURIComponent(reportId)}`,\n options,\n );\n }\n\n /**\n * List report summaries without fetching every source row in each saved\n * snapshot, the newest first. `sort_by` takes `period` here; another value\n * is refused.\n */\n async listNativeReports(\n params: NativeSettlementListRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementReportListResponse> {\n return this.request('GET', '/settlement/native/reports', {\n query: nativeListQuery(params),\n ...options,\n });\n }\n\n /**\n * The period reports of the shop a shop reader's role is bound to, newest\n * first, without any figure. A merchant-level reader is refused (403) and\n * reads the full reports with `listNativeReports`; so is a shop whose\n * merchant does not share settlement with it.\n *\n * `GET /settlement/native/shop/reports`\n */\n async listShopNativeReports(\n params: NativeShopReportListRequest,\n options?: RequestExtras,\n ): Promise<NativeShopReportListResponse> {\n return this.request('GET', '/settlement/native/shop/reports', {\n query: {\n currency: params.currency,\n test_mode: params.test_mode,\n ...(params.limit != null ? { limit: params.limit } : {}),\n ...(params.offset != null ? { offset: params.offset } : {}),\n },\n ...options,\n });\n }\n\n /**\n * One of the shop's period reports as a shop reader sees it: the items the\n * merchant hides are withheld, as frozen with the report.\n *\n * `GET /settlement/native/shop/reports/{id}`\n */\n async retrieveShopNativeReport(id: string, options?: RequestExtras): Promise<NativeShopReport> {\n return this.request('GET', `/settlement/native/shop/reports/${encodeURIComponent(id)}`, {\n ...options,\n });\n }\n\n /**\n * Record a transfer already made, under settlement write permission and\n * the caller's payout limits. This method never sends money. Native minor\n * units remain strings; negative records must name a same-scope reversal.\n * These records belong to the native ledger, separate from monthly USD\n * statement payouts and advances.\n */\n async recordNativePayout(\n params: NativeSettlementPayoutCreateRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementPayout> {\n return this.request('POST', '/settlement/native/payouts', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /**\n * List recorded payouts, the earliest value date first. `sort_by` takes\n * `value_date` or `amount` here; another value is refused.\n */\n async listNativePayouts(\n params: NativeSettlementListRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementPayoutListResponse> {\n return this.request('GET', '/settlement/native/payouts', {\n query: nativeListQuery(params),\n ...options,\n });\n }\n\n /** Refresh a bounded page of provider fee evidence. Follow next_offset while has_more is true. */\n async refreshNativeFees(\n params: NativeSettlementFeeRefreshRequest,\n options?: RequestExtras,\n ): Promise<NativeSettlementFeeRefreshResponse> {\n return this.request('POST', '/settlement/native/fees/refresh', { body: params, ...options });\n }\n\n async downloadNativeReportPdf(\n reportId: string,\n params?: NativeSettlementPdfRequest,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request('GET', `/settlement/native/reports/${encodeURIComponent(reportId)}/pdf`, {\n query: { include_transactions: params?.include_transactions },\n responseType: 'blob',\n ...options,\n });\n }\n\n /** Download the frozen source rows and calculation as CSV. */\n async downloadNativeReportCsv(reportId: string, options?: RequestExtras): Promise<Blob> {\n return this.request(\n 'GET',\n `/settlement/native/reports/${encodeURIComponent(reportId)}/export`,\n {\n ...options,\n headers: exportHeaders(options, 'text/csv'),\n responseType: 'blob',\n },\n );\n }\n\n /**\n * The merchant's stored reserves: what a statement structure's reserve item\n * holds, for how long and when it is released.\n *\n * `GET /settlement/native/reserves`\n */\n async listNativeReserves(options?: RequestExtras): Promise<NativeReserveListResponse> {\n return this.request('GET', '/settlement/native/reserves', { ...options });\n }\n\n /**\n * What the shop's reserves hold for it, for a reader whose role is bound to\n * one shop: only reserves the merchant shows to shop readers, and only this\n * shop's held amounts and releases.\n *\n * `GET /settlement/native/shop/reserves`\n */\n async listShopNativeReserves(\n params: NativeShopReserveListRequest,\n options?: RequestExtras,\n ): Promise<NativeShopReserveListResponse> {\n return this.request('GET', '/settlement/native/shop/reserves', {\n query: { currency: params.currency, test_mode: params.test_mode },\n ...options,\n });\n }\n\n /**\n * Store a reserve for a statement structure's reserve item, at the merchant,\n * one of its projects or one of its shops. Requires settlement edit\n * permission. One reserve per item and level; a second is refused with 412.\n *\n * `POST /settlement/native/reserves`\n */\n async createNativeReserve(\n params: NativeReserveCreateRequest,\n options?: RequestExtras,\n ): Promise<NativeReserve> {\n return this.request('POST', '/settlement/native/reserves', { body: params, ...options });\n }\n\n /**\n * Change a stored reserve. Amounts already held keep the rule they were held\n * under. Send the `modified_at` you read; an edit of an older version is\n * refused with 412.\n *\n * `PUT /settlement/native/reserves/{id}`\n */\n async updateNativeReserve(\n reserveId: string,\n params: NativeReserveUpdateRequest,\n options?: RequestExtras,\n ): Promise<NativeReserve> {\n return this.request('PUT', `/settlement/native/reserves/${encodeURIComponent(reserveId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * What a reserve holds in one currency and mode: its balance, each held\n * amount with the rule it keeps, and every release.\n *\n * `GET /settlement/native/reserves/{id}/overview`\n */\n async nativeReserveOverview(\n reserveId: string,\n params: NativeReserveOverviewRequest,\n options?: RequestExtras,\n ): Promise<NativeReserveOverview> {\n return this.request(\n 'GET',\n `/settlement/native/reserves/${encodeURIComponent(reserveId)}/overview`,\n {\n query: { currency: params.currency, test_mode: params.test_mode },\n ...options,\n },\n );\n }\n\n /**\n * Release part of a held amount by hand, before it is due. Requires\n * settlement write permission. Reuse the same `release_key` when retrying:\n * the same key and amount answer with the release already made.\n *\n * `POST /settlement/native/reserves/{id}/lots/{lot_id}/release`\n */\n async releaseNativeReserveEarly(\n reserveId: string,\n lotId: string,\n params: NativeReserveReleaseRequest,\n options?: RequestExtras,\n ): Promise<NativeReserveMovement> {\n return this.request(\n 'POST',\n `/settlement/native/reserves/${encodeURIComponent(reserveId)}/lots/${encodeURIComponent(lotId)}/release`,\n { body: params, ...options },\n );\n }\n\n /** Export the frozen report as JSON, excluding host account-level costs. */\n async exportNativeReportJson(\n reportId: string,\n options?: RequestExtras,\n ): Promise<NativeSettlementReportExport> {\n return this.request(\n 'GET',\n `/settlement/native/reports/${encodeURIComponent(reportId)}/export`,\n {\n ...options,\n headers: exportHeaders(options, 'application/json'),\n },\n );\n }\n\n /**\n * Bind one shop's money terms to the shop party's consent. From then on the\n * host changes them only by proposal. Releasing the requirement is itself a\n * proposal (`consent_release`).\n *\n * `POST /settlement/shops/terms/consent`\n */\n async bindShopTermConsent(\n params: ShopTermConsentUpdateRequest,\n options?: RequestExtras,\n ): Promise<ShopTermConsentResponse> {\n return this.request('POST', '/settlement/shops/terms/consent', { body: params, ...options });\n }\n\n /**\n * Propose a change to a bound shop's hosting fees: a schedule created,\n * updated or deleted, or the fee rule program set or removed.\n *\n * `POST /settlement/shops/terms/fee-proposals`\n */\n async proposeShopFeeChange(\n params: ShopTermProposalRequest<ShopTermFeeChange>,\n options?: RequestExtras,\n ): Promise<ShopTermProposal> {\n return this.request('POST', '/settlement/shops/terms/fee-proposals', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Propose a change to a bound shop's settlement terms: whether it carries the\n * processor's fee (`cost_passthrough`), or releasing the consent requirement\n * (`consent_release`).\n *\n * `POST /settlement/shops/terms/settlement-proposals`\n */\n async proposeShopSettlementChange(\n params: ShopTermProposalRequest<ShopTermSettlementChange>,\n options?: RequestExtras,\n ): Promise<ShopTermProposal> {\n return this.request('POST', '/settlement/shops/terms/settlement-proposals', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Propose a change to a bound shop's statement builder: its statement\n * structure, a stored reserve, or one report with recorded accrued shares\n * replaced. When the shop party accepts, the server tries to apply it; an\n * accepted proposal whose change could not be applied says so in\n * `execution_error`. Refused while the deployment does not cover the\n * builder by consent.\n *\n * `POST /settlement/shops/terms/builder-proposals`\n */\n async proposeShopBuilderChange(\n params: ShopTermProposalRequest<ShopTermBuilderChange>,\n options?: RequestExtras,\n ): Promise<ShopTermProposal> {\n return this.request('POST', '/settlement/shops/terms/builder-proposals', {\n body: params,\n ...options,\n });\n }\n\n /**\n * The proposals on this merchant's shops, read by both parties. A caller\n * bound to one shop sees only that shop's.\n *\n * `GET /settlement/shops/terms/proposals`\n */\n async listShopTermProposals(\n params?: ShopTermProposalListRequest,\n options?: RequestExtras,\n ): Promise<ShopTermProposalListResponse> {\n return this.request('GET', '/settlement/shops/terms/proposals', {\n query: { profile_id: params?.profile_id, status: params?.status, limit: params?.limit },\n ...options,\n });\n }\n\n /**\n * The shop party accepts a proposal, and the change is applied. Needs the\n * settlement consent permission in the shop party's own session. If applying\n * fails, the acceptance is still recorded and this rejects; the change may\n * or may not have landed, so re-read the proposal and the shop's terms.\n *\n * `POST /settlement/shops/terms/proposals/{proposalId}/accept`\n */\n async acceptShopTermProposal(\n proposalId: string,\n params?: ShopTermProposalDecisionRequest,\n options?: RequestExtras,\n ): Promise<ShopTermProposal> {\n return this.request(\n 'POST',\n `/settlement/shops/terms/proposals/${encodeURIComponent(proposalId)}/accept`,\n { body: params ?? {}, ...options },\n );\n }\n\n /**\n * The shop party declines a proposal. Final; nothing changes.\n *\n * `POST /settlement/shops/terms/proposals/{proposalId}/decline`\n */\n async declineShopTermProposal(\n proposalId: string,\n params?: ShopTermProposalDecisionRequest,\n options?: RequestExtras,\n ): Promise<ShopTermProposal> {\n return this.request(\n 'POST',\n `/settlement/shops/terms/proposals/${encodeURIComponent(proposalId)}/decline`,\n { body: params ?? {}, ...options },\n );\n }\n\n /**\n * A shop's consent record, newest first: binding, releases and each\n * proposal's way to being applied, each with the side that acted.\n *\n * `GET /settlement/shops/terms/consent-events`\n */\n async listShopTermConsentEvents(\n params?: ShopTermConsentEventListRequest,\n options?: RequestExtras,\n ): Promise<ShopTermConsentEventListResponse> {\n return this.request('GET', '/settlement/shops/terms/consent-events', {\n query: { profile_id: params?.profile_id, limit: params?.limit, cursor: params?.cursor },\n ...options,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/
|
|
1
|
+
{"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-7QZCUXWB.cjs","../src/internal/resources/cache.ts"],"names":[],"mappings":"AAAA;ACEO,IAAM,MAAA,EAAN,MAAY;AAAA,EACjB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,UAAA,CAAW,GAAA,EAA+C;AAC9D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,GAAG,CAAC,CAAA,CAAA;AAC1E,EAAA;AACF;ADC6E;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-7QZCUXWB.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/
|
|
1
|
+
{"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-7VXF5D67.cjs","../src/internal/resources/gsm.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,IAAA,EAAN,MAAU;AAAA,EACf,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAAwD;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,MAAA,EAAQ,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACtD;AAAA,EAEA,MAAM,QAAA,CAAS,MAAA,EAA2D;AACxE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,EAAY,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC1D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAAwD;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC7D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAA2D;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC7D;AACF,CAAA;ADHA;AACA;AACE;AACF,kBAAC","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-7VXF5D67.cjs","sourcesContent":[null,"import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/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,Q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AAA,EAAI,CAAC;AAAA,IAC1E,CAAA;AAAA,EACF,CAAC,CAAA;AACH;AAQA,IAAM,uBAAA,EAAyB,gEAAA;AAgGxB,SAAS,kBAAA,CAAmB,MAAA,EAA0C;AAC3E,EAAA,MAAM,KAAA,EAAO,MAAA,CAAO,eAAA,CAAgB,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA;AACtD,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":"/home/jonathan/Desktop/DeloPay/dev1/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
|
+
{"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/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;AAAA,EACzD,YAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA;AAYA,SAAS,kBAAA,CAAmB,GAAA,EAAiC;AAC3D,EAAA,wBAAO,oBAAA,CAAqB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU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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":"/home/anes/delo-payment/sdk-publish-w2/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":["/home/
|
|
1
|
+
{"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/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":"/home/anes/delo-payment/sdk-publish-w2/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"]}
|