@volter/twin-stripe 2.0.37 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -207
- package/dist/generated/pack-facts.json +94 -0
- package/dist/spec/SOURCE.md +14 -0
- package/dist/spec/fixtures3.json.gz +0 -0
- package/dist/spec/openapi.json.gz +0 -0
- package/dist/spec/patches.json +34 -0
- package/dist/spec/sources.json +378 -0
- package/dist/src/cli.js +12 -30
- package/dist/src/engine/after-payment.d.ts +9 -0
- package/dist/src/engine/after-payment.js +28 -0
- package/dist/src/engine/apps-secrets.d.ts +1 -0
- package/dist/src/engine/apps-secrets.js +3 -0
- package/dist/src/engine/balance.d.ts +5 -0
- package/dist/src/engine/balance.js +15 -0
- package/dist/src/engine/billing.d.ts +5 -0
- package/dist/src/engine/billing.js +6 -0
- package/dist/src/engine/charges.d.ts +6 -0
- package/dist/src/engine/charges.js +13 -0
- package/dist/src/engine/checkout.d.ts +24 -0
- package/dist/src/engine/checkout.js +30 -0
- package/dist/src/engine/common.d.ts +19 -0
- package/dist/src/engine/common.js +32 -0
- package/dist/src/{screens → engine}/connect-settings.d.ts +1 -7
- package/dist/src/engine/connect-settings.js +26 -0
- package/dist/src/engine/connect.d.ts +66 -0
- package/dist/src/engine/connect.js +189 -0
- package/dist/src/engine/coupons.d.ts +0 -0
- package/dist/src/engine/coupons.js +5 -0
- package/dist/src/engine/credit-notes.d.ts +1 -0
- package/dist/src/engine/credit-notes.js +5 -0
- package/dist/src/engine/customers.d.ts +12 -0
- package/dist/src/engine/customers.js +30 -0
- package/dist/src/engine/display.d.ts +14 -0
- package/dist/src/engine/display.js +16 -0
- package/dist/src/engine/disputes.d.ts +0 -0
- package/dist/src/engine/disputes.js +9 -0
- package/dist/src/engine/entitlements.d.ts +1 -0
- package/dist/src/engine/entitlements.js +4 -0
- package/dist/src/engine/ephemeral-keys.d.ts +0 -0
- package/dist/src/engine/ephemeral-keys.js +4 -0
- package/dist/src/engine/files.d.ts +18 -0
- package/dist/src/engine/files.js +33 -0
- package/dist/src/engine/front.d.ts +5 -0
- package/dist/src/engine/front.js +25 -0
- package/dist/src/engine/invoices.d.ts +24 -0
- package/dist/src/engine/invoices.js +57 -0
- package/dist/src/engine/issuing.d.ts +35 -0
- package/dist/src/engine/issuing.js +45 -0
- package/dist/src/engine/ledger.d.ts +9 -0
- package/dist/src/engine/ledger.js +9 -0
- package/dist/src/engine/oauth.d.ts +4 -0
- package/dist/src/engine/oauth.js +25 -0
- package/dist/src/engine/onboarding.d.ts +13 -0
- package/dist/src/engine/onboarding.js +42 -0
- package/dist/src/{stripe-params.d.ts → engine/params.d.ts} +20 -3
- package/dist/src/{stripe-params.js → engine/params.js} +7 -60
- package/dist/src/engine/payment-intents.d.ts +10 -0
- package/dist/src/engine/payment-intents.js +27 -0
- package/dist/src/engine/payment-links.d.ts +1 -0
- package/dist/src/engine/payment-links.js +5 -0
- package/dist/src/engine/payment-methods.d.ts +16 -0
- package/dist/src/engine/payment-methods.js +22 -0
- package/dist/src/engine/plans.d.ts +6 -0
- package/dist/src/engine/plans.js +26 -0
- package/dist/src/engine/platform.d.ts +39 -0
- package/dist/src/engine/platform.js +34 -0
- package/dist/src/engine/products.d.ts +0 -0
- package/dist/src/engine/products.js +4 -0
- package/dist/src/engine/radar.d.ts +2 -0
- package/dist/src/engine/radar.js +5 -0
- package/dist/src/engine/refunds.d.ts +1 -0
- package/dist/src/engine/refunds.js +28 -0
- package/dist/src/engine/renewals.d.ts +36 -0
- package/dist/src/engine/renewals.js +65 -0
- package/dist/src/engine/setup-intents.d.ts +1 -0
- package/dist/src/engine/setup-intents.js +4 -0
- package/dist/src/{stripe-twin.d.ts → engine/stripe.d.ts} +11 -39
- package/dist/src/{stripe-twin.js → engine/stripe.js} +25 -310
- package/dist/src/engine/subscription-schedules.d.ts +3 -0
- package/dist/src/engine/subscription-schedules.js +1 -0
- package/dist/src/engine/subscriptions.d.ts +12 -0
- package/dist/src/engine/subscriptions.js +31 -0
- package/dist/src/engine/tax.d.ts +7 -0
- package/dist/src/engine/tax.js +28 -0
- package/dist/src/engine/terminal.d.ts +4 -0
- package/dist/src/engine/terminal.js +20 -0
- package/dist/src/engine/test-clocks.d.ts +5 -0
- package/dist/src/engine/test-clocks.js +9 -0
- package/dist/src/engine/tokens.d.ts +7 -0
- package/dist/src/engine/tokens.js +20 -0
- package/dist/src/engine/transfers.d.ts +2 -0
- package/dist/src/engine/transfers.js +1 -0
- package/dist/src/engine/treasury.d.ts +23 -0
- package/dist/src/engine/treasury.js +45 -0
- package/dist/src/{stripe-version.js → engine/version.js} +4 -3
- package/dist/src/engine/webhook-endpoints.d.ts +1 -0
- package/dist/src/engine/webhook-endpoints.js +12 -0
- package/dist/src/engine/webhooks.d.ts +31 -0
- package/dist/src/engine/webhooks.js +68 -0
- package/dist/src/fetch.d.ts +2 -0
- package/dist/src/fetch.js +26 -0
- package/dist/src/generated/surface.gen.json +1 -1
- package/dist/src/generated/ui.gen.json +1 -1
- package/dist/src/index.d.ts +5 -14
- package/dist/src/index.js +8 -75
- package/dist/src/manifest.js +232 -758
- package/dist/src/screens/billing-portal.d.ts +3 -0
- package/dist/src/screens/{portal.js → billing-portal.js} +28 -54
- package/dist/src/screens/checkout.d.ts +2 -31
- package/dist/src/screens/checkout.js +32 -121
- package/dist/src/screens/connect-oauth.d.ts +3 -27
- package/dist/src/screens/connect-oauth.js +51 -132
- package/dist/src/screens/connect-onboarding.d.ts +3 -0
- package/dist/src/screens/{onboarding.js → connect-onboarding.js} +36 -102
- package/dist/src/screens/dashboard.d.ts +3 -0
- package/dist/src/screens/dashboard.js +117 -0
- package/dist/src/screens/shared.d.ts +27 -0
- package/dist/src/screens/shared.js +87 -0
- package/dist/src/screens/stripe-js.d.ts +3 -0
- package/dist/src/screens/stripe-js.js +135 -0
- package/dist/src/semantics/account_links.d.ts +2 -0
- package/dist/src/semantics/account_links.js +22 -0
- package/dist/src/semantics/accounts.d.ts +4 -0
- package/dist/src/semantics/accounts.js +38 -0
- package/dist/src/semantics/apps.d.ts +4 -0
- package/dist/src/semantics/{apps-secrets.js → apps.js} +14 -26
- package/dist/src/semantics/around.d.ts +2 -0
- package/dist/src/semantics/around.js +16 -0
- package/dist/src/semantics/balance.d.ts +2 -11
- package/dist/src/semantics/balance.js +3 -194
- package/dist/src/semantics/balance_transactions.d.ts +2 -0
- package/dist/src/semantics/balance_transactions.js +15 -0
- package/dist/src/semantics/billing_portal.d.ts +5 -0
- package/dist/src/semantics/billing_portal.js +42 -0
- package/dist/src/semantics/charges.d.ts +3 -28
- package/dist/src/semantics/charges.js +5 -202
- package/dist/src/semantics/checkout.d.ts +3 -20
- package/dist/src/semantics/checkout.js +8 -261
- package/dist/src/semantics/clock.d.ts +2 -0
- package/dist/src/semantics/clock.js +21 -0
- package/dist/src/semantics/coupons.d.ts +2 -6
- package/dist/src/semantics/coupons.js +2 -60
- package/dist/src/semantics/customers.d.ts +6 -6
- package/dist/src/semantics/customers.js +27 -387
- package/dist/src/semantics/disputes.d.ts +2 -2
- package/dist/src/semantics/disputes.js +3 -49
- package/dist/src/semantics/doors.d.ts +23 -0
- package/dist/src/semantics/doors.js +73 -0
- package/dist/src/semantics/entitlements.d.ts +2 -2
- package/dist/src/semantics/entitlements.js +5 -50
- package/dist/src/semantics/events.d.ts +12 -0
- package/dist/src/semantics/events.js +36 -0
- package/dist/src/semantics/index.d.ts +2 -0
- package/dist/src/semantics/index.js +107 -0
- package/dist/src/semantics/invoice_payments.d.ts +2 -0
- package/dist/src/semantics/invoice_payments.js +12 -0
- package/dist/src/semantics/invoiceitems.d.ts +3 -0
- package/dist/src/semantics/invoiceitems.js +59 -0
- package/dist/src/semantics/invoices.d.ts +16 -18
- package/dist/src/semantics/invoices.js +118 -444
- package/dist/src/semantics/payment_intents.d.ts +4 -0
- package/dist/src/semantics/payment_intents.js +79 -0
- package/dist/src/semantics/payment_methods.d.ts +5 -0
- package/dist/src/semantics/payment_methods.js +39 -0
- package/dist/src/semantics/payouts.d.ts +2 -0
- package/dist/src/semantics/payouts.js +21 -0
- package/dist/src/semantics/prices.d.ts +4 -0
- package/dist/src/semantics/prices.js +37 -0
- package/dist/src/semantics/products.d.ts +6 -2
- package/dist/src/semantics/products.js +15 -130
- package/dist/src/semantics/promotion_codes.d.ts +3 -0
- package/dist/src/semantics/promotion_codes.js +35 -0
- package/dist/src/semantics/radar.d.ts +2 -2
- package/dist/src/semantics/radar.js +5 -74
- package/dist/src/semantics/refunds.d.ts +3 -9
- package/dist/src/semantics/refunds.js +6 -192
- package/dist/src/semantics/setup_intents.d.ts +3 -0
- package/dist/src/semantics/{setup-intents.js → setup_intents.js} +10 -53
- package/dist/src/semantics/shared.d.ts +822 -47
- package/dist/src/semantics/shared.js +3044 -78
- package/dist/src/semantics/states.d.ts +531 -0
- package/dist/src/semantics/states.js +852 -0
- package/dist/src/semantics/subscription_items.d.ts +5 -0
- package/dist/src/semantics/subscription_items.js +55 -0
- package/dist/src/semantics/subscription_schedules.d.ts +4 -0
- package/dist/src/semantics/subscription_schedules.js +60 -0
- package/dist/src/semantics/subscriptions.d.ts +7 -11
- package/dist/src/semantics/subscriptions.js +44 -415
- package/dist/src/semantics/test_helpers.d.ts +6 -0
- package/dist/src/semantics/{test-clocks.js → test_helpers.js} +14 -40
- package/dist/src/semantics/transfers.d.ts +2 -2
- package/dist/src/semantics/transfers.js +6 -101
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.js +7 -0
- package/generated/pack-facts.json +94 -0
- package/package.json +10 -20
- package/spec/SOURCE.md +14 -0
- package/spec/fixtures3.json.gz +0 -0
- package/spec/openapi.json.gz +0 -0
- package/spec/patches.json +34 -0
- package/spec/sources.json +378 -0
- package/src/cli.ts +12 -26
- package/src/engine/after-payment.ts +31 -0
- package/src/engine/apps-secrets.ts +4 -0
- package/src/engine/balance.ts +33 -0
- package/src/engine/billing.ts +16 -0
- package/src/engine/charges.ts +19 -0
- package/src/engine/checkout.ts +40 -0
- package/src/engine/common.ts +47 -0
- package/src/engine/connect-settings.ts +23 -0
- package/src/engine/connect.ts +184 -0
- package/src/engine/coupons.ts +5 -0
- package/src/engine/credit-notes.ts +6 -0
- package/src/engine/customers.ts +35 -0
- package/src/engine/display.ts +19 -0
- package/src/engine/disputes.ts +9 -0
- package/src/engine/entitlements.ts +5 -0
- package/src/engine/ephemeral-keys.ts +3 -0
- package/src/engine/files.ts +41 -0
- package/src/engine/front.ts +31 -0
- package/src/engine/invoices.ts +71 -0
- package/src/engine/issuing.ts +61 -0
- package/src/engine/ledger.ts +50 -0
- package/src/engine/oauth.ts +19 -0
- package/src/engine/onboarding.ts +54 -0
- package/src/{stripe-params.ts → engine/params.ts} +8 -56
- package/src/engine/payment-intents.ts +33 -0
- package/src/engine/payment-links.ts +6 -0
- package/src/engine/payment-methods.ts +25 -0
- package/src/engine/plans.ts +42 -0
- package/src/engine/platform.ts +47 -0
- package/src/engine/products.ts +3 -0
- package/src/engine/radar.ts +6 -0
- package/src/engine/refunds.ts +29 -0
- package/src/engine/renewals.ts +73 -0
- package/src/engine/setup-intents.ts +5 -0
- package/src/{stripe-twin.ts → engine/stripe.ts} +28 -323
- package/src/engine/subscription-schedules.ts +10 -0
- package/src/engine/subscriptions.ts +40 -0
- package/src/engine/tax.ts +39 -0
- package/src/engine/terminal.ts +23 -0
- package/src/engine/test-clocks.ts +11 -0
- package/src/engine/tokens.ts +22 -0
- package/src/engine/transfers.ts +23 -0
- package/src/engine/treasury.ts +47 -0
- package/src/{stripe-version.ts → engine/version.ts} +4 -3
- package/src/engine/webhook-endpoints.ts +14 -0
- package/src/engine/webhooks.ts +72 -0
- package/src/fetch.ts +27 -0
- package/src/generated/surface.gen.json +1 -1
- package/src/generated/ui.gen.json +1 -1
- package/src/index.ts +8 -116
- package/src/manifest.ts +234 -786
- package/src/screens/{portal.tsx → billing-portal.tsx} +32 -37
- package/src/screens/checkout.tsx +33 -95
- package/src/screens/connect-oauth.tsx +64 -88
- package/src/screens/{onboarding.tsx → connect-onboarding.tsx} +38 -82
- package/src/screens/dashboard.tsx +198 -0
- package/src/screens/shared.tsx +84 -0
- package/src/screens/stripe-js.ts +170 -0
- package/src/semantics/account_links.ts +21 -0
- package/src/semantics/accounts.ts +43 -0
- package/src/semantics/{apps-secrets.ts → apps.ts} +17 -32
- package/src/semantics/around.ts +20 -0
- package/src/semantics/balance.ts +6 -207
- package/src/semantics/balance_transactions.ts +20 -0
- package/src/semantics/billing_portal.ts +51 -0
- package/src/semantics/charges.ts +12 -211
- package/src/semantics/checkout.ts +13 -268
- package/src/semantics/clock.ts +26 -0
- package/src/semantics/coupons.ts +5 -67
- package/src/semantics/customers.ts +29 -392
- package/src/semantics/disputes.ts +9 -59
- package/src/semantics/doors.ts +80 -0
- package/src/semantics/entitlements.ts +9 -56
- package/src/semantics/events.ts +44 -0
- package/src/semantics/index.ts +111 -0
- package/src/semantics/invoice_payments.ts +18 -0
- package/src/semantics/invoiceitems.ts +59 -0
- package/src/semantics/invoices.ts +109 -443
- package/src/semantics/payment_intents.ts +83 -0
- package/src/semantics/payment_methods.ts +43 -0
- package/src/semantics/payouts.ts +23 -0
- package/src/semantics/prices.ts +42 -0
- package/src/semantics/products.ts +18 -142
- package/src/semantics/promotion_codes.ts +39 -0
- package/src/semantics/radar.ts +8 -77
- package/src/semantics/refunds.ts +9 -212
- package/src/semantics/setup_intents.ts +45 -0
- package/src/semantics/shared.ts +3092 -106
- package/src/semantics/states.ts +883 -0
- package/src/semantics/subscription_items.ts +54 -0
- package/src/semantics/subscription_schedules.ts +66 -0
- package/src/semantics/subscriptions.ts +49 -432
- package/src/semantics/{test-clocks.ts → test_helpers.ts} +23 -47
- package/src/semantics/transfers.ts +11 -131
- package/src/server.ts +8 -0
- package/client/dashboard-api.ts +0 -286
- package/client/stripe-mirror.css +0 -277
- package/client/stripe-mirror.tsx +0 -1559
- package/dist/client/dashboard-api.d.ts +0 -107
- package/dist/client/dashboard-api.js +0 -238
- package/dist/client/dashboard-api.ts +0 -286
- package/dist/client/stripe-mirror.bundle.js +0 -236
- package/dist/client/stripe-mirror.css +0 -277
- package/dist/client/stripe-mirror.d.ts +0 -134
- package/dist/client/stripe-mirror.js +0 -859
- package/dist/client/stripe-mirror.tsx +0 -1559
- package/dist/src/screens/connect-settings.js +0 -103
- package/dist/src/screens/consent-skin.d.ts +0 -4
- package/dist/src/screens/consent-skin.js +0 -18
- package/dist/src/screens/financial-connections.d.ts +0 -5
- package/dist/src/screens/financial-connections.js +0 -90
- package/dist/src/screens/identity.d.ts +0 -5
- package/dist/src/screens/identity.js +0 -86
- package/dist/src/screens/onboarding.d.ts +0 -13
- package/dist/src/screens/portal.d.ts +0 -5
- package/dist/src/screens/public-details.d.ts +0 -5
- package/dist/src/screens/public-details.js +0 -90
- package/dist/src/semantics/after-payment.d.ts +0 -22
- package/dist/src/semantics/after-payment.js +0 -99
- package/dist/src/semantics/apps-secrets.d.ts +0 -2
- package/dist/src/semantics/billing.d.ts +0 -2
- package/dist/src/semantics/billing.js +0 -220
- package/dist/src/semantics/connect.d.ts +0 -5
- package/dist/src/semantics/connect.js +0 -493
- package/dist/src/semantics/credit-notes.d.ts +0 -2
- package/dist/src/semantics/credit-notes.js +0 -172
- package/dist/src/semantics/ephemeral-keys.d.ts +0 -2
- package/dist/src/semantics/ephemeral-keys.js +0 -34
- package/dist/src/semantics/files.d.ts +0 -2
- package/dist/src/semantics/files.js +0 -125
- package/dist/src/semantics/issuing.d.ts +0 -13
- package/dist/src/semantics/issuing.js +0 -575
- package/dist/src/semantics/ledger.d.ts +0 -59
- package/dist/src/semantics/ledger.js +0 -200
- package/dist/src/semantics/payment-intents.d.ts +0 -18
- package/dist/src/semantics/payment-intents.js +0 -452
- package/dist/src/semantics/payment-links.d.ts +0 -2
- package/dist/src/semantics/payment-links.js +0 -133
- package/dist/src/semantics/payment-methods.d.ts +0 -20
- package/dist/src/semantics/payment-methods.js +0 -140
- package/dist/src/semantics/plans.d.ts +0 -5
- package/dist/src/semantics/plans.js +0 -121
- package/dist/src/semantics/platform.d.ts +0 -9
- package/dist/src/semantics/platform.js +0 -206
- package/dist/src/semantics/renewals.d.ts +0 -47
- package/dist/src/semantics/renewals.js +0 -281
- package/dist/src/semantics/setup-intents.d.ts +0 -2
- package/dist/src/semantics/subscription-schedules.d.ts +0 -2
- package/dist/src/semantics/subscription-schedules.js +0 -119
- package/dist/src/semantics/tax.d.ts +0 -2
- package/dist/src/semantics/tax.js +0 -197
- package/dist/src/semantics/terminal.d.ts +0 -5
- package/dist/src/semantics/terminal.js +0 -182
- package/dist/src/semantics/test-clocks.d.ts +0 -6
- package/dist/src/semantics/tokens.d.ts +0 -4
- package/dist/src/semantics/tokens.js +0 -44
- package/dist/src/semantics/treasury.d.ts +0 -2
- package/dist/src/semantics/treasury.js +0 -377
- package/dist/src/semantics/webhook-endpoints.d.ts +0 -3
- package/dist/src/semantics/webhook-endpoints.js +0 -85
- package/dist/src/stripe-budget.d.ts +0 -55
- package/dist/src/stripe-budget.js +0 -155
- package/dist/src/stripe-capabilities.d.ts +0 -3
- package/dist/src/stripe-capabilities.js +0 -5836
- package/dist/src/stripe-conformance.d.ts +0 -43
- package/dist/src/stripe-conformance.js +0 -105
- package/dist/src/stripe-connector.d.ts +0 -161
- package/dist/src/stripe-connector.js +0 -414
- package/dist/src/stripe-emit.d.ts +0 -2
- package/dist/src/stripe-emit.js +0 -145
- package/dist/src/stripe-events.d.ts +0 -93
- package/dist/src/stripe-events.js +0 -392
- package/dist/src/stripe-js.d.ts +0 -4
- package/dist/src/stripe-js.js +0 -70
- package/dist/src/stripe-mirror-ui.d.ts +0 -15
- package/dist/src/stripe-mirror-ui.js +0 -87
- package/dist/src/stripe-perform-harness.d.ts +0 -9
- package/dist/src/stripe-perform-harness.js +0 -26
- package/dist/src/stripe-server.d.ts +0 -33
- package/dist/src/stripe-server.js +0 -429
- package/dist/src/stripe-shared.d.ts +0 -109
- package/dist/src/stripe-shared.js +0 -276
- package/dist/src/stripe-ui-conformance.d.ts +0 -5
- package/dist/src/stripe-ui-conformance.js +0 -79
- package/dist/src/stripe-ui-structure.d.ts +0 -3
- package/dist/src/stripe-ui-structure.js +0 -168
- package/dist/test-fixtures/stripe-known-deviations.json +0 -110
- package/dist/test-fixtures/stripe-openapi-operations.SOURCE.md +0 -14
- package/dist/test-fixtures/stripe-openapi-operations.json +0 -4717
- package/dist/test-fixtures/stripe-schemas.SOURCE.md +0 -35
- package/dist/test-fixtures/stripe-schemas.json +0 -3813
- package/src/screens/connect-settings.tsx +0 -121
- package/src/screens/consent-skin.ts +0 -20
- package/src/screens/financial-connections.tsx +0 -101
- package/src/screens/identity.tsx +0 -96
- package/src/screens/public-details.tsx +0 -105
- package/src/semantics/after-payment.ts +0 -118
- package/src/semantics/billing.ts +0 -216
- package/src/semantics/connect.ts +0 -487
- package/src/semantics/credit-notes.ts +0 -168
- package/src/semantics/ephemeral-keys.ts +0 -34
- package/src/semantics/files.ts +0 -143
- package/src/semantics/issuing.ts +0 -590
- package/src/semantics/ledger.ts +0 -253
- package/src/semantics/payment-intents.ts +0 -463
- package/src/semantics/payment-links.ts +0 -148
- package/src/semantics/payment-methods.ts +0 -145
- package/src/semantics/plans.ts +0 -131
- package/src/semantics/platform.ts +0 -220
- package/src/semantics/renewals.ts +0 -279
- package/src/semantics/setup-intents.ts +0 -87
- package/src/semantics/subscription-schedules.ts +0 -129
- package/src/semantics/tax.ts +0 -220
- package/src/semantics/terminal.ts +0 -195
- package/src/semantics/tokens.ts +0 -52
- package/src/semantics/treasury.ts +0 -383
- package/src/semantics/webhook-endpoints.ts +0 -87
- package/src/stripe-budget.ts +0 -181
- package/src/stripe-capabilities.ts +0 -5651
- package/src/stripe-conformance.ts +0 -124
- package/src/stripe-connector.ts +0 -462
- package/src/stripe-emit.ts +0 -157
- package/src/stripe-events.ts +0 -434
- package/src/stripe-js.ts +0 -70
- package/src/stripe-mirror-ui.ts +0 -90
- package/src/stripe-perform-harness.ts +0 -29
- package/src/stripe-server.ts +0 -393
- package/src/stripe-shared.ts +0 -297
- package/src/stripe-ui-conformance.ts +0 -88
- package/src/stripe-ui-structure.ts +0 -182
- package/test-fixtures/stripe-known-deviations.json +0 -110
- package/test-fixtures/stripe-openapi-operations.json +0 -4717
- package/test-fixtures/stripe-schemas.json +0 -3813
- /package/dist/src/{screens → engine}/industries.d.ts +0 -0
- /package/dist/src/{screens → engine}/industries.js +0 -0
- /package/dist/src/{semantics → engine}/test-cards.d.ts +0 -0
- /package/dist/src/{semantics → engine}/test-cards.js +0 -0
- /package/dist/src/{stripe-version.d.ts → engine/version.d.ts} +0 -0
- /package/src/{screens → engine}/industries.ts +0 -0
- /package/src/{semantics → engine}/test-cards.ts +0 -0
|
@@ -1,82 +1,857 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { EventsDecl, Handler, HandlerContext } from '@volter/world-core';
|
|
2
|
+
import { type StripeAuthRequestOutcome } from '../engine/webhooks.js';
|
|
3
|
+
import { type Outcome } from '../engine/after-payment.js';
|
|
4
|
+
import { cardError, type CheckoutItem, declineFor, type StripeResponse } from '../engine/stripe.js';
|
|
5
|
+
import { type EnteredCard } from '../engine/checkout.js';
|
|
6
|
+
import { type Find, type Row } from '../engine/common.js';
|
|
7
|
+
import { type ConnectOAuthSettings } from '../engine/connect-settings.js';
|
|
8
|
+
/** Stripe's events: `Stripe-Signature: t=…,v1=…` over `${t}.${body}` keyed by the endpoint's secret
|
|
9
|
+
* (docs.stripe.com/webhooks#verify-manually); the Event object (docs.stripe.com/api/events/object) kept as the account's
|
|
10
|
+
* own (`GET /v1/events`), whether or not an endpoint takes it; an endpoint live while `enabled`, taking the types its
|
|
11
|
+
* `enabled_events` names (`*` all, `<family>.*` a family), and a Connect endpoint (`connect: true`) its connected
|
|
12
|
+
* accounts' events ("Connected accounts" scope, docs.stripe.com/connect/webhooks), any other the account's own. */
|
|
13
|
+
export declare const STRIPE_EVENTS: EventsDecl;
|
|
14
|
+
export type Reads = Pick<HandlerContext, 'rowsRaw'>;
|
|
15
|
+
/** Whether a connected account's OAuth connection to the platform was revoked (deauthorized, or its code reused). */
|
|
16
|
+
export declare function connectionRevoked(ctx: Reads, account: string): boolean;
|
|
17
|
+
/** The connected account an OAuth key acts as — the connection's current access_token (sk_test_oauth_…) or its
|
|
18
|
+
* stripe_publishable_key (pk_test_oauth_…) — with the scope it was issued; undefined for any other key, and null for an
|
|
19
|
+
* OAuth-shaped key no live connection holds (revoked, replaced by a refresh, or never issued). */
|
|
20
|
+
export declare function oauthKeyAccount(ctx: Reads, key: string): {
|
|
21
|
+
account: string;
|
|
22
|
+
scope: string;
|
|
23
|
+
} | null | undefined;
|
|
24
|
+
/** A customer's now: its test clock's frozen time when it is on one (docs.stripe.com/billing/testing/test-clocks), the
|
|
25
|
+
* World's otherwise. */
|
|
26
|
+
export declare function clockNow(ctx: HandlerContext, customer: unknown): number;
|
|
27
|
+
/** What a subscription's invoices charge: its own default payment method, else its customer's. */
|
|
28
|
+
export declare function payerOf(ctx: HandlerContext, sub: Row): string | undefined;
|
|
29
|
+
/** The customer's default for invoices, charged when the subscription names none of its own. */
|
|
30
|
+
export declare function customerDefault(ctx: HandlerContext, sub: Row): string | undefined;
|
|
31
|
+
/** A subscription whose invoice has just been finalized: the `once` coupon that invoice took is spent, and a once coupon
|
|
32
|
+
* it did not take (added after it was drafted) stays for the next (unspentDiscounts). */
|
|
33
|
+
export declare function spendOnceCoupon(ctx: HandlerContext, invoice: Row): Promise<void>;
|
|
34
|
+
/** A draft invoice for one period of a subscription, its lines the subscription's items and any one-time lines `once`
|
|
35
|
+
* gives it (a Checkout session's one-time prices, "on the initial invoice only", docs.stripe.com/api/checkout/sessions/
|
|
36
|
+
* create#create_checkout_session-line_items), under the subscription's discount. Answers the invoice id. */
|
|
37
|
+
export declare function draftSubscriptionInvoice(ctx: HandlerContext, sub: Row, o: {
|
|
38
|
+
start: number;
|
|
39
|
+
end: number;
|
|
40
|
+
reason: 'subscription_create' | 'subscription_cycle' | 'subscription_update';
|
|
41
|
+
trial?: boolean;
|
|
42
|
+
once?: Row[];
|
|
43
|
+
id?: string;
|
|
44
|
+
}): Promise<string>;
|
|
45
|
+
/** Finalize a subscription's draft invoice at `at` and charge what its subscription pays with. The move is time's (a
|
|
46
|
+
* renewal), the customer's (the Checkout page they paid on) or the API's (an update that ends a trial, which names the
|
|
47
|
+
* payer, may ask for no attempt, and moves the subscription itself: semantics/subscriptions.ts applyTrialEnd). Answers
|
|
48
|
+
* whether it was paid. */
|
|
49
|
+
export declare function collectSubscriptionInvoice(ctx: HandlerContext, invoiceId: string, at: number, actor: 'time' | 'external' | 'api', opts?: {
|
|
50
|
+
payer?: string;
|
|
51
|
+
attempt?: boolean;
|
|
52
|
+
}): Promise<boolean>;
|
|
53
|
+
/** Pay a subscription's open invoice with `paymentMethod` (the customer on the portal, `external`): the charge on the
|
|
54
|
+
* invoice's PaymentIntent, the invoice paid, a past_due subscription active. Answers the decline, if the card is refused. */
|
|
55
|
+
export declare function payOpenInvoice(ctx: HandlerContext, invoiceId: string, paymentMethod: string): Promise<{
|
|
56
|
+
code: string;
|
|
57
|
+
message: string;
|
|
58
|
+
} | undefined>;
|
|
59
|
+
/** Time's moves on subscriptions, caught up to each customer's clock in the order they fell due, each made at the
|
|
60
|
+
* moment it was due: a period that ended renews (a trial's end among them) or, set to cancel, cancels; a renewal
|
|
61
|
+
* drafted an hour or more ago is finalized and charged. */
|
|
62
|
+
export declare function advanceBilling(ctx: HandlerContext, only?: (sub: Row) => boolean): Promise<void>;
|
|
63
|
+
/** The earliest move that has come due, made at its moment; false when none has. */
|
|
64
|
+
export declare function billingStep(ctx: HandlerContext, at: (t: number) => Promise<HandlerContext>, only?: (sub: Row) => boolean): Promise<boolean>;
|
|
65
|
+
export declare const account: (ctx: HandlerContext) => string | undefined;
|
|
66
|
+
export declare const payoutMissing: (ctx: HandlerContext, id: string) => Response;
|
|
67
|
+
/** The acting account's Balance object (docs.stripe.com/api/balance/balance_object). */
|
|
68
|
+
export declare function balanceBody(ctx: HandlerContext, acct?: string | undefined): Row;
|
|
69
|
+
/** Time's arrivals, written: each of the acting account's payouts whose arrival date has come moves pending → paid
|
|
70
|
+
* (the clock's move, as asOf reads it), written as `payout.paid`, the event Stripe sends for it. Answers their ids. */
|
|
71
|
+
export declare function payDuePayouts(ctx: HandlerContext, acct?: string | undefined): Promise<string[]>;
|
|
72
|
+
/** Where a connected account's payout goes: "ID of the bank account or card the payout is sent to" (served spec,
|
|
73
|
+
* payout.destination), its default external account for the currency, "When multiple accounts are available for a given
|
|
74
|
+
* currency, Stripe uses the one set as `default_for_currency`" (docs.stripe.com/connect/payouts-bank-accounts), the
|
|
75
|
+
* newest such. Where the documentation stops and the twin decides: the platform's own bank account is not modelled, so
|
|
76
|
+
* its payouts name none. */
|
|
77
|
+
export declare function payoutBank(ctx: HandlerContext, account: string, currency: string): string | null;
|
|
78
|
+
export declare const payoutDefaults: (ctx: HandlerContext) => Row;
|
|
79
|
+
/** A payout as the clock reads it: paid once its arrival date has come, the clock's move, asked of the
|
|
80
|
+
* machine as a write asks it. */
|
|
81
|
+
export declare function asOf(ctx: HandlerContext, p: Row): Row;
|
|
82
|
+
/** A connected account's payout in a currency none of its bank accounts takes. */
|
|
83
|
+
export declare function noExternalAccount(ctx: HandlerContext, currency: string): Response;
|
|
84
|
+
/** Time's payouts, caught up to the World's clock: each account on an automatic schedule is paid out, on each of its
|
|
85
|
+
* scheduled days that has come, what became available by then. */
|
|
86
|
+
export declare function advancePayouts(ctx: HandlerContext): Promise<void>;
|
|
87
|
+
/** What Stripe does after a card succeeds: from a raw number, a test name (pm_card_* or tok_*), or a stored
|
|
88
|
+
* PaymentMethod that recorded it when it was made. */
|
|
89
|
+
export declare function afterSuccessOf(ctx: HandlerContext, ref: unknown): Outcome | undefined;
|
|
90
|
+
/** Stripe's acts on a charge that just succeeded: a dispute or a review its card brings, and the platform's fee. */
|
|
91
|
+
export declare function afterCharge(ctx: HandlerContext, chargeId: string, charge: {
|
|
92
|
+
amount: number;
|
|
93
|
+
currency: string;
|
|
94
|
+
payment_intent?: string | undefined;
|
|
95
|
+
application_fee_amount?: unknown;
|
|
96
|
+
destination?: unknown;
|
|
97
|
+
}, ref: unknown): Promise<void>;
|
|
98
|
+
/** Radar places an elevated-risk card's charge in review (docs.stripe.com/radar/reviews). */
|
|
99
|
+
export declare function openReview(ctx: HandlerContext, chargeId: string, pi: {
|
|
100
|
+
payment_intent: string | null;
|
|
101
|
+
}): Promise<void>;
|
|
102
|
+
/** The mandate a verified bank account carries for a payment (single use) or a setup (multi use). */
|
|
103
|
+
export declare function mintMandate(ctx: HandlerContext, paymentMethod: unknown, use: 'single_use' | 'multi_use', amount?: number, currency?: string): Promise<string>;
|
|
104
|
+
export declare const customerMissing: (ctx: HandlerContext, id: string) => Response;
|
|
105
|
+
/** The discount a customer's `coupon` makes, a parameter of API versions before the served one. */
|
|
106
|
+
export declare function customerDiscount(ctx: HandlerContext, couponId: string): Row | Response;
|
|
107
|
+
/** A tax ID for its owner: the account itself, or one of its customers. */
|
|
108
|
+
export declare function makeTaxId(ctx: HandlerContext, customer: string | undefined): Promise<Response>;
|
|
109
|
+
/** The owner a top-level tax-ID call names: the account itself unless `owner[type]=customer` names a customer
|
|
110
|
+
* (docs.stripe.com/api/tax_ids/list: owner defaults to self). */
|
|
111
|
+
export declare function ownerOf(ctx: HandlerContext): {
|
|
112
|
+
customer?: string;
|
|
113
|
+
} | Response;
|
|
114
|
+
export declare function cashBalance(ctx: HandlerContext, customer: string): Row;
|
|
115
|
+
/** Automatic reconciliation (docs.stripe.com/payments/customer-balance/reconciliation): funds that arrive pay the
|
|
116
|
+
* customer's open invoices that take bank transfers (payment_method_types customer_balance), the one whose number
|
|
117
|
+
* the transfer's reference names first, then the oldest. Where the documentation stops and the twin decides: an
|
|
118
|
+
* invoice is paid only when the balance covers all of what remains; a smaller balance waits for more funds. */
|
|
119
|
+
export declare function reconcile(ctx: HandlerContext, customer: string, currency: string, reference: string | null): Promise<void>;
|
|
120
|
+
/** The customer's source the path names, or undefined. */
|
|
121
|
+
export declare const customerSource: (ctx: HandlerContext) => Row | undefined;
|
|
122
|
+
export declare const sourceMissing: (ctx: HandlerContext) => Response;
|
|
123
|
+
/** The intent the path names, and the machine's refusal when this operation may not move it. */
|
|
124
|
+
export declare function load(ctx: HandlerContext, operationId: string): {
|
|
125
|
+
si: Row;
|
|
126
|
+
} | {
|
|
127
|
+
answer: Response;
|
|
128
|
+
};
|
|
129
|
+
/** The request event asked of the endpoint, signed with its secret and rendered in the event's API version, and its
|
|
130
|
+
* answer read as the decision. */
|
|
131
|
+
export declare function askForAuthorization(ctx: HandlerContext, url: string, event: Record<string, unknown>, secret: string): Promise<StripeAuthRequestOutcome>;
|
|
132
|
+
/** Stripe's refusal of a call a publishable key may not make, or undefined when the key may make it. */
|
|
133
|
+
export declare function publishableKeyRefused(ctx: HandlerContext): Response | undefined;
|
|
134
|
+
export declare function revokedAccountRefused(ctx: HandlerContext): Response | undefined;
|
|
135
|
+
/** The platform's own keys, as the dashboard's API keys page makes them (the `appCredentials` door): a secret key and a
|
|
136
|
+
* publishable key, held by their SHA-256. A request with no key is refused, as is a platform key Stripe never issued
|
|
137
|
+
* ("Invalid API Key provided"); a connected account's OAuth key is checked where it is read (actingAsOAuthKey). */
|
|
138
|
+
export declare function platformKeyRefused(ctx: HandlerContext, request: Request): Response | undefined;
|
|
139
|
+
export declare function actingAsOAuthKey(ctx: HandlerContext, request: Request): Promise<Request | Response>;
|
|
140
|
+
export declare function withMetadata(ctx: HandlerContext, request: Request): Request;
|
|
141
|
+
/** `disabled` switches delivery off or back on (docs.stripe.com/api/webhook_endpoints/update#update_webhook_endpoint-disabled). */
|
|
142
|
+
export declare function switchDelivery(ctx: HandlerContext, id: string, we: Row, fields: Row, off: boolean): Promise<Response>;
|
|
143
|
+
/** Whether a stored event is the acting account's (no `account`: the platform's). */
|
|
144
|
+
export declare const ownEvent: (ctx: HandlerContext, e: Row) => boolean;
|
|
145
|
+
export declare const faMissing: (ctx: HandlerContext, id: string, status?: number) => Response;
|
|
146
|
+
export declare const metadataOf: (ctx: HandlerContext) => unknown;
|
|
147
|
+
/** The account's bank address once financial_addresses.aba is active: "The FinancialAccount gains a FinancialAddress
|
|
148
|
+
* when the `financial_addresses.aba` feature is active", and "A FinancialAddress is not added until the
|
|
149
|
+
* financial_addresses.aba feature has been activated" (docs.stripe.com/treasury/account-management/financial-accounts),
|
|
150
|
+
* whose test example answers "bank_name": "Stripe Test Bank", "routing_number": "000000001" and the networks "ach",
|
|
151
|
+
* "us_domestic_wire", "rtp"; "The full account_number is only returned if the request expands it" (the same page).
|
|
152
|
+
* Where the documentation stops and the twin decides: the account number is ten digits drawn from the account's id,
|
|
153
|
+
* answered by its last four (the full number is null: expanding it is not modelled), and the holder's name is the
|
|
154
|
+
* platform account's business name, its dashboard name or, with neither, its id. */
|
|
155
|
+
export declare function abaAddress(ctx: HandlerContext, faId: string): Row;
|
|
156
|
+
export declare const addressesOf: (ctx: HandlerContext, faId: string, active: string[]) => Row[];
|
|
157
|
+
/** Post a flow's double entry: a ledger transaction with its net balance impact, and its one entry. */
|
|
158
|
+
export declare function post(ctx: HandlerContext, o: {
|
|
159
|
+
financial_account: string;
|
|
160
|
+
amount: number;
|
|
161
|
+
currency: string;
|
|
162
|
+
flow: string;
|
|
163
|
+
flow_type: string;
|
|
164
|
+
status: 'open' | 'posted';
|
|
165
|
+
balance_impact: Row;
|
|
166
|
+
description: string;
|
|
167
|
+
flowDetailKey?: string;
|
|
168
|
+
}): Promise<string>;
|
|
169
|
+
/** The request's funding account, or the refusal. */
|
|
170
|
+
export declare function fundingAccount(ctx: HandlerContext): string | Response;
|
|
171
|
+
/** Where an outbound flow sends its money, as the served spec's payment method details give it: the bank account's
|
|
172
|
+
* holder type, last four digits and routing number from what the request sent (a saved method's, or the test bank's
|
|
173
|
+
* when none is given), and its billing details (required): the name and email sent, the address lines null where not
|
|
174
|
+
* given. Where the documentation stops and the twin decides: a saved method's details are the test bank's. */
|
|
175
|
+
export declare function destinationDetails(ctx: HandlerContext, dest: string | null): Row;
|
|
176
|
+
/** An outbound payment that names no destination: "You must provide either destination_payment_method or
|
|
177
|
+
* destination_payment_method_data" (the served spec's outbound payment create). */
|
|
178
|
+
export declare function noDestination(ctx: HandlerContext): Response;
|
|
179
|
+
/** The bank account an inbound transfer may pull from: "You must first set up the account-attached payment method for
|
|
180
|
+
* inbound flows and verify the bank account using a SetupIntent", and invalid ones ("of unsupported types, containing
|
|
181
|
+
* an unverified bank account, or not set up for inbound flows") "throw the same errors as in live mode"
|
|
182
|
+
* (docs.stripe.com/treasury/moving-money/financial-accounts/into/inbound-transfers). A payment method is set up for
|
|
183
|
+
* inbound flows by a SetupIntent whose flow_directions holds `inbound`, and verified when that SetupIntent succeeded
|
|
184
|
+
* ("The bank account has been instantly verified or verification isn't necessary", its `succeeded` status,
|
|
185
|
+
* docs.stripe.com/treasury/connect/legacy/v1/moving-money/working-with-bankaccount-objects).
|
|
186
|
+
* Where the documentation stops and the twin decides: the page quotes no error, so the twin answers the documented code
|
|
187
|
+
* for the class, payment_method_unexpected_state ("The provided payment method's state was incompatible with the
|
|
188
|
+
* operation you were trying to perform", docs.stripe.com/error-codes), in its own words; an existing verified
|
|
189
|
+
* BankAccount (`ba_`), which the page also allows, is not checked. Answers the payment method, or the refusal. */
|
|
190
|
+
export declare function inboundOrigin(ctx: HandlerContext, origin: string): Row | Response | undefined;
|
|
191
|
+
export declare function received(kind: 'received_credit' | 'received_debit'): Handler;
|
|
192
|
+
/** Cancel a flow still processing; an outbound one must also still be cancelable. */
|
|
193
|
+
export declare function cancel(resource: string, param: string, name: string, operationId: string, op: string, checkCancelable: boolean): Handler;
|
|
194
|
+
export declare function ledger(resource: string, spec: Record<string, (r: Row, v: unknown) => boolean>): Handler;
|
|
195
|
+
export declare function scopeKeyOf(ctx: HandlerContext): string;
|
|
196
|
+
export declare const named: (ctx: HandlerContext, name: string) => Row | undefined;
|
|
197
|
+
export declare const invoiceMissing: (ctx: HandlerContext, id: string) => Response;
|
|
198
|
+
/** Write a draft's line list and the totals derived from it. */
|
|
199
|
+
export declare function writeLines(ctx: HandlerContext, invoiceId: string, next: Row[]): Promise<Row>;
|
|
200
|
+
/** Paying an invoice with nothing to pay it: "If not set, defaults to the subscription's default payment method, if any,
|
|
201
|
+
* or to the default payment method in the customer's invoice settings" (docs.stripe.com/api/invoices/object,
|
|
202
|
+
* default_payment_method), and none of them is set. */
|
|
203
|
+
export declare function nothingToPayWith(ctx: HandlerContext): Response;
|
|
204
|
+
/** A subscription waiting on the invoice paid through the invoice's own pay (incomplete on its first, past_due on a
|
|
205
|
+
* failed renewal) is active again. */
|
|
206
|
+
export declare function activatedByPayment(ctx: HandlerContext, subId: string): Promise<void>;
|
|
207
|
+
/** Re-derive a draft's lines from the items still on it: an item that changed or was deleted moves the invoice with it. */
|
|
208
|
+
export declare function resyncDraftLines(ctx: HandlerContext, invoiceId: string): Promise<void>;
|
|
209
|
+
/** An item priced by a Price: its unit amount times the quantity, in its currency (docs.stripe.com/api/invoiceitems/create#create_invoiceitem-pricing). */
|
|
210
|
+
export declare function pricedItem(ctx: HandlerContext, priceRef: string, qty: number): {
|
|
211
|
+
amount: number;
|
|
212
|
+
currency: string | undefined;
|
|
213
|
+
} | Response;
|
|
214
|
+
export declare const itemMissing: (ctx: HandlerContext, id: string) => Response;
|
|
215
|
+
/** A draft invoice another object makes (an accepted quote): its customer's, with an invoice item per line the
|
|
216
|
+
* object gives, and the object named as its parent. Answers the invoice's id. */
|
|
217
|
+
export declare function draftInvoiceFor(ctx: HandlerContext, customer: string, currency: string, parent: Row, lines: Array<{
|
|
218
|
+
price: unknown;
|
|
219
|
+
quantity: number;
|
|
220
|
+
amount: number;
|
|
221
|
+
description: unknown;
|
|
222
|
+
}>): Promise<string>;
|
|
223
|
+
/** A customer's pending invoice item, made before the invoice, pulled onto it (docs.stripe.com/api/invoices/create#create_invoice-pending_invoice_items_behavior). */
|
|
224
|
+
export declare function pullPendingItem(ctx: HandlerContext, invoiceId: string, inv: Row, item: Row, now: number): Promise<void>;
|
|
225
|
+
/** The invoice the path names, and the machine's refusal when this operation may not move it. */
|
|
226
|
+
export declare function invoicesLoad(ctx: HandlerContext, operationId: string): {
|
|
227
|
+
inv: Row;
|
|
228
|
+
} | {
|
|
229
|
+
answer: Response;
|
|
230
|
+
};
|
|
231
|
+
/** The PaymentIntent a charge_automatically invoice with a balance gets when it is finalized; it
|
|
232
|
+
* waits for confirmation when the invoice already names a default payment method. */
|
|
233
|
+
export declare function openPaymentIntent(ctx: HandlerContext, piId: string, inv: Row, invoiceId: string): Promise<void>;
|
|
234
|
+
export declare function finalizedFields(ctx: HandlerContext, inv: Row, now: number): Row;
|
|
235
|
+
export declare function editLines(kind: 'add' | 'update' | 'remove'): Handler;
|
|
236
|
+
export declare const noteMissing: (ctx: HandlerContext, id: string) => Response;
|
|
237
|
+
/** The credit note the request describes (the `amount` form: one custom line), or Stripe's refusal. */
|
|
238
|
+
export declare function build(ctx: HandlerContext, id: string): Row | Response;
|
|
239
|
+
/** The invoice's credit-note sums, from its issued credit notes; a pre-payment credit lowers what is owed. */
|
|
240
|
+
export declare function syncInvoice(ctx: HandlerContext, invoiceId: string): Promise<void>;
|
|
241
|
+
/** What a post-payment credit pays back: "Refunds: create a new refund (using refund_amount)"; "Customer balance credit:
|
|
242
|
+
* credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when
|
|
243
|
+
* it's finalized" (docs.stripe.com/api/credit_notes/create). The refund is made on the invoice's charge as a refund
|
|
244
|
+
* call makes it (refunds.ts); the credit is a customer balance transaction of type credit_note. Where the documentation
|
|
245
|
+
* stops and the twin decides: the refund carries no reason of its own. */
|
|
246
|
+
export declare function payBack(ctx: HandlerContext, id: string, cn: Row): Promise<Row | Response>;
|
|
247
|
+
/** A coupon for a fixed amount off, in its currency (docs.stripe.com/api/coupons/create#create_coupon-amount_off). */
|
|
248
|
+
export declare function amountOffOf(ctx: HandlerContext, params: Record<string, unknown>): number | Response;
|
|
249
|
+
/** Time's lapsing of coupons, caught up to the World's clock: a valid coupon whose redeem_by has passed is no longer
|
|
250
|
+
* valid from that moment (manifest.ts). Where the documentation stops and the twin decides: the lapse sends no event
|
|
251
|
+
* (the events page names none for it). */
|
|
252
|
+
export declare function lapseCoupons(ctx: HandlerContext): Promise<void>;
|
|
253
|
+
export declare const planMissing: (ctx: HandlerContext, id: string) => Response;
|
|
254
|
+
/** A recurring price the Plans API still answers: one whose plan was deleted is not a plan any more. */
|
|
255
|
+
export declare const recurring: (ctx: HandlerContext, p: Row | undefined) => p is Row;
|
|
256
|
+
/** The request's line items resolved against their prices, or the refusal for a missing price. */
|
|
257
|
+
export declare function resolved(ctx: HandlerContext): CheckoutItem[] | Response;
|
|
258
|
+
/** A page of the line items a stored object carries. */
|
|
259
|
+
export declare function linePage(ctx: HandlerContext, holder: Row): Response;
|
|
260
|
+
export declare const linkMissing: (ctx: HandlerContext, id: string) => Response;
|
|
261
|
+
export declare const quoteMissing: (ctx: HandlerContext, id: string) => Response;
|
|
262
|
+
export declare function move(action: 'finalize' | 'accept' | 'cancel', operationId: string): Handler;
|
|
263
|
+
export declare const sessionMissing: (ctx: HandlerContext, id: string) => Response;
|
|
264
|
+
/** The discount a session is created with (discounts[0][promotion_code] or [coupon]), or Stripe's refusal: an unknown
|
|
265
|
+
* code or coupon, and one that has expired or been deactivated, are refused at create
|
|
266
|
+
* (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-discounts, docs.stripe.com/error-codes#coupon-expired).
|
|
267
|
+
* Where the documentation stops and the twin decides: the refusals' wording. */
|
|
268
|
+
export declare function discountOf(ctx: HandlerContext, params: Row, now: number): {
|
|
269
|
+
coupon: Row;
|
|
270
|
+
promotion?: string;
|
|
271
|
+
} | Response | undefined;
|
|
272
|
+
/** A payment or subscription session with nothing to sell (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items). */
|
|
273
|
+
export declare function noLineItems(ctx: HandlerContext): Response;
|
|
274
|
+
/** A destination charge to an account the platform does not have (docs.stripe.com/connect/destination-charges). */
|
|
275
|
+
export declare function checkoutNoDestination(ctx: HandlerContext, destination: unknown): Response;
|
|
276
|
+
/** A session's trial Stripe refuses: `subscription_data.trial_end` "Has to be at least 48 hours in the future", and
|
|
277
|
+
* `subscription_data.trial_period_days` "Has to be at least 1" (docs.stripe.com/api/checkout/sessions/create). Where the
|
|
278
|
+
* documentation stops and the twin decides: the refusals' wording. */
|
|
279
|
+
export declare function sessionTrialRefused(ctx: HandlerContext, data: unknown, now: number): Response | undefined;
|
|
280
|
+
export declare function sessionTrialRefusal(ctx: HandlerContext, param: 'trial_end' | 'trial_period_days'): Response;
|
|
281
|
+
/** What completing a session makes, by its mode, as the fields that link it: a payment is a PaymentIntent paid with
|
|
282
|
+
* the entered card, its charge in the ledger as any payment's is. */
|
|
283
|
+
export declare function complete(ctx: HandlerContext, id: string, existing: Row, card?: EnteredCard): Promise<Row>;
|
|
284
|
+
/** A subscription session's lines at completion, each inline `price_data` made the Price it generates ("Data used to
|
|
285
|
+
* generate a new Price object inline", the same page), under the product it names or one made from its product_data,
|
|
286
|
+
* so the subscription's items bill it. Where the documentation stops and the twin decides: such a Price is archived
|
|
287
|
+
* (active=false), as a subscription item's price_data makes one (docs.stripe.com/products-prices/manage-prices). */
|
|
288
|
+
export declare function sessionPrices(ctx: HandlerContext, lines: Row[], inline: Array<Row | null>): Promise<Row[]>;
|
|
289
|
+
/** A setup session saves the card through a succeeded SetupIntent (docs.stripe.com/payments/save-and-reuse?platform=checkout). */
|
|
290
|
+
export declare function completeSetup(ctx: HandlerContext, customer: string | undefined, pm: Row | undefined): Promise<unknown>;
|
|
291
|
+
/** The discount a completed subscription session gives its subscription. */
|
|
292
|
+
export declare function sessionDiscount(ctx: HandlerContext, id: string, customer: string, now: number): Row[];
|
|
293
|
+
/** The customer paying on the hosted page (src/screens/checkout.tsx): the external actor's move on the
|
|
294
|
+
* session's machine, then what the payment made, linked, and the session stored complete. */
|
|
295
|
+
export declare function completeSession(ctx: HandlerContext, id: string, existing: Row, details?: Row, card?: EnteredCard): Promise<Row | Response>;
|
|
296
|
+
export declare const send: (ctx: HandlerContext, r: StripeResponse) => Response;
|
|
5
297
|
/** Stripe's error body: an invalid_request_error with the message, and the code when there is one. */
|
|
6
|
-
export declare const fail: (ctx:
|
|
298
|
+
export declare const fail: (ctx: HandlerContext, message: string, status?: number, code?: string) => Response;
|
|
7
299
|
/** A file parameter whose description requires a purpose refuses a file of another one. The served spec requires it
|
|
8
300
|
* on every such parameter ("Must have a `purpose` value of `issuing_logo`", personalization designs' card_logo;
|
|
9
301
|
* "The file's `purpose` must be one of the following: …", file links' file). Where the documentation stops and the
|
|
10
302
|
* twin decides: Stripe documents no error for it (docs.stripe.com/error-codes names none), so the twin answers the
|
|
11
303
|
* 400 invalid_request_error it answers for an unknown file, naming the parameter and the purposes allowed. */
|
|
12
|
-
export declare function filePurposeRefused(ctx:
|
|
304
|
+
export declare function filePurposeRefused(ctx: HandlerContext, param: string, allowed: readonly string[]): Response | undefined;
|
|
13
305
|
/** The request's path, as the list envelope's `url` carries it. */
|
|
14
|
-
export declare const path: (ctx:
|
|
306
|
+
export declare const path: (ctx: HandlerContext) => string;
|
|
15
307
|
/** A path parameter, by the name the spec gives it. */
|
|
16
|
-
export declare const at: (ctx:
|
|
308
|
+
export declare const at: (ctx: HandlerContext, name: string) => string;
|
|
17
309
|
/** An update's fields laid over what is stored, as the derived core does: a nested hash is merged into the stored one,
|
|
18
310
|
* not put in its place (Stripe updates only the keys a request names; docs.stripe.com/api/metadata and each update
|
|
19
311
|
* reference), and an empty string unsets a key. */
|
|
20
|
-
export declare function mergeUpdate(ctx:
|
|
21
|
-
/** The tree's type for a resource: what its rows are stored under. */
|
|
22
|
-
export declare const stored: (resource: string) => string;
|
|
312
|
+
export declare function mergeUpdate(ctx: HandlerContext, resource: string, id: string, fields: Row): Row;
|
|
23
313
|
/** A resource's rows in Stripe's list order: newest first by `timeField`, ties by mint order (as the derived core breaks them). */
|
|
24
314
|
/** A subject's bookkeeping field (`_…`): kept on the stored row, never in the wire view ctx.get and ctx.rows answer. */
|
|
25
|
-
export declare const kept: (ctx:
|
|
26
|
-
/** A removed discount as Stripe answers it: the discount, marked deleted (docs.stripe.com/api/discounts/delete). */
|
|
27
|
-
export declare function deletedDiscount(d: Row, now: unknown): Row;
|
|
315
|
+
export declare const kept: (ctx: HandlerContext, resource: string, row: Row, key: string) => unknown;
|
|
28
316
|
/** A create's parameter that describes a confirmation, sent without confirm=true: the served spec gives each "This
|
|
29
317
|
* parameter can only be used with `confirm=true`" (off_session: "can only be used when confirm=true"); the message's
|
|
30
318
|
* wording is the twin's. Answers the refusal, or undefined. */
|
|
31
|
-
export declare function confirmOnly(ctx:
|
|
319
|
+
export declare function confirmOnly(ctx: HandlerContext, names: string[], confirm: boolean): Response | undefined;
|
|
32
320
|
/** A coupon applied (and the promotion code it came by): its times_redeemed, "Number of times this coupon has been
|
|
33
321
|
* applied to a customer" (the served spec's coupon), counts it, as the code's "Number of times this promotion code
|
|
34
322
|
* has been used" (its promotion_code). Where the documentation stops and the twin decides: reaching max_redemptions
|
|
35
323
|
* does not yet lapse the coupon. */
|
|
36
|
-
export declare function redeemCoupon(ctx:
|
|
37
|
-
export declare function newest(ctx:
|
|
38
|
-
/** Keep the rows whose field equals the request's parameter of the same name, for each name given. */
|
|
39
|
-
/** A list's range filter on a unix time (`created[gte]=…&created[lt]=…`, or one exact time). */
|
|
40
|
-
export declare function inRange(t: unknown, v: unknown): boolean;
|
|
324
|
+
export declare function redeemCoupon(ctx: HandlerContext, couponId: unknown, promotionCode?: unknown): Promise<void>;
|
|
325
|
+
export declare function newest(ctx: HandlerContext, resource: string, timeField?: string): Row[];
|
|
41
326
|
/** A context at the moment Stripe would have made a move time makes (a renewal, a payout on its schedule), so what
|
|
42
327
|
* the move writes carries that moment (its events' occurredAt, `created`, a charge's funds' available_on), not the
|
|
43
328
|
* moment a later request caught it up. */
|
|
44
|
-
export declare function at_(ctx:
|
|
45
|
-
export declare function where(ctx:
|
|
329
|
+
export declare function at_(ctx: HandlerContext): (t: number) => Promise<HandlerContext>;
|
|
330
|
+
export declare function where(ctx: HandlerContext, items: Row[], spec: Record<string, (item: Row, value: unknown) => boolean>): Row[];
|
|
331
|
+
export declare function expandPaths(ctx: HandlerContext): string[][];
|
|
46
332
|
/** A balance transaction as the clock reads it: available once its available_on has passed, the clock's move,
|
|
47
|
-
* asked of the machine as a write asks it (
|
|
48
|
-
export declare function
|
|
49
|
-
/** Stripe's expand walk: each dotted path replaces an id with the resource
|
|
50
|
-
* holds, one segment at a time; an id the tree lacks stays an id.
|
|
51
|
-
* (asOf), as its own retrieve does. */
|
|
52
|
-
export declare function expandRow(ctx:
|
|
333
|
+
* asked of the machine as a write asks it (./ledger.ts). */
|
|
334
|
+
export declare function commonAsOf(ctx: HandlerContext, t: Row): Row;
|
|
335
|
+
/** Stripe's expand walk (the kernel's, over the manifest's `embeds`): each dotted path replaces an id with the resource
|
|
336
|
+
* it holds, one segment at a time; an id the tree lacks stays an id. An embedded balance transaction reads as the clock
|
|
337
|
+
* has it (asOf), as its own retrieve does. */
|
|
338
|
+
export declare function expandRow(ctx: HandlerContext, resource: string, body: Row, paths: string[][]): Row;
|
|
53
339
|
/** One resource with the request's `expand[]` applied. */
|
|
54
|
-
export declare const expanded: (ctx:
|
|
340
|
+
export declare const expanded: (ctx: HandlerContext, resource: string, body: Row) => Row;
|
|
55
341
|
/** Stripe's list envelope over rows already in list order: a page, `has_more`, and `expand[]=data.*`. */
|
|
56
|
-
export declare function list(ctx:
|
|
342
|
+
export declare function list(ctx: HandlerContext, resource: string, items: Row[]): Response;
|
|
57
343
|
/** Stripe's search over a resource's rows (`query` in its search language). */
|
|
58
|
-
export declare const search: (ctx:
|
|
344
|
+
export declare const search: (ctx: HandlerContext, resource: string, timeField?: string) => Response;
|
|
59
345
|
/** A create as Stripe stamps it: the caller's id when it gave one (seeding uses real ids), else a
|
|
60
346
|
* minted one; `object`, the creation time, the defaults, then the request's own fields. An object
|
|
61
347
|
* Stripe gives no creation time keeps the twin's as `_created`, for ordering. (A request parameter the
|
|
62
348
|
* object has no field for stays on the row, where the rules read it; the wire answer leaves it out,
|
|
63
|
-
*
|
|
64
|
-
export declare function created(ctx:
|
|
349
|
+
* ./version.ts.) */
|
|
350
|
+
export declare function created(ctx: HandlerContext, resource: string, params: Row, defaults: Row, opts?: {
|
|
65
351
|
timeField?: string;
|
|
66
352
|
operation?: string;
|
|
67
353
|
}): Promise<Row>;
|
|
68
|
-
|
|
69
|
-
* shared helpers look a price, a payment method or a card up by, read from the context's tree. */
|
|
70
|
-
export type Find = (storedType: string, id: string) => Row | undefined;
|
|
71
|
-
export declare const finder: (ctx: SemanticsContext) => Find;
|
|
72
|
-
/** A refund's destination_details for a card charge: "If this is a `card` refund, this hash contains the transaction
|
|
73
|
-
* specific details" and its `type` "can be `refund`, `reversal`, or `pending`" — a reversal, where "The original charge
|
|
74
|
-
* will drop off the bank statement altogether", for an authorization released uncaptured, else a refund, "a credit entry
|
|
75
|
-
* on the bank statement" (docs.stripe.com/api/refunds/object). The network's reference number the twin never has. A
|
|
76
|
-
* charge not paid by card answers none. */
|
|
77
|
-
export declare function refundDestination(charge: Row, type: 'refund' | 'reversal'): Row;
|
|
78
|
-
/** An account's external_accounts, "External accounts (bank accounts and debit cards) currently attached to this
|
|
79
|
-
* account" (docs.stripe.com/api/accounts/object), as the list its example answers. */
|
|
80
|
-
export declare const externalList: (account: string, data: Row[]) => Row;
|
|
354
|
+
export declare const finder: (ctx: Pick<HandlerContext, "rowsRaw">) => Find;
|
|
81
355
|
/** The account's external_accounts list, rewritten from its external accounts after one is added or removed. */
|
|
82
|
-
export declare function syncExternals(ctx:
|
|
356
|
+
export declare function syncExternals(ctx: HandlerContext, account: string): Promise<void>;
|
|
357
|
+
/** A decision over the rows and the write it makes, taken together: the read and the write follow one another with
|
|
358
|
+
* nothing between them (a code spent once, a connection revoked once). */
|
|
359
|
+
export declare function decide<T>(ctx: HandlerContext, decision: (rows: (resource: string) => Row[]) => {
|
|
360
|
+
value: T;
|
|
361
|
+
write?: {
|
|
362
|
+
resource: string;
|
|
363
|
+
id: string;
|
|
364
|
+
fields: Row;
|
|
365
|
+
operation: string;
|
|
366
|
+
};
|
|
367
|
+
}): Promise<T>;
|
|
368
|
+
export declare const catalog: (ctx: HandlerContext, data: Row[]) => Response;
|
|
369
|
+
export declare const orderMissing: (ctx: HandlerContext, id: string) => Response;
|
|
370
|
+
/** Each pending report run completes, caught up before anything is answered: "When the run completes, Stripe updates
|
|
371
|
+
* the object, and it has a status of succeeded. It also has a nested result object, containing a URL that you can use
|
|
372
|
+
* to access the file", the guide's example a File of purpose report_run and type csv (docs.stripe.com/reports/api).
|
|
373
|
+
* "Most runs complete within a few minutes" (the same page). Where the documentation stops and the twin decides: a run
|
|
374
|
+
* completes one minute after it was created (the guide's example: created 1580832900, succeeded_at 1580832960), and
|
|
375
|
+
* its CSV holds the report type's header row alone (its size that row's bytes). */
|
|
376
|
+
export declare function finishReportRuns(ctx: HandlerContext): Promise<void>;
|
|
377
|
+
/** A feature whose lookup_key an unarchived feature already has: "A unique key you provide as your own system identifier"
|
|
378
|
+
* (docs.stripe.com/api/entitlements/feature/create). */
|
|
379
|
+
export declare function lookupKeyTaken(ctx: HandlerContext, lookupKey: string): Response;
|
|
380
|
+
export declare const pmMissing: (ctx: HandlerContext, id: string) => Response;
|
|
381
|
+
/** The card a charge was paid with, as its payment_method_details reports it
|
|
382
|
+
* (docs.stripe.com/api/charges/object#charge_object-payment_method_details): a stored PaymentMethod's card, a
|
|
383
|
+
* documented test name (pm_card_* or tok_*, the same cards), or a raw card; undefined for anything else. */
|
|
384
|
+
export declare function paymentMethodDetails(ctx: HandlerContext, ref: unknown): Row | undefined;
|
|
385
|
+
/** Whether a payment method can be attached: a stored one, or a documented test name that attaching mints. */
|
|
386
|
+
export declare const attachable: (ctx: HandlerContext, id: string) => boolean;
|
|
387
|
+
export declare function attachPaymentMethod(ctx: HandlerContext, id: string, customer: string): Promise<Row>;
|
|
388
|
+
/** A documented test name (pm_card_visa, pm_card_visa_chargeDeclined, …) made a real PaymentMethod, as Stripe
|
|
389
|
+
* does when one is used: the brand and number it stands for (docs.stripe.com/testing#cards) and its outcome. */
|
|
390
|
+
export declare function materializeTestMethod(ctx: HandlerContext, id: string, customer: string | null): Promise<Row>;
|
|
391
|
+
/** A PaymentMethod made from a confirm's `payment_method_data` ("If provided, this hash will be used to create a
|
|
392
|
+
* PaymentMethod", docs.stripe.com/api/setup_intents/confirm, docs.stripe.com/api/payment_intents/confirm), or none. */
|
|
393
|
+
export declare function methodFromData(ctx: HandlerContext, data: unknown): Promise<string | undefined>;
|
|
394
|
+
/** Whether an intent sets up or pays with a bank account by micro-deposits because it asks for them:
|
|
395
|
+
* payment_method_options[us_bank_account][verification_method]=microdeposits with a us_bank_account method
|
|
396
|
+
* ("Microdeposit only verification", docs.stripe.com/payments/ach-direct-debit/set-up-payment). */
|
|
397
|
+
export declare function microdepositsAsked(ctx: HandlerContext, params: Row, intent: Row, pm: string | undefined): boolean;
|
|
398
|
+
export declare const scheduleMissing: (ctx: HandlerContext, id: string) => Response;
|
|
399
|
+
/** A schedule's phases as Stripe answers them (the served spec's subscription_schedule_phase_configuration): each
|
|
400
|
+
* starts where the last ended (the first at the schedule's start_date, "now" or a timestamp), and ends at its
|
|
401
|
+
* end_date or after its duration ("duration: interval, interval_count", the served spec's phases[] parameter) on the
|
|
402
|
+
* calendar; its currency is its first price's, each item carries its price, quantity and (empty) discounts. Where the
|
|
403
|
+
* documentation stops and the twin decides: a phase with neither lasts one interval of its first price. */
|
|
404
|
+
export declare function phasesOf(ctx: HandlerContext, given: Row[], start: number): Row[];
|
|
405
|
+
export declare function end(kind: 'cancel' | 'release'): Handler;
|
|
406
|
+
/** A token asked for none of what a token holds. */
|
|
407
|
+
export declare function noTokenSource(ctx: HandlerContext): Response;
|
|
408
|
+
/** A bank account token's account, as the legacy BankAccount object holds it. */
|
|
409
|
+
export declare function bankAccountOf(ctx: HandlerContext, ba: Row): Row;
|
|
410
|
+
export declare const productMissing: (ctx: HandlerContext, id: string) => Response;
|
|
411
|
+
/** A product deleted while it has prices: "Deleting a product is only possible if it has no prices associated with it"
|
|
412
|
+
* (docs.stripe.com/api/products/delete). */
|
|
413
|
+
export declare function pricedProductRefused(ctx: HandlerContext): Response;
|
|
414
|
+
/** A feature attached to a product that already has it. */
|
|
415
|
+
export declare function alreadyAttached(ctx: HandlerContext): Response;
|
|
416
|
+
export declare const productFeature: (ctx: HandlerContext) => Row | undefined;
|
|
417
|
+
export declare const featureMissing: (ctx: HandlerContext) => Response;
|
|
418
|
+
/** A tiered price: tiers_mode and tiers, each tier with up_to and a unit or flat amount; no single unit_amount, and
|
|
419
|
+
* the last tier's up_to null (∞) (docs.stripe.com/products-prices/pricing-models#tiered-pricing). */
|
|
420
|
+
export declare function tieredPrice(ctx: HandlerContext, params: Row): Promise<Response>;
|
|
421
|
+
/** Whether the intent's caller named its methods: on create (TYPES_GIVEN), or by an update that set its
|
|
422
|
+
* payment_method_types ("Alternatively, update the allowed payment_method_types for this PaymentIntent",
|
|
423
|
+
* methodNotAllowed below), which the generic update writes as given, so the intent's history holds it. */
|
|
424
|
+
export declare const typesGiven: (ctx: HandlerContext, id: string) => boolean;
|
|
425
|
+
export declare const paymentIntentsSend: (ctx: HandlerContext, r: StripeResponse) => Response;
|
|
426
|
+
export declare function mintCharge(ctx: HandlerContext, piId: string, pi: Row, amount: number): Promise<string>;
|
|
427
|
+
/** A manual-capture intent's authorization: "Separate payment authorization and capture to create a charge now, but
|
|
428
|
+
* capture funds later", and on capture "A partial capture automatically releases the remaining amount"
|
|
429
|
+
* (docs.stripe.com/payments/place-a-hold-on-a-payment-method). The charge succeeded and is not captured, holding the
|
|
430
|
+
* amount until capture_before, with nothing on the balance yet. Written as
|
|
431
|
+
* charge.succeeded, as a charge made with capture=false is (charges.ts); its capture writes charge.captured
|
|
432
|
+
* (captureAuthorization). Where the documentation stops and the twin decides: the events page names no event for an
|
|
433
|
+
* authorization of its own, so the authorized charge sends charge.succeeded, its status being succeeded. */
|
|
434
|
+
export declare function authorizeCharge(ctx: HandlerContext, piId: string, pi: Row, amount: number): Promise<string>;
|
|
435
|
+
/**
|
|
436
|
+
* An intent an invoice collects through succeeded (the default_incomplete subscription flow: create
|
|
437
|
+
* now, confirm client-side): its invoice is paid and, when it is a subscription's first, the
|
|
438
|
+
* subscription leaves incomplete for active. Both are moves the invoice and subscription machines
|
|
439
|
+
* declare under the confirming operation. No-op when the intent names no invoice, or the invoice is
|
|
440
|
+
* already paid (a duplicate confirm) or void (voiding ends what it collects).
|
|
441
|
+
*/
|
|
442
|
+
export declare function payInvoiceOf(ctx: HandlerContext, pi: Row, operationId: string, actor?: 'vendor'): Promise<void>;
|
|
443
|
+
/** The intent the path names, and the machine's refusal when this operation may not move it. */
|
|
444
|
+
export declare function paymentIntentsLoad(ctx: HandlerContext, operationId: string): {
|
|
445
|
+
pi: Record<string, unknown>;
|
|
446
|
+
} | {
|
|
447
|
+
answer: Response;
|
|
448
|
+
};
|
|
449
|
+
/** The type of the payment method an intent is paid with: its PaymentMethod's, or a documented test name's (pm_card_*,
|
|
450
|
+
* tok_* a card; pm_usBankAccount_* a US bank account), else unknown. */
|
|
451
|
+
export declare function methodType(ctx: HandlerContext, method: unknown): string | undefined;
|
|
452
|
+
/** A confirm with a payment method of a type the intent's caller did not allow, refused as Stripe refuses it: "The
|
|
453
|
+
* PaymentMethod provided (card_present) is not allowed for this PaymentIntent. Please attach a PaymentMethod of one of
|
|
454
|
+
* the following types: card. Alternatively, update the allowed payment_method_types for this PaymentIntent to include
|
|
455
|
+
* "card_present"" (a real answer quoted in github.com/stripe/stripe-terminal-react-native/issues/745, an intent made
|
|
456
|
+
* with payment_method_types ['card']). Only a list the caller gave restricts: without one Stripe offers the methods
|
|
457
|
+
* the account enables, which the twin does not model. Where the evidence stops: that answer's code is not quoted; the
|
|
458
|
+
* twin answers payment_intent_invalid_parameter ("One or more provided parameters wasn't allowed for the given
|
|
459
|
+
* operation on the PaymentIntent", docs.stripe.com/error-codes), param payment_method. */
|
|
460
|
+
export declare function methodNotAllowed(ctx: HandlerContext, existing: Row, params: Row): Response | undefined;
|
|
461
|
+
/** Confirm an intent the confirm machine allows to move: the confirm action, and a create with `confirm=true`. */
|
|
462
|
+
export declare function confirmIntent(ctx: HandlerContext, existing: Record<string, unknown>, params: Record<string, unknown>): Promise<Response>;
|
|
463
|
+
/** An increment that does not raise the authorization. */
|
|
464
|
+
export declare function incrementTooSmall(ctx: HandlerContext): Response;
|
|
465
|
+
/** Whether the method an intent is confirmed with is a bank debit: a us_bank_account PaymentMethod, or one of Stripe's
|
|
466
|
+
* test bank accounts named as one (pm_usBankAccount_*, pm_us_bank_account). */
|
|
467
|
+
export declare function isBankDebit(ctx: HandlerContext, method: unknown): boolean;
|
|
468
|
+
/** Whether a bank debit stays processing: the page's pm_usBankAccount_processing, or its account 000000000009. */
|
|
469
|
+
export declare function staysProcessing(ctx: HandlerContext, method: unknown): boolean;
|
|
470
|
+
/** A bank debit submitted: the intent processes, nothing received yet, sent as payment_intent.processing; it is due to
|
|
471
|
+
* settle at this instant, unless its test account stays processing. */
|
|
472
|
+
export declare function beginBankDebit(ctx: HandlerContext, id: string, fields: Row): Promise<Row>;
|
|
473
|
+
/** Time's settling of bank debits, caught up to the World's clock: each processing debit whose moment has come succeeds
|
|
474
|
+
* then, its Charge made (naming the mandate it ran under) and the invoice it collects for paid. */
|
|
475
|
+
export declare function settleBankDebits(ctx: HandlerContext): Promise<void>;
|
|
476
|
+
/** A customer_balance intent funded from the customer's cash balance: paid when the balance covers it ("If the customer
|
|
477
|
+
* already has a balance high enough to cover the payment amount, the PaymentIntent immediately succeeds"), else
|
|
478
|
+
* waiting for a transfer: "If the customer balance isn’t high enough to cover the request amount, the PaymentIntent
|
|
479
|
+
* shows a requires_action status ... next_action ... display_bank_transfer_instructions" with the amount_remaining
|
|
480
|
+
* (docs.stripe.com/payments/bank-transfers/accept-a-payment). Answers the intent as written. */
|
|
481
|
+
export declare function fundFromCashBalance(ctx: HandlerContext, pi: Row, fields?: Row): Promise<Row>;
|
|
482
|
+
/** Whether a charge's funds go straight to the available balance: a bypass card as a raw number, a test name (pm_card_*
|
|
483
|
+
* or tok_*), or a stored PaymentMethod made from one (which records it as what follows its success, after-payment.ts);
|
|
484
|
+
* or a US bank account, stored or one of Stripe's test bank accounts named as one (pm_usBankAccount_*). */
|
|
485
|
+
export declare function bypassesPending(ctx: HandlerContext, card: string | undefined): boolean;
|
|
486
|
+
/** The connected account a request acts for, or undefined for the platform. */
|
|
487
|
+
export declare const actingAccount: (ctx: HandlerContext) => string | undefined;
|
|
488
|
+
/** A ledger entry on an account's balance: the acting account's unless one is named (null names the platform). */
|
|
489
|
+
export declare function write(ctx: HandlerContext, fields: Row, account?: string | null | undefined): Promise<string>;
|
|
490
|
+
/** A captured charge's credit: its amount less the fee, pending two days unless the card bypasses the pending
|
|
491
|
+
* balance (bypassesPending), when it is due at once. The
|
|
492
|
+
* caller mints the charge's id first and stores the returned id as the charge's balance_transaction. */
|
|
493
|
+
export declare function settleCharge(ctx: HandlerContext, chargeId: string, amount: number, currency: string, card?: string): Promise<string>;
|
|
494
|
+
/** A refund's debit, at once, on the acting account's balance unless one is named (null names the platform). */
|
|
495
|
+
export declare function settleRefund(ctx: HandlerContext, refundId: string, amount: number, currency: string, account?: string | null | undefined): Promise<string>;
|
|
496
|
+
/** What an account had available in a currency at a moment: every entry of its payments balance whose funds had come
|
|
497
|
+
* due by then. */
|
|
498
|
+
export declare function availableAt(ctx: HandlerContext, account: string | undefined, currency: string, at: number): number;
|
|
499
|
+
/** The moments after `from` and up to `until` when funds of an account came due, in order: when a held refund can
|
|
500
|
+
* next be covered. */
|
|
501
|
+
export declare function fundsDueBetween(ctx: HandlerContext, account: string | undefined, currency: string, from: number, until: number): number[];
|
|
502
|
+
/** A dispute's debit, at once: the disputed amount and the dispute fee (the twin's 1500 cents, Stripe's US $15). */
|
|
503
|
+
export declare function settleDispute(ctx: HandlerContext, disputeId: string, amount: number, currency: string): Promise<string>;
|
|
504
|
+
/** A won dispute's credit, at once: the disputed amount returned (docs.stripe.com/disputes/how-disputes-work). Where the
|
|
505
|
+
* documentation stops and the twin decides: the dispute fee is not returned. */
|
|
506
|
+
export declare function settleDisputeWon(ctx: HandlerContext, disputeId: string, amount: number, currency: string): Promise<string>;
|
|
507
|
+
/** An account's ledger entries an automatic payout has not yet paid out: every entry on its payments balance that no
|
|
508
|
+
* automatic payout took (the automatic payouts' own debits excluded), as stored. */
|
|
509
|
+
export declare function unpaidEntries(ctx: HandlerContext, account: string | undefined): Row[];
|
|
510
|
+
/** An automatic payout's debit at `at`, and the entries it pays out marked with it, so the ledger lists them under
|
|
511
|
+
* the payout (docs.stripe.com/api/balance_transactions/list#balance_transaction_list-payout). */
|
|
512
|
+
export declare function settleAutomaticPayout(ctx: HandlerContext, payoutId: string, amount: number, currency: string, account: string | undefined, at: number, entries: Row[]): Promise<string>;
|
|
513
|
+
/** A payout's debit (negative) or a cancellation's or reversal's credit (positive), at once, on the payout's account. */
|
|
514
|
+
export declare function settlePayout(ctx: HandlerContext, payoutId: string, amount: number, currency: string, account?: string | null | undefined): Promise<string>;
|
|
515
|
+
/** A transfer's two entries: out of the platform's balance at once, into the destination's when `fromCharge` (its
|
|
516
|
+
* charge's funds' availability) comes (a plain transfer, with no `fromCharge`, moves funds available already).
|
|
517
|
+
* Answers the platform's entry. */
|
|
518
|
+
export declare function settleTransfer(ctx: HandlerContext, transferId: string, amount: number, currency: string, destination: string, fromCharge?: number, fromPending?: boolean): Promise<string>;
|
|
519
|
+
/** A transfer reversal's two entries: back into the platform's balance, out of the destination's. */
|
|
520
|
+
export declare function settleTransferReversal(ctx: HandlerContext, reversalId: string, amount: number, currency: string, destination: string): Promise<string>;
|
|
521
|
+
/** A direct charge's application fee: out of the connected account's balance, into the platform's. */
|
|
522
|
+
export declare function settleApplicationFee(ctx: HandlerContext, feeId: string, amount: number, currency: string, account: string): Promise<string>;
|
|
523
|
+
/** A top-up's credit, to the payments balance or, with `destination_balance=issuing`, to Issuing's
|
|
524
|
+
* (docs.stripe.com/issuing/funding/balance). Where the documentation stops and the twin decides: a test-mode top-up
|
|
525
|
+
* is available at once. */
|
|
526
|
+
export declare function settleTopup(ctx: HandlerContext, topupId: string, amount: number, currency: string, destination: string): Promise<string>;
|
|
527
|
+
/** Time's settlements, written: each entry on the acting account's balance whose funds came due by the World's clock
|
|
528
|
+
* moves pending → available (the clock's move the machine allows), so a settlement is recorded once. A read already
|
|
529
|
+
* sees it (asOf); the record is what lets Stripe's balance.available be sent once (./front.ts, the drain).
|
|
530
|
+
* Funds that were available at once and not yet sent are taken too, and marked sent. Answers the entries taken. */
|
|
531
|
+
export declare function settleDueEntries(ctx: HandlerContext, account?: string | undefined): Promise<Row[]>;
|
|
532
|
+
/** An account's balance, by currency: what the clock has made available, what is still pending, and Issuing's own. */
|
|
533
|
+
export declare function balanceOf(ctx: HandlerContext, account?: string | undefined): {
|
|
534
|
+
available: Map<string, number>;
|
|
535
|
+
pending: Map<string, number>;
|
|
536
|
+
issuing: Map<string, number>;
|
|
537
|
+
};
|
|
538
|
+
/** balance_insufficient when a payout or transfer would take more than the account has available in its currency. */
|
|
539
|
+
export declare function refusePayout(ctx: HandlerContext, amount: number, currency: string, account?: string | undefined): Response | undefined;
|
|
540
|
+
/** The ids of the ledger entries on the acting account's balance. */
|
|
541
|
+
export declare const mine: (ctx: HandlerContext) => Set<unknown>;
|
|
542
|
+
export declare const chargeMissing: (ctx: HandlerContext, id: string) => Response;
|
|
543
|
+
/** Every egress of a charge carries its refunds, derived from the refund rows in list order. */
|
|
544
|
+
export declare function chargeBody(ctx: HandlerContext, c: Row): Row;
|
|
545
|
+
/** A Charges-API charge a declining test card refuses: a 402 card_error naming the failed charge Stripe records for the
|
|
546
|
+
* attempt (docs.stripe.com/declines). */
|
|
547
|
+
export declare function declinedCharge(ctx: HandlerContext, decline: {
|
|
548
|
+
code: string;
|
|
549
|
+
decline_code?: string;
|
|
550
|
+
message: string;
|
|
551
|
+
}): Promise<Response>;
|
|
552
|
+
/** A charge's fraud report: "user_report … Assessments reported by you. If set, possible values of are `safe` and
|
|
553
|
+
* `fraudulent`" (docs.stripe.com/api/charges/object, fraud_details). */
|
|
554
|
+
export declare function fraudReport(ctx: HandlerContext, existing: Row, fd: Row): Row | Response;
|
|
555
|
+
/** A capture=false charge refunded while uncaptured: its authorization is released by the refund, as it would be
|
|
556
|
+
* "automatically refunded if uncaptured" (spec/openapi.json.gz, `capture_before`). The charge stays uncaptured and
|
|
557
|
+
* becomes refunded in full, a Refund records the release, and no money moves: none was ever received. Written as
|
|
558
|
+
* charge.refunded. Where the documentation stops and the twin decides: Stripe's basil change ("Partially capturing or
|
|
559
|
+
* canceling payments no longer creates a Refund", docs.stripe.com/changelog/basil/2025-03-31/remove-refund-from-partial-
|
|
560
|
+
* capture-and-payment-cancellation-flow) names partial capture and cancellation, not a refund asked for, so a refund
|
|
561
|
+
* still makes one; its reason is null and it has no balance transaction. Answers the Refund. */
|
|
562
|
+
export declare function releaseAuthorization(ctx: HandlerContext, ch: Row, operationId: string, given?: Row): Promise<Row>;
|
|
563
|
+
/** A PaymentIntent's authorization released by its cancel: "For PaymentIntents with a `status` of `requires_capture`, the
|
|
564
|
+
* remaining `amount_capturable` is automatically refunded" (docs.stripe.com/api/payment_intents/cancel), and since basil
|
|
565
|
+
* a cancellation makes no Refund: "`amount_captured` will be 0 instead of `nil` in payment cancellation flows",
|
|
566
|
+
* "`amount_refunded` will no longer be updated by these actions", "`refunded` will no longer be `true` for payment
|
|
567
|
+
* cancellation flows", and no charge.refunded is sent (docs.stripe.com/changelog/basil/2025-03-31/remove-refund-from-
|
|
568
|
+
* partial-capture-and-payment-cancellation-flow). The charge stays uncaptured; nothing is written as an event. */
|
|
569
|
+
export declare function cancelAuthorization(ctx: HandlerContext, ch: Row): Promise<Row>;
|
|
570
|
+
/** An authorized charge captured, by the charge's capture or its PaymentIntent's: what is captured credits the balance.
|
|
571
|
+
* Written as charge.captured, "Occurs whenever a previously uncaptured charge is captured" (docs.stripe.com/api/events/types).
|
|
572
|
+
* A partial capture releases the rest with no Refund and leaves amount_refunded and refunded as they were: "The following
|
|
573
|
+
* flows no longer result in a `Refund` object created and linked to the payment: Partial capture", "`amount_refunded`
|
|
574
|
+
* will no longer be updated by these actions", and "There will only be a single balance transaction for partial captures"
|
|
575
|
+
* (docs.stripe.com/changelog/basil/2025-03-31/remove-refund-from-partial-capture-and-payment-cancellation-flow).
|
|
576
|
+
* The caller has asked the machine whether it may capture. */
|
|
577
|
+
export declare function captureAuthorization(ctx: HandlerContext, ch: Row, toCapture: number, _operationId: string): Promise<Row>;
|
|
578
|
+
export declare const chargeRefund: (ctx: HandlerContext) => Row | Response;
|
|
579
|
+
export declare const subMissing: (ctx: HandlerContext, id: string) => Response;
|
|
580
|
+
/** A coupon that replaces the subscription's discount, or an empty one that clears it (docs.stripe.com/api/subscriptions/update#update_subscription-discounts). */
|
|
581
|
+
export declare function replacedDiscounts(ctx: HandlerContext, couponId: string, sub: Row): Row[] | Response;
|
|
582
|
+
/** A `trial_end` Stripe refuses: the parameter is `"now" | timestamp` (docs.stripe.com/api/subscriptions/update), and a
|
|
583
|
+
* timestamp that is not in the future answers "Invalid timestamp: must be an integer Unix timestamp in the future."
|
|
584
|
+
* (Stripe's own message, as its SDKs' users report it: github.com/stripe/stripe-dotnet/issues/805,
|
|
585
|
+
* github.com/stripe/stripe-ruby/issues/682). Where the documentation stops and the twin decides: a value that is no
|
|
586
|
+
* number at all, and one more than two years on, answer that same message. */
|
|
587
|
+
export declare function trialEndRefused(ctx: HandlerContext, value: unknown, now: number): Response | undefined;
|
|
588
|
+
export declare function invalidTrialEnd(ctx: HandlerContext): Response;
|
|
589
|
+
/** An update's `trial_end` on the subscription, into `fields`.
|
|
590
|
+
*
|
|
591
|
+
* `now` on a trialing subscription ends its trial at once: "The special value `now` can be provided to end the customer's
|
|
592
|
+
* trial immediately" (docs.stripe.com/api/subscriptions/update#update_subscription-trial_end; the trials guide's "To end a
|
|
593
|
+
* trial early … setting the `trial_end` value to … **now** to end immediately", docs.stripe.com/billing/subscriptions/
|
|
594
|
+
* trials/free-trials). The update resets the billing date and charges at once: "Switching prices does not normally change
|
|
595
|
+
* the billing date or generate an immediate charge unless … A trial starts or ends. In these cases, we … immediately
|
|
596
|
+
* charge the customer using the new price, and reset the billing date" (docs.stripe.com/api/subscriptions/update), and
|
|
597
|
+
* "Stripe immediately attempts payment when a subscription's billing cycle anchor is reset … When billing is performed
|
|
598
|
+
* immediately, but the required payment fails, the subscription change request succeeds and the subscription transitions
|
|
599
|
+
* to `past_due`" (docs.stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). So a new period starts now,
|
|
600
|
+
* its invoice is made (`invoice.created`) and charged to the subscription's default payment method, else the
|
|
601
|
+
* customer's (paid: `invoice.paid`, the subscription `active`; declined or none: the invoice open, `past_due`), and the
|
|
602
|
+
* subscription's own write sends `customer.subscription.updated`. `payment_behavior` (the same page): `error_if_incomplete`
|
|
603
|
+
* answers 402 and leaves the subscription as it was, `default_incomplete` leaves the invoice open without an attempt.
|
|
604
|
+
*
|
|
605
|
+
* A future timestamp moves the trial's end, and the period and billing anchor with it: "The `billing_cycle_anchor` will be
|
|
606
|
+
* updated to the `trial_end` value" (the same parameter); on a subscription out of its trial it starts a new one ("You can
|
|
607
|
+
* add a new trial on a non-trialing subscription by updating the subscription while specifying trial_end", and for
|
|
608
|
+
* classic billing mode "the `trial_start` field remains set to the start of the first trial", docs.stripe.com/billing/
|
|
609
|
+
* subscriptions/trials/free-trials).
|
|
610
|
+
*
|
|
611
|
+
* Where the documentation stops and the twin decides: the invoice's billing_reason is `subscription_update` ("A
|
|
612
|
+
* subscription was updated", docs.stripe.com/api/invoices/object#invoice_object-billing_reason); `now` on a subscription
|
|
613
|
+
* that is not trialing has no trial to end and changes nothing; the credit Stripe prorates for the unused time when a new
|
|
614
|
+
* trial starts mid-period is not made (as `proration_behavior=none` would have it); `pending_if_incomplete` answers as
|
|
615
|
+
* `allow_incomplete` (no pending update is modelled). Answers a refusal, or the invoice to collect once the subscription is written. */
|
|
616
|
+
export declare function applyTrialEnd(ctx: HandlerContext, sub: Row, fields: Row, now: number): Promise<{
|
|
617
|
+
invoice: string;
|
|
618
|
+
payer?: string;
|
|
619
|
+
attempt: boolean;
|
|
620
|
+
} | undefined>;
|
|
621
|
+
/** What ending the trial charges: the update's own default payment method, else the subscription's, else its customer's. */
|
|
622
|
+
export declare function trialPayer(ctx: HandlerContext, sub: Row): string | undefined;
|
|
623
|
+
/** What an update's `trial_end` refuses before anything is written: a new trial the machine does not allow from the
|
|
624
|
+
* subscription's status, or, under `error_if_incomplete`, ending a trial that cannot be paid at once ("If payment fails,
|
|
625
|
+
* return an HTTP `402` status code and don't update the subscription", docs.stripe.com/api/subscriptions/update). */
|
|
626
|
+
export declare function trialEndBlocked(ctx: HandlerContext, sub: Row, discounts: Row[] | undefined): Response | undefined;
|
|
627
|
+
/** A price named by id, or given as an object. */
|
|
628
|
+
export declare function priceRow(ctx: HandlerContext, price: unknown): Row | undefined;
|
|
629
|
+
/** One period of the subscription's items as an update's `items` would leave them, before any discount: an entry naming
|
|
630
|
+
* an item changes its price and quantity (a new price resets the quantity to 1 unless one is given) or deletes it, and
|
|
631
|
+
* one naming none adds an item (applyItemChanges). */
|
|
632
|
+
export declare function dueAfter(ctx: HandlerContext, sub: Row, entries: Row[]): number;
|
|
633
|
+
/** One entry of an update's `items` on the lines it would leave (dueAfter). */
|
|
634
|
+
export declare function entryAfter(ctx: HandlerContext, lines: Map<string, {
|
|
635
|
+
price: Row | undefined;
|
|
636
|
+
quantity: number;
|
|
637
|
+
}>, e: Row, i: number): void;
|
|
638
|
+
/** A new trial on a subscription whose status the machine does not let start one. */
|
|
639
|
+
export declare function newTrialRefused(ctx: HandlerContext, sub: Row): Response | undefined;
|
|
640
|
+
/** What ending the trial charges, judged before anything is written: the period of the items as this update leaves them
|
|
641
|
+
* (dueAfter) under the discount it leaves, and whether the payer pays it (an attempt made, a payer, no decline). */
|
|
642
|
+
export declare function trialEndCharge(ctx: HandlerContext, sub: Row, discounts: Row[] | undefined): {
|
|
643
|
+
due: number;
|
|
644
|
+
pays: boolean;
|
|
645
|
+
declined?: ReturnType<typeof declineFor>;
|
|
646
|
+
};
|
|
647
|
+
/** A new item named with neither `price` nor `price_data`: "One of `price` or `price_data` is required"
|
|
648
|
+
* (docs.stripe.com/api/subscriptions/update). */
|
|
649
|
+
export declare function noItemPrice(ctx: HandlerContext): Response;
|
|
650
|
+
/** A subscription asked to fail when its first invoice cannot be paid at once (payment_behavior=error_if_incomplete):
|
|
651
|
+
* the card's decline, or no payment method to charge (docs.stripe.com/api/subscriptions/create#create_subscription-payment_behavior). */
|
|
652
|
+
export declare function firstPaymentRefused(ctx: HandlerContext, declined: Parameters<typeof cardError>[0] | null | undefined): Response;
|
|
653
|
+
/** An update's `items`: "A list of up to 20 subscription items, each with an attached price"
|
|
654
|
+
* (docs.stripe.com/api/subscriptions/update): an entry naming an item's `id` changes that item (its price, quantity,
|
|
655
|
+
* metadata) or, with `deleted` ("A flag that, if set to `true`, will delete the specified item"), removes it; "If you
|
|
656
|
+
* omit `id`, the API adds a new subscription item rather than updating the existing one". Each takes `price` or
|
|
657
|
+
* `price_data`, "Data used to generate a new Price object inline. One of `price` or `price_data` is required", and
|
|
658
|
+
* "When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided". An
|
|
659
|
+
* inline price is made as the manage-prices guide says: "By default, prices created with `price_data` are effectively
|
|
660
|
+
* archived (they're marked as `active=false`)" (docs.stripe.com/products-prices/manage-prices).
|
|
661
|
+
* Where the documentation stops and the twin decides: the update is all or nothing, every entry checked before any is
|
|
662
|
+
* written (Stripe answers one error for the request); the refusals are worded by the twin. */
|
|
663
|
+
export declare function applyItemChanges(ctx: HandlerContext, subId: string, entries: Row[]): Promise<Response | undefined>;
|
|
664
|
+
/** The refusal of an update's `items`, checked entry by entry before any is written (applyItemChanges). */
|
|
665
|
+
export declare function itemChangesRefused(ctx: HandlerContext, subId: string, entries: Row[]): Response | undefined;
|
|
666
|
+
/** An update's checked `items`, written. */
|
|
667
|
+
export declare function writeItemChanges(ctx: HandlerContext, subId: string, entries: Row[]): Promise<undefined>;
|
|
668
|
+
/** A subscription item's `price_data` Stripe would refuse: its required `currency`, `product` (an existing one) and
|
|
669
|
+
* `recurring[interval]`, and "Only one of `unit_amount` and `unit_amount_decimal` can be set". */
|
|
670
|
+
export declare function refuseInlinePrice(ctx: HandlerContext, d: Row): Response | undefined;
|
|
671
|
+
/** The inline Price a `price_data` generates: recurring, archived (active=false). Answers its id. */
|
|
672
|
+
export declare function inlinePrice(ctx: HandlerContext, d: Row): Promise<string>;
|
|
673
|
+
/** A new subscription's items, each its own subscription_item as Stripe keeps it (/v1/subscription_items/{id}). */
|
|
674
|
+
export declare function storeItems(ctx: HandlerContext, subId: string, items: Row[]): Promise<void>;
|
|
675
|
+
export declare function syncItems(ctx: HandlerContext, subId: string): Promise<void>;
|
|
676
|
+
/** A subscription item with its billing period: its subscription's (basil moved the period onto the items). */
|
|
677
|
+
export declare const withPeriod: (ctx: HandlerContext, si: Row) => Row;
|
|
678
|
+
export declare const subscriptionsItemMissing: (ctx: HandlerContext, id: string) => Response;
|
|
679
|
+
export declare const listMissing: (ctx: HandlerContext, id: string, status?: number) => Response;
|
|
680
|
+
/** A value list's list_items, "List of items contained within this value list" (the served spec), kept in step with
|
|
681
|
+
* its items, at the address the fixture names (/v1/radar/value_list_items?value_list=…). */
|
|
682
|
+
export declare function radarSyncItems(ctx: HandlerContext, listId: string): Promise<void>;
|
|
683
|
+
/** A requested move of a state field the machine declares, legal or refused; a value the machine
|
|
684
|
+
* does not name is written as given, as the hand-written route did. */
|
|
685
|
+
export declare function requestedMove(ctx: HandlerContext, resource: string, operationId: string, current: unknown, values: string[]): Response | undefined;
|
|
686
|
+
/** An authorization as every egress carries it: its card embedded in full. */
|
|
687
|
+
export declare function withCard(ctx: HandlerContext, a: Row): Row;
|
|
688
|
+
export declare const authMissing: (ctx: HandlerContext, id: string) => Response;
|
|
689
|
+
/** A capture: an Issuing transaction (negative: it debits) and the issuing balance's debit. */
|
|
690
|
+
export declare function capture(ctx: HandlerContext, authId: string, auth: Row, amountCents: number): Promise<{
|
|
691
|
+
txnId: string;
|
|
692
|
+
btId: string;
|
|
693
|
+
}>;
|
|
694
|
+
/** Issuing refusals of a request no story sends: an unknown card status or authorization method, and a capture of an
|
|
695
|
+
* authorization that is not approved and pending. */
|
|
696
|
+
export declare function issuingRefusal(ctx: HandlerContext, what: 'card_status' | 'authorization_method' | 'not_capturable', auth?: Row): Response;
|
|
697
|
+
/** A partial approval's refusal: "You can specify the amount you want to approve by setting the amount in the webhook
|
|
698
|
+
* response body or the approve call" only "When an authorization is partially authorized, the is_amount_controllable
|
|
699
|
+
* field on the authorization request is set to true" (docs.stripe.com/issuing/purchases/authorizations), and never a
|
|
700
|
+
* credit. Answers the refusal, or undefined when the amount may be approved. */
|
|
701
|
+
export declare function partialApprovalRefused(ctx: HandlerContext, auth: Row): Response | undefined;
|
|
702
|
+
export declare function issuingDecide(approved: boolean): Handler;
|
|
703
|
+
/** Time's decision on a real-time request no one answered, caught up to the World's clock: once its window has ended,
|
|
704
|
+
* a pending authorization whose issuing_authorization.request went unanswered, and that no approve or decline decided,
|
|
705
|
+
* is decided automatically, its request_history reason webhook_timeout ("webhook_timeout for all other failure modes",
|
|
706
|
+
* the same page, beside webhook_error for a response Stripe cannot process).
|
|
707
|
+
* Where the documentation stops and the twin decides: the timeout setting is the Dashboard's, which the API does not
|
|
708
|
+
* answer, and the twin's is to decline; the window is measured in World time from the authorization's created. */
|
|
709
|
+
export declare function lapseRealtimeRequests(ctx: HandlerContext): Promise<void>;
|
|
710
|
+
/** An approval's hold: "If you approve the authorization, we deduct the `amount` from your Issuing balance and hold it
|
|
711
|
+
* in reserve until the authorization is either captured, voided, or expired without capture"
|
|
712
|
+
* (docs.stripe.com/issuing/purchases/authorizations). */
|
|
713
|
+
export declare function holdFor(ctx: HandlerContext, authId: string, amount: number, currency: string): Promise<Row>;
|
|
714
|
+
/** An authorization approved as it is presented, its amount held: approved and pending until the merchant captures. */
|
|
715
|
+
export declare function approvedAtOnce(ctx: HandlerContext, subject: Row, fields: Row, held: number, entry: Row): Promise<Response>;
|
|
716
|
+
/** An authorization as the platform's real-time answer makes it: approved (in part, only when the request was
|
|
717
|
+
* amount-controllable), declined, or declined for an answer Stripe cannot read (docs.stripe.com/issuing/controls/
|
|
718
|
+
* real-time-authorizations: the response's `approved` and `amount`; webhook_error "if we can't process your response"). */
|
|
719
|
+
export declare function answeredByEndpoint(ctx: HandlerContext, outcome: {
|
|
720
|
+
kind: 'approved';
|
|
721
|
+
amount?: number;
|
|
722
|
+
} | {
|
|
723
|
+
kind: 'declined';
|
|
724
|
+
} | {
|
|
725
|
+
kind: 'error';
|
|
726
|
+
message: string;
|
|
727
|
+
}, o: {
|
|
728
|
+
subject: Row;
|
|
729
|
+
fields: Row;
|
|
730
|
+
amount: number;
|
|
731
|
+
controllable: boolean;
|
|
732
|
+
entry: (e: {
|
|
733
|
+
amount: number;
|
|
734
|
+
approved: boolean;
|
|
735
|
+
reason: string;
|
|
736
|
+
reasonMessage: string | null;
|
|
737
|
+
}) => Row;
|
|
738
|
+
decline: (reason: string, message: string | null) => Promise<Response>;
|
|
739
|
+
}): Promise<Response>;
|
|
740
|
+
export declare const disputeMissing: (ctx: HandlerContext, id: string) => Response;
|
|
741
|
+
export declare const designMissing: (ctx: HandlerContext, id: string) => Response;
|
|
742
|
+
export declare function review(action: 'activate' | 'deactivate' | 'reject', operationId: string): Handler;
|
|
743
|
+
/**
|
|
744
|
+
* Create a refund and land it on its charge. An omitted amount is the whole remaining balance. The
|
|
745
|
+
* charge's write records `charge.refunded`, the event Stripe sends carrying the charge's new totals;
|
|
746
|
+
* `refunded` is true only at the full amount.
|
|
747
|
+
*/
|
|
748
|
+
/** A reason Stripe does not take (docs.stripe.com/api/refunds/create#create_refund-reason). */
|
|
749
|
+
export declare function badReason(ctx: HandlerContext): Response;
|
|
750
|
+
/** A bank-transfer payment refunded with origin=customer_balance goes back to the cash balance
|
|
751
|
+
* (docs.stripe.com/payments/customer-balance/refunding). */
|
|
752
|
+
export declare function backToCashBalance(ctx: HandlerContext, customer: string, currency: string, amount: number, refundId: string): Promise<void>;
|
|
753
|
+
/** A capture=false charge's refund, which releases its whole authorization (see the header). */
|
|
754
|
+
export declare function refundUncaptured(ctx: HandlerContext, charge: Row, amount: number, remaining: number, params: Row): Promise<Response>;
|
|
755
|
+
export declare function refundCharge(ctx: HandlerContext, charge: Row, params: Row): Promise<Response>;
|
|
756
|
+
/** Time's settling of held refunds, caught up to the World's clock: each refund held for want of balance, oldest first,
|
|
757
|
+
* is made at the first moment the account's available balance covers it (the funds that come due then), its debit
|
|
758
|
+
* written then, as `refund.updated`. Where the documentation stops and the twin decides: a held refund is made the
|
|
759
|
+
* moment the balance covers it. */
|
|
760
|
+
export declare function settleHeldRefunds(ctx: HandlerContext): Promise<void>;
|
|
761
|
+
/** The charge a refund aims at: named directly, or reached through its PaymentIntent. */
|
|
762
|
+
export declare function target(ctx: HandlerContext): Row | Response;
|
|
763
|
+
export declare const refundMissing: (ctx: HandlerContext, id: string) => Response;
|
|
764
|
+
/** Each advancing clock whose advance has taken its time reaches its target, caught up before anything is answered:
|
|
765
|
+
* its frozen_time moves, it is ready, and its customers' trials and periods that ended by then end
|
|
766
|
+
* (./renewals.ts advanceBilling). The advance's own write is when it began (the kernel's updatedAt). */
|
|
767
|
+
export declare function finishClockAdvances(ctx: HandlerContext): Promise<void>;
|
|
768
|
+
/** What the platform saved, or the settings a new platform starts with (OAuth off, no redirect URI). */
|
|
769
|
+
export declare function connectOAuthSettings(ctx: Pick<HandlerContext, 'rowsRaw'>): ConnectOAuthSettings;
|
|
770
|
+
export declare const accountMissing: (ctx: HandlerContext, id: string, status?: number) => Response;
|
|
771
|
+
/** The account, tombstones included where the hand-written routes looked past a deletion. */
|
|
772
|
+
export declare const accountRow: (ctx: HandlerContext, id: string) => Row | undefined;
|
|
773
|
+
/** Stripe's review of a Custom account once the platform gives it something: with nothing left due, its requested
|
|
774
|
+
* capabilities become active and it can take charges and receive payouts; with something due again (its bank account
|
|
775
|
+
* removed), they stop. Where the documentation stops and the twin decides: test-mode verification is immediate, and
|
|
776
|
+
* it owes what customRequirements lists. An Express or Standard account is onboarded on Stripe's own pages. */
|
|
777
|
+
export declare function connectReview(ctx: HandlerContext, id: string): Promise<void>;
|
|
778
|
+
/** The review of a Custom account (see review). */
|
|
779
|
+
export declare function reviewCustom(ctx: HandlerContext, id: string, account: Row): Promise<void>;
|
|
780
|
+
export declare const personMissing: (ctx: HandlerContext) => Response;
|
|
781
|
+
export declare const accountPerson: (ctx: HandlerContext) => Row | undefined;
|
|
782
|
+
export declare const externalMissing: (ctx: HandlerContext) => Response;
|
|
783
|
+
export declare const accountExternal: (ctx: HandlerContext) => Row | undefined;
|
|
784
|
+
/** Whether the platform may create, update or delete an account's external accounts: "A platform can create, update, or
|
|
785
|
+
* delete external accounts only for connected accounts without access to either the full Stripe or Express Dashboard
|
|
786
|
+
* and where the platform is responsible for negative balances" (docs.stripe.com/connect/payouts-bank-accounts); it can
|
|
787
|
+
* still view an Express account's ("A platform can view the external accounts of connected accounts that don’t have
|
|
788
|
+
* access to the full Stripe Dashboard"). Where the documentation stops and the twin decides: the refusal. Stripe's
|
|
789
|
+
* pages give no error code for it; the twin answers 403, which the errors page gives as "The API key doesn’t have
|
|
790
|
+
* permissions to perform the request" (docs.stripe.com/api/errors), with the twin's own wording. The create page says
|
|
791
|
+
* it too: "You can only specify connected accounts where account.controller.requirement_collection is `application`"
|
|
792
|
+
* (docs.stripe.com/api/external_account_bank_accounts/create). */
|
|
793
|
+
export declare function refuseExternalWrite(ctx: HandlerContext, account: string): Response | undefined;
|
|
794
|
+
/** Update and delete by id, finding tombstones as the hand-written routes did, with Stripe's own operation names. */
|
|
795
|
+
export declare function patch(resource: string, param: string, missing: string, op: string): Handler;
|
|
796
|
+
export declare function patchRow(ctx: HandlerContext, resource: string, param: string, missing: string, op: string): Promise<Response>;
|
|
797
|
+
export declare const updateReader: Handler;
|
|
798
|
+
export declare function remove(resource: string, param: string, missing: string, op: string, object: string): Handler;
|
|
799
|
+
export declare const readerMissing: (ctx: HandlerContext, id: string) => Response;
|
|
800
|
+
/** A card presented to a reader with no payment in progress. */
|
|
801
|
+
export declare function nothingToPresent(ctx: HandlerContext): Response;
|
|
802
|
+
/** Under manual capture the presented card only holds the amount (docs.stripe.com/terminal/payments/collect-card-payment#capture-payment):
|
|
803
|
+
* the hold is an uncaptured charge, as an online authorization's is (authorizeCharge), which the intent's capture takes. */
|
|
804
|
+
export declare function holdForCapture(ctx: HandlerContext, piId: string, pi: Record<string, unknown>, pm: string, amount: number): Promise<void>;
|
|
805
|
+
/** Time's settling of top-ups, caught up to the World's clock: a pending top-up succeeds on its expected_availability_date,
|
|
806
|
+
* its funds entered then in the balance it names. */
|
|
807
|
+
export declare function settleTopups(ctx: HandlerContext): Promise<void>;
|
|
808
|
+
export declare const disputesDisputeMissing: (ctx: HandlerContext, id: string) => Response;
|
|
809
|
+
/** Evidence staged without submitting it (submit=false), or on a dispute already under review or decided. */
|
|
810
|
+
export declare function keepEvidence(ctx: HandlerContext, id: string, fields: Row): Promise<Response>;
|
|
811
|
+
export declare const meterMissing: (ctx: HandlerContext, id: string) => Response;
|
|
812
|
+
export declare function activation(kind: 'deactivate' | 'reactivate'): Handler;
|
|
813
|
+
export declare const grantMissing: (ctx: HandlerContext, id: string) => Response;
|
|
814
|
+
export declare function endGrant(kind: 'expire' | 'void'): Handler;
|
|
815
|
+
export declare function alertMove(kind: 'activate' | 'deactivate' | 'archive', operationId: string): Handler;
|
|
816
|
+
export declare const transferMissing: (ctx: HandlerContext, id: string) => Response;
|
|
817
|
+
/** A transfer to an account whose transfers capability is not active. */
|
|
818
|
+
export declare function transfersInactive(ctx: HandlerContext): Response;
|
|
819
|
+
/** A transfer from a charge whose funds have settled: "With a source_transaction, the transfer request returns success
|
|
820
|
+
* regardless of your available balance if the related charge hasn't settled yet" (docs.stripe.com/connect/separate-
|
|
821
|
+
* charges-and-transfers), so a settled one comes out of the available balance. */
|
|
822
|
+
export declare function settledSourceRefused(ctx: HandlerContext, amount: number, currency: string): Response | undefined;
|
|
823
|
+
/** An application fee refunded to its whole through its own refunds endpoint: the fee machine's move, or its refusal. */
|
|
824
|
+
export declare function feeFullyRefunded(ctx: HandlerContext, resource: string, flag: string, id: string): Response | undefined;
|
|
825
|
+
/** Take `amount` (the remainder by default) back out of a parent's total, as a child row appended to its list. */
|
|
826
|
+
export declare function giveBack(ctx: HandlerContext, o: {
|
|
827
|
+
parent: Row;
|
|
828
|
+
parentResource: string;
|
|
829
|
+
child: string;
|
|
830
|
+
childFields: (amount: number) => Row;
|
|
831
|
+
childDefaults: Row;
|
|
832
|
+
doneField: string;
|
|
833
|
+
flag: string;
|
|
834
|
+
listUrl: string;
|
|
835
|
+
op: string;
|
|
836
|
+
tooLarge: (remaining: number) => string;
|
|
837
|
+
/** what the money movement itself writes, once the child exists */
|
|
838
|
+
settle?: (child: Row, amount: number) => Promise<void>;
|
|
839
|
+
}): Promise<Response>;
|
|
840
|
+
export declare const feeMissing: (ctx: HandlerContext, id: string) => Response;
|
|
841
|
+
/** An earlier version's payment_method_types refused: the first value that names no payment method type the
|
|
842
|
+
* operation takes, in the intent's words or (a Checkout Session) the enum's. */
|
|
843
|
+
export declare function unknownMethodType(ctx: HandlerContext, opId: string, given: unknown): Response | undefined;
|
|
844
|
+
/** payment_method_types refused where the caller's version removed it. */
|
|
845
|
+
export declare const noLongerSupported: (ctx: HandlerContext, version: string) => Response;
|
|
846
|
+
/** Stripe's refusal of a request whose top-level parameters the operation does not take, or undefined. */
|
|
847
|
+
export declare function refuseParameters(ctx: HandlerContext): Response | undefined;
|
|
848
|
+
/** A file's links, kept in step with the links made to it, at the address Stripe lists them
|
|
849
|
+
* (/v1/file_links?file=…, the File object's example). */
|
|
850
|
+
export declare function syncLinks(ctx: HandlerContext, fileId: string): Promise<void>;
|
|
851
|
+
export declare const calcMissing: (ctx: HandlerContext, id: string) => Response;
|
|
852
|
+
/** A page of the line items a stored object carries. */
|
|
853
|
+
export declare function taxLinePage(ctx: HandlerContext, holder: Row): Response;
|
|
854
|
+
export declare const txMissing: (ctx: HandlerContext, id: string, status?: number) => Response;
|
|
855
|
+
/** An answer in the shape of the API version the caller is served (./version.ts), a webhook endpoint's `secret` shown
|
|
856
|
+
* only at its creation ("Only returned at creation", docs.stripe.com/api/webhook_endpoints/object). */
|
|
857
|
+
export declare function rendered(request: Request, res: Response): Promise<Response>;
|