@volter/twin-stripe 2.0.38 → 3.0.1
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 +112 -207
- package/dist/generated/pack-facts.json +94 -0
- package/dist/journeys/coverage.json +596 -0
- package/dist/journeys/customer-life.json +6108 -0
- package/dist/journeys/customer-life.outline.md +371 -0
- package/dist/journeys/decisions.json +677 -0
- package/dist/journeys/demand.json +706 -0
- package/dist/journeys/score.json +853 -0
- package/dist/journeys/unreachable.json +102 -0
- package/dist/journeys/vendor-examples.json +8010 -0
- package/dist/spec/SOURCE.md +18 -0
- package/dist/spec/doc-examples.json +445 -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 +306 -0
- package/dist/src/cli.d.ts +0 -1
- package/dist/src/cli.js +11 -31
- package/dist/src/engine/after-payment.d.ts +8 -0
- package/dist/src/engine/after-payment.js +27 -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/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 +34 -0
- package/dist/src/engine/connect.d.ts +45 -0
- package/dist/src/engine/connect.js +108 -0
- package/dist/src/engine/customers.d.ts +4 -0
- package/dist/src/engine/customers.js +8 -0
- package/dist/src/engine/display.d.ts +11 -0
- package/dist/src/engine/display.js +13 -0
- package/dist/src/engine/files.d.ts +11 -0
- package/dist/src/engine/files.js +23 -0
- package/dist/src/engine/invoices.d.ts +21 -0
- package/dist/src/engine/invoices.js +84 -0
- package/dist/src/engine/issuing.d.ts +33 -0
- package/dist/src/engine/issuing.js +54 -0
- package/dist/src/engine/ledger.d.ts +8 -0
- package/dist/src/engine/ledger.js +8 -0
- package/dist/src/engine/oauth.d.ts +4 -0
- package/dist/src/engine/oauth.js +24 -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-methods.d.ts +16 -0
- package/dist/src/engine/payment-methods.js +22 -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 +3 -0
- package/dist/src/engine/renewals.d.ts +36 -0
- package/dist/src/engine/renewals.js +65 -0
- package/dist/src/{stripe-twin.d.ts → engine/stripe.d.ts} +12 -45
- package/dist/src/{stripe-twin.js → engine/stripe.js} +53 -387
- package/dist/src/engine/subscriptions.d.ts +11 -0
- package/dist/src/engine/subscriptions.js +30 -0
- package/dist/src/engine/transfers.d.ts +2 -0
- package/dist/src/engine/transfers.js +1 -0
- package/dist/src/{stripe-version.d.ts → engine/version.d.ts} +0 -2
- package/dist/src/{stripe-version.js → engine/version.js} +21 -9
- 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 +10 -75
- package/dist/src/manifest.js +478 -876
- package/dist/src/screens/billing-portal.d.ts +3 -0
- package/dist/src/screens/{portal.js → billing-portal.js} +32 -58
- package/dist/src/screens/checkout-js.d.ts +2 -0
- package/dist/src/screens/checkout-js.js +84 -0
- package/dist/src/screens/checkout.d.ts +2 -31
- package/dist/src/screens/checkout.js +32 -121
- package/dist/src/screens/connect-onboarding.d.ts +3 -0
- package/dist/src/screens/{onboarding.js → connect-onboarding.js} +38 -104
- package/dist/src/screens/dashboard.d.ts +3 -0
- package/dist/src/screens/dashboard.js +116 -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 +95 -0
- package/dist/src/semantics/account.d.ts +2 -0
- package/dist/src/semantics/account.js +8 -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 +40 -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 +13 -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 +4 -0
- package/dist/src/semantics/billing_portal.js +36 -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 +21 -271
- package/dist/src/semantics/clock.d.ts +2 -0
- package/dist/src/semantics/clock.js +15 -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 +5 -6
- package/dist/src/semantics/customers.js +47 -413
- package/dist/src/semantics/doors.d.ts +23 -0
- package/dist/src/semantics/doors.js +73 -0
- package/dist/src/semantics/entitlements.d.ts +0 -2
- package/dist/src/semantics/entitlements.js +4 -95
- package/dist/src/semantics/events.d.ts +11 -0
- package/dist/src/semantics/events.js +31 -0
- package/dist/src/semantics/index.d.ts +2 -0
- package/dist/src/semantics/index.js +85 -0
- package/dist/src/semantics/invoice_payments.d.ts +2 -0
- package/dist/src/semantics/invoice_payments.js +12 -0
- package/dist/src/semantics/invoices.d.ts +11 -18
- package/dist/src/semantics/invoices.js +121 -440
- package/dist/src/semantics/issuing.d.ts +6 -13
- package/dist/src/semantics/issuing.js +58 -556
- package/dist/src/semantics/payment_intents.d.ts +3 -0
- package/dist/src/semantics/payment_intents.js +71 -0
- package/dist/src/semantics/payment_methods.d.ts +3 -0
- package/dist/src/semantics/payment_methods.js +15 -0
- package/dist/src/semantics/payouts.d.ts +3 -0
- package/dist/src/semantics/payouts.js +28 -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 +4 -2
- package/dist/src/semantics/products.js +12 -138
- 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 +2 -9
- package/dist/src/semantics/refunds.js +3 -193
- package/dist/src/semantics/shared.d.ts +558 -55
- package/dist/src/semantics/shared.js +2070 -114
- package/dist/src/semantics/states.d.ts +462 -0
- package/dist/src/semantics/states.js +634 -0
- package/dist/src/semantics/subscriptions.d.ts +6 -11
- package/dist/src/semantics/subscriptions.js +37 -530
- package/dist/src/semantics/test_helpers.d.ts +3 -0
- package/dist/src/semantics/test_helpers.js +125 -0
- package/dist/src/semantics/transfers.d.ts +2 -2
- package/dist/src/semantics/transfers.js +6 -101
- package/dist/src/semantics/webhook_endpoints.d.ts +2 -0
- package/dist/src/semantics/webhook_endpoints.js +26 -0
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.js +7 -0
- package/generated/pack-facts.json +94 -0
- package/journeys/coverage.json +596 -0
- package/journeys/customer-life.json +6108 -0
- package/journeys/customer-life.outline.md +371 -0
- package/journeys/decisions.json +677 -0
- package/journeys/demand.json +706 -0
- package/journeys/score.json +853 -0
- package/journeys/unreachable.json +102 -0
- package/journeys/vendor-examples.json +8010 -0
- package/package.json +11 -20
- package/spec/SOURCE.md +18 -0
- package/spec/doc-examples.json +445 -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 +306 -0
- package/src/cli.ts +11 -28
- package/src/engine/after-payment.ts +29 -0
- package/src/engine/apps-secrets.ts +4 -0
- package/src/engine/balance.ts +32 -0
- package/src/engine/checkout.ts +39 -0
- package/src/engine/common.ts +49 -0
- package/src/engine/connect.ts +106 -0
- package/src/engine/customers.ts +10 -0
- package/src/engine/display.ts +18 -0
- package/src/engine/files.ts +28 -0
- package/src/engine/invoices.ts +102 -0
- package/src/engine/issuing.ts +66 -0
- package/src/engine/ledger.ts +48 -0
- package/src/engine/oauth.ts +18 -0
- package/src/engine/onboarding.ts +53 -0
- package/src/{stripe-params.ts → engine/params.ts} +7 -56
- package/src/engine/payment-intents.ts +32 -0
- package/src/engine/payment-methods.ts +24 -0
- package/src/engine/radar.ts +6 -0
- package/src/engine/refunds.ts +3 -0
- package/src/engine/renewals.ts +72 -0
- package/src/{stripe-twin.ts → engine/stripe.ts} +57 -400
- package/src/engine/subscriptions.ts +37 -0
- package/src/engine/transfers.ts +22 -0
- package/src/{stripe-version.ts → engine/version.ts} +19 -10
- package/src/engine/webhook-endpoints.ts +14 -0
- package/src/engine/webhooks.ts +70 -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 +10 -116
- package/src/manifest.ts +480 -904
- package/src/screens/{portal.tsx → billing-portal.tsx} +35 -42
- package/src/screens/checkout-js.ts +80 -0
- package/src/screens/checkout.tsx +32 -96
- package/src/screens/{onboarding.tsx → connect-onboarding.tsx} +39 -85
- package/src/screens/dashboard.tsx +178 -0
- package/src/screens/shared.tsx +84 -0
- package/src/screens/stripe-js.ts +102 -0
- package/src/semantics/account.ts +10 -0
- package/src/semantics/account_links.ts +20 -0
- package/src/semantics/accounts.ts +44 -0
- package/src/semantics/{apps-secrets.ts → apps.ts} +17 -33
- package/src/semantics/around.ts +17 -0
- package/src/semantics/balance.ts +6 -208
- package/src/semantics/balance_transactions.ts +18 -0
- package/src/semantics/billing_portal.ts +45 -0
- package/src/semantics/charges.ts +8 -212
- package/src/semantics/checkout.ts +25 -276
- package/src/semantics/clock.ts +19 -0
- package/src/semantics/coupons.ts +5 -68
- package/src/semantics/customers.ts +48 -414
- package/src/semantics/doors.ts +79 -0
- package/src/semantics/entitlements.ts +3 -94
- package/src/semantics/events.ts +37 -0
- package/src/semantics/index.ts +89 -0
- package/src/semantics/invoice_payments.ts +16 -0
- package/src/semantics/invoices.ts +112 -441
- package/src/semantics/issuing.ts +57 -573
- package/src/semantics/payment_intents.ts +76 -0
- package/src/semantics/payment_methods.ts +20 -0
- package/src/semantics/payouts.ts +29 -0
- package/src/semantics/prices.ts +41 -0
- package/src/semantics/products.ts +12 -146
- package/src/semantics/promotion_codes.ts +38 -0
- package/src/semantics/radar.ts +8 -79
- package/src/semantics/refunds.ts +4 -216
- package/src/semantics/shared.ts +2089 -135
- package/src/semantics/states.ts +662 -0
- package/src/semantics/subscriptions.ts +39 -542
- package/src/semantics/test_helpers.ts +119 -0
- package/src/semantics/transfers.ts +10 -132
- package/src/semantics/webhook_endpoints.ts +27 -0
- package/src/server.ts +7 -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-oauth.d.ts +0 -27
- package/dist/src/screens/connect-oauth.js +0 -414
- package/dist/src/screens/connect-settings.d.ts +0 -22
- 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/disputes.d.ts +0 -2
- package/dist/src/semantics/disputes.js +0 -51
- 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/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/setup-intents.js +0 -84
- 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/test-clocks.js +0 -73
- 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-oauth.tsx +0 -400
- 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/disputes.ts +0 -62
- package/src/semantics/ephemeral-keys.ts +0 -34
- package/src/semantics/files.ts +0 -143
- 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/test-clocks.ts +0 -77
- 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/src/{screens → engine}/industries.ts +0 -0
- /package/src/{semantics → engine}/test-cards.ts +0 -0
|
@@ -1,82 +1,585 @@
|
|
|
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, 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
|
+
/** Stripe's events: `Stripe-Signature: t=…,v1=…` over `${t}.${body}` keyed by the endpoint's secret
|
|
8
|
+
* (docs.stripe.com/webhooks#verify-manually); the Event object (docs.stripe.com/api/events/object) kept as the account's
|
|
9
|
+
* own (`GET /v1/events`), whether or not an endpoint takes it; an endpoint live while `enabled`, taking the types its
|
|
10
|
+
* `enabled_events` names (`*` all, `<family>.*` a family), and a Connect endpoint (`connect: true`) its connected
|
|
11
|
+
* accounts' events ("Connected accounts" scope, docs.stripe.com/connect/webhooks), any other the account's own. */
|
|
12
|
+
export declare const STRIPE_EVENTS: EventsDecl;
|
|
13
|
+
/** A customer's now: its test clock's frozen time when it is on one (docs.stripe.com/billing/testing/test-clocks), the
|
|
14
|
+
* World's otherwise. */
|
|
15
|
+
export declare function clockNow(ctx: HandlerContext, customer: unknown): number;
|
|
16
|
+
/** What a subscription's invoices charge: its own default payment method, else its customer's. */
|
|
17
|
+
export declare function payerOf(ctx: HandlerContext, sub: Row): string | undefined;
|
|
18
|
+
/** The customer's default for invoices, charged when the subscription names none of its own. */
|
|
19
|
+
export declare function customerDefault(ctx: HandlerContext, sub: Row): string | undefined;
|
|
20
|
+
/** A subscription whose invoice has just been finalized: the `once` coupon that invoice took is spent, and a once coupon
|
|
21
|
+
* it did not take (added after it was drafted) stays for the next (unspentDiscounts). */
|
|
22
|
+
export declare function spendOnceCoupon(ctx: HandlerContext, invoice: Row): Promise<void>;
|
|
23
|
+
/** A draft invoice for one period of a subscription, its lines the subscription's items and any one-time lines `once`
|
|
24
|
+
* gives it (a Checkout session's one-time prices, "on the initial invoice only", docs.stripe.com/api/checkout/sessions/
|
|
25
|
+
* create#create_checkout_session-line_items), under the subscription's discount. Answers the invoice id. */
|
|
26
|
+
export declare function draftSubscriptionInvoice(ctx: HandlerContext, sub: Row, o: {
|
|
27
|
+
start: number;
|
|
28
|
+
end: number;
|
|
29
|
+
reason: 'subscription_create' | 'subscription_cycle' | 'subscription_update';
|
|
30
|
+
trial?: boolean;
|
|
31
|
+
once?: Row[];
|
|
32
|
+
id?: string;
|
|
33
|
+
}): Promise<string>;
|
|
34
|
+
/** Finalize a subscription's draft invoice at `at` and charge what its subscription pays with. The move is time's (a
|
|
35
|
+
* renewal), the customer's (the Checkout page they paid on) or the API's (an update that ends a trial, which names the
|
|
36
|
+
* payer, may ask for no attempt, and moves the subscription itself: semantics/subscriptions.ts applyTrialEnd). Answers
|
|
37
|
+
* whether it was paid. */
|
|
38
|
+
export declare function collectSubscriptionInvoice(ctx: HandlerContext, invoiceId: string, at: number, actor: 'time' | 'external' | 'api', opts?: {
|
|
39
|
+
payer?: string;
|
|
40
|
+
attempt?: boolean;
|
|
41
|
+
}): Promise<boolean>;
|
|
42
|
+
/** Pay a subscription's open invoice with `paymentMethod` (the customer on the portal, `external`): the charge on the
|
|
43
|
+
* invoice's PaymentIntent, the invoice paid, a past_due subscription active. Answers the decline, if the card is refused. */
|
|
44
|
+
export declare function payOpenInvoice(ctx: HandlerContext, invoiceId: string, paymentMethod: string): Promise<{
|
|
45
|
+
code: string;
|
|
46
|
+
message: string;
|
|
47
|
+
} | undefined>;
|
|
48
|
+
/** Time's moves on subscriptions, caught up to each customer's clock in the order they fell due, each made at the
|
|
49
|
+
* moment it was due: a period that ended renews (a trial's end among them) or, set to cancel, cancels; a renewal
|
|
50
|
+
* drafted an hour or more ago is finalized and charged. */
|
|
51
|
+
export declare function advanceBilling(ctx: HandlerContext, only?: (sub: Row) => boolean): Promise<void>;
|
|
52
|
+
/** The earliest move that has come due, made at its moment; false when none has. */
|
|
53
|
+
export declare function billingStep(ctx: HandlerContext, at: (t: number) => Promise<HandlerContext>, only?: (sub: Row) => boolean): Promise<boolean>;
|
|
54
|
+
export declare const account: (ctx: HandlerContext) => string | undefined;
|
|
55
|
+
/** The acting account's Balance object (docs.stripe.com/api/balance/balance_object). */
|
|
56
|
+
export declare function balanceBody(ctx: HandlerContext, acct?: string | undefined): Row;
|
|
57
|
+
/** Time's arrivals, written: each of the acting account's payouts whose arrival date has come moves pending → paid
|
|
58
|
+
* (the clock's move, as asOf reads it), written as `payout.paid`, the event Stripe sends for it. Answers their ids. */
|
|
59
|
+
export declare function payDuePayouts(ctx: HandlerContext, acct?: string | undefined): Promise<string[]>;
|
|
60
|
+
/** Where a connected account's payout goes: "ID of the bank account or card the payout is sent to" (served spec,
|
|
61
|
+
* payout.destination), its default external account for the currency, "When multiple accounts are available for a given
|
|
62
|
+
* currency, Stripe uses the one set as `default_for_currency`" (docs.stripe.com/connect/payouts-bank-accounts), the
|
|
63
|
+
* newest such. Where the documentation stops and the twin decides: the platform's own bank account is not modelled, so
|
|
64
|
+
* its payouts name none. */
|
|
65
|
+
export declare function payoutBank(ctx: HandlerContext, account: string, currency: string): string | null;
|
|
66
|
+
export declare const payoutDefaults: (ctx: HandlerContext) => Row;
|
|
67
|
+
/** A payout as the clock reads it: paid once its arrival date has come, the clock's move, asked of the
|
|
68
|
+
* machine as a write asks it. */
|
|
69
|
+
export declare function asOf(ctx: HandlerContext, p: Row): Row;
|
|
70
|
+
/** A connected account's payout in a currency none of its bank accounts takes. */
|
|
71
|
+
export declare function noExternalAccount(ctx: HandlerContext, currency: string): Response;
|
|
72
|
+
/** Time's payouts, caught up to the World's clock: each account on an automatic schedule is paid out, on each of its
|
|
73
|
+
* scheduled days that has come, what became available by then. */
|
|
74
|
+
export declare function advancePayouts(ctx: HandlerContext): Promise<void>;
|
|
75
|
+
/** What Stripe does after a card succeeds: from a raw number, a test name (pm_card_* or tok_*), or a stored
|
|
76
|
+
* PaymentMethod that recorded it when it was made. */
|
|
77
|
+
export declare function afterSuccessOf(ctx: HandlerContext, ref: unknown): Outcome | undefined;
|
|
78
|
+
/** Stripe's acts on a charge that just succeeded: a dispute or a review its card brings, and the platform's fee. */
|
|
79
|
+
export declare function afterCharge(ctx: HandlerContext, chargeId: string, charge: {
|
|
80
|
+
amount: number;
|
|
81
|
+
currency: string;
|
|
82
|
+
payment_intent?: string | undefined;
|
|
83
|
+
application_fee_amount?: unknown;
|
|
84
|
+
destination?: unknown;
|
|
85
|
+
}, ref: unknown): Promise<void>;
|
|
86
|
+
/** Radar places an elevated-risk card's charge in review (docs.stripe.com/radar/reviews). */
|
|
87
|
+
export declare function openReview(ctx: HandlerContext, chargeId: string, pi: {
|
|
88
|
+
payment_intent: string | null;
|
|
89
|
+
}): Promise<void>;
|
|
90
|
+
export declare const customerMissing: (ctx: HandlerContext, id: string) => Response;
|
|
91
|
+
/** The request event asked of the endpoint, signed with its secret and rendered in the event's API version, and its
|
|
92
|
+
* answer read as the decision. */
|
|
93
|
+
export declare function askForAuthorization(ctx: HandlerContext, url: string, event: Record<string, unknown>, secret: string): Promise<StripeAuthRequestOutcome>;
|
|
94
|
+
/** Stripe's refusal of a call a publishable key may not make, or undefined when the key may make it. */
|
|
95
|
+
export declare function publishableKeyRefused(ctx: HandlerContext): Response | undefined;
|
|
96
|
+
/** The platform's own keys, as the dashboard's API keys page makes them (the `appCredentials` door): a secret key and a
|
|
97
|
+
* publishable key, held by their SHA-256. A request with no key is refused, as is a platform key Stripe never issued
|
|
98
|
+
* ("Invalid API Key provided"). */
|
|
99
|
+
export declare function platformKeyRefused(ctx: HandlerContext, request: Request): Response | undefined;
|
|
100
|
+
export declare function withMetadata(ctx: HandlerContext, request: Request): Request;
|
|
101
|
+
export declare function scopeKeyOf(ctx: HandlerContext): string;
|
|
102
|
+
export declare const named: (ctx: HandlerContext, name: string) => Row | undefined;
|
|
103
|
+
export declare const invoiceMissing: (ctx: HandlerContext, id: string) => Response;
|
|
104
|
+
/** Paying an invoice with nothing to pay it: "If not set, defaults to the subscription's default payment method, if any,
|
|
105
|
+
* or to the default payment method in the customer's invoice settings" (docs.stripe.com/api/invoices/object,
|
|
106
|
+
* default_payment_method), and none of them is set. */
|
|
107
|
+
export declare function nothingToPayWith(ctx: HandlerContext): Response;
|
|
108
|
+
/** A subscription waiting on the invoice paid through the invoice's own pay (incomplete on its first, past_due on a
|
|
109
|
+
* failed renewal) is active again. */
|
|
110
|
+
export declare function activatedByPayment(ctx: HandlerContext, subId: string): Promise<void>;
|
|
111
|
+
/** The invoice the path names, and the machine's refusal when this operation may not move it. */
|
|
112
|
+
export declare function invoicesLoad(ctx: HandlerContext, operationId: string): {
|
|
113
|
+
inv: Row;
|
|
114
|
+
} | {
|
|
115
|
+
answer: Response;
|
|
116
|
+
};
|
|
117
|
+
/** A draft finalized on its way to being paid: numbered, open, its PaymentIntent opened (PostInvoicesInvoiceFinalize). */
|
|
118
|
+
export declare function finalizeForPayment(ctx: HandlerContext, inv: Row, id: string): Promise<Row>;
|
|
119
|
+
/** The PaymentIntent a charge_automatically invoice with a balance gets when it is finalized; it
|
|
120
|
+
* waits for confirmation when the invoice already names a default payment method. */
|
|
121
|
+
export declare function openPaymentIntent(ctx: HandlerContext, piId: string, inv: Row, invoiceId: string): Promise<void>;
|
|
122
|
+
export declare function finalizedFields(ctx: HandlerContext, inv: Row, now: number): Row;
|
|
123
|
+
/** A coupon for a fixed amount off, in its currency (docs.stripe.com/api/coupons/create#create_coupon-amount_off). */
|
|
124
|
+
export declare function amountOffOf(ctx: HandlerContext, params: Record<string, unknown>): number | Response;
|
|
125
|
+
/** Time's lapsing of coupons, caught up to the World's clock: a valid coupon whose redeem_by has passed is no longer
|
|
126
|
+
* valid from that moment (manifest.ts). Where the documentation stops and the twin decides: the lapse sends no event
|
|
127
|
+
* (the events page names none for it). */
|
|
128
|
+
export declare function lapseCoupons(ctx: HandlerContext): Promise<void>;
|
|
129
|
+
export declare const sessionMissing: (ctx: HandlerContext, id: string) => Response;
|
|
130
|
+
/** The discount a session is created with (discounts[0][promotion_code] or [coupon]), or Stripe's refusal: an unknown
|
|
131
|
+
* code or coupon, and one that has expired or been deactivated, are refused at create
|
|
132
|
+
* (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-discounts, docs.stripe.com/error-codes#coupon-expired).
|
|
133
|
+
* Where the documentation stops and the twin decides: the refusals' wording. */
|
|
134
|
+
export declare function discountOf(ctx: HandlerContext, params: Row, now: number): {
|
|
135
|
+
coupon: Row;
|
|
136
|
+
promotion?: string;
|
|
137
|
+
} | Response | undefined;
|
|
138
|
+
/** A payment or subscription session with nothing to sell (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items). */
|
|
139
|
+
export declare function noLineItems(ctx: HandlerContext): Response;
|
|
140
|
+
/** A destination charge to an account the platform does not have (docs.stripe.com/connect/destination-charges). */
|
|
141
|
+
export declare function checkoutNoDestination(ctx: HandlerContext, destination: unknown): Response;
|
|
142
|
+
/** A session's trial Stripe refuses: `subscription_data.trial_end` "Has to be at least 48 hours in the future", and
|
|
143
|
+
* `subscription_data.trial_period_days` "Has to be at least 1" (docs.stripe.com/api/checkout/sessions/create). Where the
|
|
144
|
+
* documentation stops and the twin decides: the refusals' wording. */
|
|
145
|
+
export declare function sessionTrialRefused(ctx: HandlerContext, data: unknown, now: number): Response | undefined;
|
|
146
|
+
export declare function sessionTrialRefusal(ctx: HandlerContext, param: 'trial_end' | 'trial_period_days'): Response;
|
|
147
|
+
/** What completing a session makes, by its mode, as the fields that link it: a payment is a PaymentIntent paid with
|
|
148
|
+
* the entered card, its charge in the ledger as any payment's is. */
|
|
149
|
+
export declare function complete(ctx: HandlerContext, id: string, existing: Row, card?: EnteredCard): Promise<Row>;
|
|
150
|
+
/** A subscription session's lines at completion, each inline `price_data` made the Price it generates ("Data used to
|
|
151
|
+
* generate a new Price object inline", the same page), under the product it names or one made from its product_data,
|
|
152
|
+
* so the subscription's items bill it. Where the documentation stops and the twin decides: such a Price is archived
|
|
153
|
+
* (active=false), as a subscription item's price_data makes one (docs.stripe.com/products-prices/manage-prices). */
|
|
154
|
+
export declare function sessionPrices(ctx: HandlerContext, lines: Row[], inline: Array<Row | null>): Promise<Row[]>;
|
|
155
|
+
/** A setup session saves the card through a succeeded SetupIntent (docs.stripe.com/payments/save-and-reuse?platform=checkout). */
|
|
156
|
+
export declare function completeSetup(ctx: HandlerContext, customer: string | undefined, pm: Row | undefined): Promise<unknown>;
|
|
157
|
+
/** The discount a completed subscription session gives its subscription. */
|
|
158
|
+
export declare function sessionDiscount(ctx: HandlerContext, id: string, customer: string, now: number): Row[];
|
|
159
|
+
/** The customer paying on the hosted page (src/screens/checkout.tsx): the external actor's move on the
|
|
160
|
+
* session's machine, then what the payment made, linked, and the session stored complete. */
|
|
161
|
+
export declare function completeSession(ctx: HandlerContext, id: string, existing: Row, details?: Row, card?: EnteredCard): Promise<Row | Response>;
|
|
162
|
+
export declare const send: (ctx: HandlerContext, r: StripeResponse) => Response;
|
|
5
163
|
/** Stripe's error body: an invalid_request_error with the message, and the code when there is one. */
|
|
6
|
-
export declare const fail: (ctx:
|
|
7
|
-
/** A file parameter whose description requires a purpose refuses a file of another one. The served spec requires it
|
|
8
|
-
* on every such parameter ("Must have a `purpose` value of `issuing_logo`", personalization designs' card_logo;
|
|
9
|
-
* "The file's `purpose` must be one of the following: …", file links' file). Where the documentation stops and the
|
|
10
|
-
* twin decides: Stripe documents no error for it (docs.stripe.com/error-codes names none), so the twin answers the
|
|
11
|
-
* 400 invalid_request_error it answers for an unknown file, naming the parameter and the purposes allowed. */
|
|
12
|
-
export declare function filePurposeRefused(ctx: SemanticsContext, param: string, allowed: readonly string[]): Response | undefined;
|
|
164
|
+
export declare const fail: (ctx: HandlerContext, message: string, status?: number, code?: string) => Response;
|
|
13
165
|
/** The request's path, as the list envelope's `url` carries it. */
|
|
14
|
-
export declare const path: (ctx:
|
|
166
|
+
export declare const path: (ctx: HandlerContext) => string;
|
|
15
167
|
/** A path parameter, by the name the spec gives it. */
|
|
16
|
-
export declare const at: (ctx:
|
|
17
|
-
/** An update's fields laid over what is stored, as the derived core does: a nested hash is merged into the stored one,
|
|
18
|
-
* not put in its place (Stripe updates only the keys a request names; docs.stripe.com/api/metadata and each update
|
|
19
|
-
* reference), and an empty string unsets a key. */
|
|
20
|
-
export declare function mergeUpdate(ctx: SemanticsContext, resource: string, id: string, fields: Row): Row;
|
|
21
|
-
/** The tree's type for a resource: what its rows are stored under. */
|
|
22
|
-
export declare const stored: (resource: string) => string;
|
|
168
|
+
export declare const at: (ctx: HandlerContext, name: string) => string;
|
|
23
169
|
/** A resource's rows in Stripe's list order: newest first by `timeField`, ties by mint order (as the derived core breaks them). */
|
|
24
170
|
/** 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;
|
|
171
|
+
export declare const kept: (ctx: HandlerContext, resource: string, row: Row, key: string) => unknown;
|
|
28
172
|
/** A create's parameter that describes a confirmation, sent without confirm=true: the served spec gives each "This
|
|
29
173
|
* parameter can only be used with `confirm=true`" (off_session: "can only be used when confirm=true"); the message's
|
|
30
174
|
* wording is the twin's. Answers the refusal, or undefined. */
|
|
31
|
-
export declare function confirmOnly(ctx:
|
|
175
|
+
export declare function confirmOnly(ctx: HandlerContext, names: string[], confirm: boolean): Response | undefined;
|
|
32
176
|
/** A coupon applied (and the promotion code it came by): its times_redeemed, "Number of times this coupon has been
|
|
33
177
|
* applied to a customer" (the served spec's coupon), counts it, as the code's "Number of times this promotion code
|
|
34
178
|
* has been used" (its promotion_code). Where the documentation stops and the twin decides: reaching max_redemptions
|
|
35
179
|
* 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;
|
|
180
|
+
export declare function redeemCoupon(ctx: HandlerContext, couponId: unknown, promotionCode?: unknown): Promise<void>;
|
|
181
|
+
export declare function newest(ctx: HandlerContext, resource: string, timeField?: string): Row[];
|
|
41
182
|
/** A context at the moment Stripe would have made a move time makes (a renewal, a payout on its schedule), so what
|
|
42
183
|
* the move writes carries that moment (its events' occurredAt, `created`, a charge's funds' available_on), not the
|
|
43
184
|
* moment a later request caught it up. */
|
|
44
|
-
export declare function at_(ctx:
|
|
45
|
-
export declare function where(ctx:
|
|
185
|
+
export declare function at_(ctx: HandlerContext): (t: number) => Promise<HandlerContext>;
|
|
186
|
+
export declare function where(ctx: HandlerContext, items: Row[], spec: Record<string, (item: Row, value: unknown) => boolean>): Row[];
|
|
187
|
+
export declare function expandPaths(ctx: HandlerContext): string[][];
|
|
46
188
|
/** 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:
|
|
189
|
+
* asked of the machine as a write asks it (./ledger.ts). */
|
|
190
|
+
export declare function commonAsOf(ctx: HandlerContext, t: Row): Row;
|
|
191
|
+
/** Stripe's expand walk (the kernel's, over the manifest's `embeds`): each dotted path replaces an id with the resource
|
|
192
|
+
* it holds, one segment at a time; an id the tree lacks stays an id. An embedded balance transaction reads as the clock
|
|
193
|
+
* has it (asOf), as its own retrieve does. */
|
|
194
|
+
export declare function expandRow(ctx: HandlerContext, resource: string, body: Row, paths: string[][]): Row;
|
|
53
195
|
/** One resource with the request's `expand[]` applied. */
|
|
54
|
-
export declare const expanded: (ctx:
|
|
196
|
+
export declare const expanded: (ctx: HandlerContext, resource: string, body: Row) => Row;
|
|
197
|
+
export declare const resourceView: (ctx: HandlerContext, resource: string, id: string) => Row | undefined;
|
|
55
198
|
/** Stripe's list envelope over rows already in list order: a page, `has_more`, and `expand[]=data.*`. */
|
|
56
|
-
export declare function list(ctx:
|
|
199
|
+
export declare function list(ctx: HandlerContext, resource: string, items: Row[]): Response;
|
|
57
200
|
/** Stripe's search over a resource's rows (`query` in its search language). */
|
|
58
|
-
export declare const search: (ctx:
|
|
201
|
+
export declare const search: (ctx: HandlerContext, resource: string, timeField?: string) => Response;
|
|
59
202
|
/** A create as Stripe stamps it: the caller's id when it gave one (seeding uses real ids), else a
|
|
60
203
|
* minted one; `object`, the creation time, the defaults, then the request's own fields. An object
|
|
61
204
|
* Stripe gives no creation time keeps the twin's as `_created`, for ordering. (A request parameter the
|
|
62
205
|
* 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:
|
|
206
|
+
* ./version.ts.) */
|
|
207
|
+
export declare function created(ctx: HandlerContext, resource: string, params: Row, defaults: Row, opts?: {
|
|
65
208
|
timeField?: string;
|
|
66
209
|
operation?: string;
|
|
67
210
|
}): 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;
|
|
211
|
+
export declare const finder: (ctx: Pick<HandlerContext, "rowsRaw">) => Find;
|
|
81
212
|
/** The account's external_accounts list, rewritten from its external accounts after one is added or removed. */
|
|
82
|
-
export declare function syncExternals(ctx:
|
|
213
|
+
export declare function syncExternals(ctx: HandlerContext, account: string): Promise<void>;
|
|
214
|
+
export declare const pmMissing: (ctx: HandlerContext, id: string) => Response;
|
|
215
|
+
/** The card a charge was paid with, as its payment_method_details reports it
|
|
216
|
+
* (docs.stripe.com/api/charges/object#charge_object-payment_method_details): a stored PaymentMethod's card, a
|
|
217
|
+
* documented test name (pm_card_* or tok_*, the same cards), or a raw card; undefined for anything else. */
|
|
218
|
+
export declare function paymentMethodDetails(ctx: HandlerContext, ref: unknown): Row | undefined;
|
|
219
|
+
/** Whether a payment method can be attached: a stored one, or a documented test name that attaching mints. */
|
|
220
|
+
export declare const attachable: (ctx: HandlerContext, id: string) => boolean;
|
|
221
|
+
export declare function attachPaymentMethod(ctx: HandlerContext, id: string, customer: string): Promise<Row>;
|
|
222
|
+
/** A documented test name (pm_card_visa, pm_card_visa_chargeDeclined, …) made a real PaymentMethod, as Stripe
|
|
223
|
+
* does when one is used: the brand and number it stands for (docs.stripe.com/testing#cards) and its outcome. */
|
|
224
|
+
export declare function materializeTestMethod(ctx: HandlerContext, id: string, customer: string | null): Promise<Row>;
|
|
225
|
+
/** A PaymentMethod made from a confirm's `payment_method_data` ("If provided, this hash will be used to create a
|
|
226
|
+
* PaymentMethod", docs.stripe.com/api/setup_intents/confirm, docs.stripe.com/api/payment_intents/confirm), or none. */
|
|
227
|
+
export declare function methodFromData(ctx: HandlerContext, data: unknown): Promise<string | undefined>;
|
|
228
|
+
/** Whether an intent sets up or pays with a bank account by micro-deposits because it asks for them:
|
|
229
|
+
* payment_method_options[us_bank_account][verification_method]=microdeposits with a us_bank_account method
|
|
230
|
+
* ("Microdeposit only verification", docs.stripe.com/payments/ach-direct-debit/set-up-payment). */
|
|
231
|
+
export declare function microdepositsAsked(ctx: HandlerContext, params: Row, intent: Row, pm: string | undefined): boolean;
|
|
232
|
+
/** A tiered price: tiers_mode and tiers, each tier with up_to and a unit or flat amount; no single unit_amount, and
|
|
233
|
+
* the last tier's up_to null (∞) (docs.stripe.com/products-prices/pricing-models#tiered-pricing). */
|
|
234
|
+
export declare function tieredPrice(ctx: HandlerContext, params: Row): Promise<Response>;
|
|
235
|
+
/** Whether the intent's caller named its methods: on create (TYPES_GIVEN), or by an update that set its
|
|
236
|
+
* payment_method_types ("Alternatively, update the allowed payment_method_types for this PaymentIntent",
|
|
237
|
+
* methodNotAllowed below), which the generic update writes as given, so the intent's history holds it. */
|
|
238
|
+
export declare const typesGiven: (ctx: HandlerContext, id: string) => boolean;
|
|
239
|
+
export declare const paymentIntentsSend: (ctx: HandlerContext, r: StripeResponse) => Response;
|
|
240
|
+
export declare function mintCharge(ctx: HandlerContext, piId: string, pi: Row, amount: number): Promise<string>;
|
|
241
|
+
/** A manual-capture intent's authorization: "Separate payment authorization and capture to create a charge now, but
|
|
242
|
+
* capture funds later", and on capture "A partial capture automatically releases the remaining amount"
|
|
243
|
+
* (docs.stripe.com/payments/place-a-hold-on-a-payment-method). The charge succeeded and is not captured, holding the
|
|
244
|
+
* amount until capture_before, with nothing on the balance yet. Written as
|
|
245
|
+
* charge.succeeded, as a charge made with capture=false is (charges.ts); its capture writes charge.captured
|
|
246
|
+
* (captureAuthorization). Where the documentation stops and the twin decides: the events page names no event for an
|
|
247
|
+
* authorization of its own, so the authorized charge sends charge.succeeded, its status being succeeded. */
|
|
248
|
+
export declare function authorizeCharge(ctx: HandlerContext, piId: string, pi: Row, amount: number): Promise<string>;
|
|
249
|
+
/**
|
|
250
|
+
* An intent an invoice collects through succeeded (the default_incomplete subscription flow: create
|
|
251
|
+
* now, confirm client-side): its invoice is paid and, when it is a subscription's first, the
|
|
252
|
+
* subscription leaves incomplete for active. Both are moves the invoice and subscription machines
|
|
253
|
+
* declare under the confirming operation. No-op when the intent names no invoice, or the invoice is
|
|
254
|
+
* already paid (a duplicate confirm) or void (voiding ends what it collects).
|
|
255
|
+
*/
|
|
256
|
+
export declare function payInvoiceOf(ctx: HandlerContext, pi: Row, operationId: string, actor?: 'vendor'): Promise<void>;
|
|
257
|
+
/** An invoice-linked intent read back from a live account; the served create API cannot set invoice. */
|
|
258
|
+
export declare function finishInvoiceIntent(ctx: HandlerContext, invoice: Row, invoiceId: string, operationId: string, actor?: 'vendor'): Promise<void>;
|
|
259
|
+
/** The type of the payment method an intent is paid with: its PaymentMethod's, or a documented test name's (pm_card_*,
|
|
260
|
+
* tok_* a card; pm_usBankAccount_* a US bank account), else unknown. */
|
|
261
|
+
export declare function methodType(ctx: HandlerContext, method: unknown): string | undefined;
|
|
262
|
+
/** A confirm with a payment method of a type the intent's caller did not allow, refused as Stripe refuses it: "The
|
|
263
|
+
* PaymentMethod provided (card_present) is not allowed for this PaymentIntent. Please attach a PaymentMethod of one of
|
|
264
|
+
* the following types: card. Alternatively, update the allowed payment_method_types for this PaymentIntent to include
|
|
265
|
+
* "card_present"" (a real answer quoted in github.com/stripe/stripe-terminal-react-native/issues/745, an intent made
|
|
266
|
+
* with payment_method_types ['card']). Only a list the caller gave restricts: without one Stripe offers the methods
|
|
267
|
+
* the account enables, which the twin does not model. Where the evidence stops: that answer's code is not quoted; the
|
|
268
|
+
* twin answers payment_intent_invalid_parameter ("One or more provided parameters wasn't allowed for the given
|
|
269
|
+
* operation on the PaymentIntent", docs.stripe.com/error-codes), param payment_method. */
|
|
270
|
+
export declare function methodNotAllowed(ctx: HandlerContext, existing: Row, params: Row): Response | undefined;
|
|
271
|
+
export declare function intentFields(params: Record<string, unknown>): Record<string, unknown>;
|
|
272
|
+
/** Confirm an intent the confirm machine allows to move: the confirm action, and a create with `confirm=true`. */
|
|
273
|
+
export declare function confirmIntent(ctx: HandlerContext, existing: Record<string, unknown>, params: Record<string, unknown>): Promise<Response>;
|
|
274
|
+
/** Whether the method an intent is confirmed with is a bank debit: a us_bank_account PaymentMethod, or one of Stripe's
|
|
275
|
+
* test bank accounts named as one (pm_usBankAccount_*, pm_us_bank_account). */
|
|
276
|
+
export declare function isBankDebit(ctx: HandlerContext, method: unknown): boolean;
|
|
277
|
+
/** Whether a bank debit stays processing: the page's pm_usBankAccount_processing, or its account 000000000009. */
|
|
278
|
+
export declare function staysProcessing(ctx: HandlerContext, method: unknown): boolean;
|
|
279
|
+
/** A bank debit submitted: the intent processes, nothing received yet, sent as payment_intent.processing; it is due to
|
|
280
|
+
* settle at this instant, unless its test account stays processing. */
|
|
281
|
+
export declare function beginBankDebit(ctx: HandlerContext, id: string, fields: Row): Promise<Row>;
|
|
282
|
+
/** Time's settling of bank debits, caught up to the World's clock: each processing debit whose moment has come succeeds
|
|
283
|
+
* then, its Charge made and the invoice it collects for paid. */
|
|
284
|
+
export declare function settleBankDebits(ctx: HandlerContext): Promise<void>;
|
|
285
|
+
/** A customer_balance intent funded from the customer's cash balance: paid when the balance covers it ("If the customer
|
|
286
|
+
* already has a balance high enough to cover the payment amount, the PaymentIntent immediately succeeds"), else
|
|
287
|
+
* waiting for a transfer: "If the customer balance isn’t high enough to cover the request amount, the PaymentIntent
|
|
288
|
+
* shows a requires_action status ... next_action ... display_bank_transfer_instructions" with the amount_remaining
|
|
289
|
+
* (docs.stripe.com/payments/bank-transfers/accept-a-payment). Answers the intent as written. */
|
|
290
|
+
export declare function fundFromCashBalance(ctx: HandlerContext, pi: Row, fields?: Row): Promise<Row>;
|
|
291
|
+
/** A customer_balance intent the customer's funded cash balance pays: its ledger records what was applied, and the intent
|
|
292
|
+
* succeeds with its charge. */
|
|
293
|
+
export declare function payFromCashBalance(ctx: HandlerContext, pi: Row, fields: Row, o: {
|
|
294
|
+
customer: string;
|
|
295
|
+
currency: string;
|
|
296
|
+
available: number;
|
|
297
|
+
amount: number;
|
|
298
|
+
}): Promise<Row>;
|
|
299
|
+
/** Whether a charge's funds go straight to the available balance: a bypass card as a raw number, a test name (pm_card_*
|
|
300
|
+
* or tok_*), or a stored PaymentMethod made from one (which records it as what follows its success, after-payment.ts);
|
|
301
|
+
* or a US bank account, stored or one of Stripe's test bank accounts named as one (pm_usBankAccount_*). */
|
|
302
|
+
export declare function bypassesPending(ctx: HandlerContext, card: string | undefined): boolean;
|
|
303
|
+
/** The connected account a request acts for, or undefined for the platform. */
|
|
304
|
+
export declare const actingAccount: (ctx: HandlerContext) => string | undefined;
|
|
305
|
+
/** A ledger entry on an account's balance: the acting account's unless one is named (null names the platform). */
|
|
306
|
+
export declare function write(ctx: HandlerContext, fields: Row, account?: string | null | undefined): Promise<string>;
|
|
307
|
+
/** A captured charge's credit: its amount less the fee, pending two days unless the card bypasses the pending
|
|
308
|
+
* balance (bypassesPending), when it is due at once. The
|
|
309
|
+
* caller mints the charge's id first and stores the returned id as the charge's balance_transaction. */
|
|
310
|
+
export declare function settleCharge(ctx: HandlerContext, chargeId: string, amount: number, currency: string, card?: string): Promise<string>;
|
|
311
|
+
/** A refund's debit, at once, on the acting account's balance unless one is named (null names the platform). */
|
|
312
|
+
export declare function settleRefund(ctx: HandlerContext, refundId: string, amount: number, currency: string, account?: string | null | undefined): Promise<string>;
|
|
313
|
+
/** What an account had available in a currency at a moment: every entry of its payments balance whose funds had come
|
|
314
|
+
* due by then. */
|
|
315
|
+
export declare function availableAt(ctx: HandlerContext, account: string | undefined, currency: string, at: number): number;
|
|
316
|
+
/** The moments after `from` and up to `until` when funds of an account came due, in order: when a held refund can
|
|
317
|
+
* next be covered. */
|
|
318
|
+
export declare function fundsDueBetween(ctx: HandlerContext, account: string | undefined, currency: string, from: number, until: number): number[];
|
|
319
|
+
/** A dispute's debit, at once: the disputed amount and the dispute fee (the twin's 1500 cents, Stripe's US $15). */
|
|
320
|
+
export declare function settleDispute(ctx: HandlerContext, disputeId: string, amount: number, currency: string): Promise<string>;
|
|
321
|
+
/** An account's ledger entries an automatic payout has not yet paid out: every entry on its payments balance that no
|
|
322
|
+
* automatic payout took (the automatic payouts' own debits excluded), as stored. */
|
|
323
|
+
export declare function unpaidEntries(ctx: HandlerContext, account: string | undefined): Row[];
|
|
324
|
+
/** An automatic payout's debit at `at`, and the entries it pays out marked with it, so the ledger lists them under
|
|
325
|
+
* the payout (docs.stripe.com/api/balance_transactions/list#balance_transaction_list-payout). */
|
|
326
|
+
export declare function settleAutomaticPayout(ctx: HandlerContext, payoutId: string, amount: number, currency: string, account: string | undefined, at: number, entries: Row[]): Promise<string>;
|
|
327
|
+
/** A payout's debit (negative) or a cancellation's or reversal's credit (positive), at once, on the payout's account. */
|
|
328
|
+
export declare function settlePayout(ctx: HandlerContext, payoutId: string, amount: number, currency: string, account?: string | null | undefined): Promise<string>;
|
|
329
|
+
/** A transfer's two entries: out of the platform's balance at once, into the destination's when `fromCharge` (its
|
|
330
|
+
* charge's funds' availability) comes (a plain transfer, with no `fromCharge`, moves funds available already).
|
|
331
|
+
* Answers the platform's entry. */
|
|
332
|
+
export declare function settleTransfer(ctx: HandlerContext, transferId: string, amount: number, currency: string, destination: string, fromCharge?: number, fromPending?: boolean): Promise<string>;
|
|
333
|
+
/** A direct charge's application fee: out of the connected account's balance, into the platform's. */
|
|
334
|
+
export declare function settleApplicationFee(ctx: HandlerContext, feeId: string, amount: number, currency: string, account: string): Promise<string>;
|
|
335
|
+
/** Time's settlements, written: each entry on the acting account's balance whose funds came due by the World's clock
|
|
336
|
+
* moves pending → available (the clock's move the machine allows), so a settlement is recorded once. A read already
|
|
337
|
+
* sees it (asOf); the record is what lets Stripe's balance.available be sent once (./front.ts, the drain).
|
|
338
|
+
* Funds that were available at once and not yet sent are taken too, and marked sent. Answers the entries taken. */
|
|
339
|
+
export declare function settleDueEntries(ctx: HandlerContext, account?: string | undefined): Promise<Row[]>;
|
|
340
|
+
/** An account's balance, by currency: what the clock has made available, what is still pending, and Issuing's own. */
|
|
341
|
+
export declare function balanceOf(ctx: HandlerContext, account?: string | undefined): {
|
|
342
|
+
available: Map<string, number>;
|
|
343
|
+
pending: Map<string, number>;
|
|
344
|
+
issuing: Map<string, number>;
|
|
345
|
+
};
|
|
346
|
+
/** balance_insufficient when a payout or transfer would take more than the account has available in its currency. */
|
|
347
|
+
export declare function refusePayout(ctx: HandlerContext, amount: number, currency: string, account?: string | undefined): Response | undefined;
|
|
348
|
+
/** The ids of the ledger entries on the acting account's balance. */
|
|
349
|
+
export declare const mine: (ctx: HandlerContext) => Set<unknown>;
|
|
350
|
+
export declare const chargeMissing: (ctx: HandlerContext, id: string) => Response;
|
|
351
|
+
/** Every egress of a charge carries its refunds, derived from the refund rows in list order. */
|
|
352
|
+
export declare function chargeBody(ctx: HandlerContext, c: Row): Row;
|
|
353
|
+
export declare const subMissing: (ctx: HandlerContext, id: string) => Response;
|
|
354
|
+
/** A coupon that replaces the subscription's discount, or an empty one that clears it (docs.stripe.com/api/subscriptions/update#update_subscription-discounts). */
|
|
355
|
+
export declare function replacedDiscounts(ctx: HandlerContext, couponId: string, sub: Row): Row[] | Response;
|
|
356
|
+
/** A `trial_end` Stripe refuses: the parameter is `"now" | timestamp` (docs.stripe.com/api/subscriptions/update), and a
|
|
357
|
+
* timestamp that is not in the future answers "Invalid timestamp: must be an integer Unix timestamp in the future."
|
|
358
|
+
* (Stripe's own message, as its SDKs' users report it: github.com/stripe/stripe-dotnet/issues/805,
|
|
359
|
+
* github.com/stripe/stripe-ruby/issues/682). Where the documentation stops and the twin decides: a value that is no
|
|
360
|
+
* number at all, and one more than two years on, answer that same message. */
|
|
361
|
+
export declare function trialEndRefused(ctx: HandlerContext, value: unknown, now: number): Response | undefined;
|
|
362
|
+
export declare function invalidTrialEnd(ctx: HandlerContext): Response;
|
|
363
|
+
/** An update's `trial_end` on the subscription, into `fields`.
|
|
364
|
+
*
|
|
365
|
+
* `now` on a trialing subscription ends its trial at once: "The special value `now` can be provided to end the customer's
|
|
366
|
+
* trial immediately" (docs.stripe.com/api/subscriptions/update#update_subscription-trial_end; the trials guide's "To end a
|
|
367
|
+
* trial early … setting the `trial_end` value to … **now** to end immediately", docs.stripe.com/billing/subscriptions/
|
|
368
|
+
* trials/free-trials). The update resets the billing date and charges at once: "Switching prices does not normally change
|
|
369
|
+
* the billing date or generate an immediate charge unless … A trial starts or ends. In these cases, we … immediately
|
|
370
|
+
* charge the customer using the new price, and reset the billing date" (docs.stripe.com/api/subscriptions/update), and
|
|
371
|
+
* "Stripe immediately attempts payment when a subscription's billing cycle anchor is reset … When billing is performed
|
|
372
|
+
* immediately, but the required payment fails, the subscription change request succeeds and the subscription transitions
|
|
373
|
+
* to `past_due`" (docs.stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). So a new period starts now,
|
|
374
|
+
* its invoice is made (`invoice.created`) and charged to the subscription's default payment method, else the
|
|
375
|
+
* customer's (paid: `invoice.paid`, the subscription `active`; declined or none: the invoice open, `past_due`), and the
|
|
376
|
+
* subscription's own write sends `customer.subscription.updated`. `payment_behavior` (the same page): `error_if_incomplete`
|
|
377
|
+
* answers 402 and leaves the subscription as it was, `default_incomplete` leaves the invoice open without an attempt.
|
|
378
|
+
*
|
|
379
|
+
* A future timestamp moves the trial's end, and the period and billing anchor with it: "The `billing_cycle_anchor` will be
|
|
380
|
+
* updated to the `trial_end` value" (the same parameter); on a subscription out of its trial it starts a new one ("You can
|
|
381
|
+
* add a new trial on a non-trialing subscription by updating the subscription while specifying trial_end", and for
|
|
382
|
+
* classic billing mode "the `trial_start` field remains set to the start of the first trial", docs.stripe.com/billing/
|
|
383
|
+
* subscriptions/trials/free-trials).
|
|
384
|
+
*
|
|
385
|
+
* Where the documentation stops and the twin decides: the invoice's billing_reason is `subscription_update` ("A
|
|
386
|
+
* subscription was updated", docs.stripe.com/api/invoices/object#invoice_object-billing_reason); `now` on a subscription
|
|
387
|
+
* that is not trialing has no trial to end and changes nothing; the credit Stripe prorates for the unused time when a new
|
|
388
|
+
* trial starts mid-period is not made (as `proration_behavior=none` would have it); `pending_if_incomplete` answers as
|
|
389
|
+
* `allow_incomplete` (no pending update is modelled). Answers a refusal, or the invoice to collect once the subscription is written. */
|
|
390
|
+
export declare function applyTrialEnd(ctx: HandlerContext, sub: Row, fields: Row, now: number): Promise<{
|
|
391
|
+
invoice: string;
|
|
392
|
+
payer?: string;
|
|
393
|
+
attempt: boolean;
|
|
394
|
+
} | undefined>;
|
|
395
|
+
/** What ending the trial charges: the update's own default payment method, else the subscription's, else its customer's. */
|
|
396
|
+
export declare function trialPayer(ctx: HandlerContext, sub: Row): string | undefined;
|
|
397
|
+
/** What an update's `trial_end` refuses before anything is written: a new trial the machine does not allow from the
|
|
398
|
+
* subscription's status, or, under `error_if_incomplete`, ending a trial that cannot be paid at once ("If payment fails,
|
|
399
|
+
* return an HTTP `402` status code and don't update the subscription", docs.stripe.com/api/subscriptions/update). */
|
|
400
|
+
export declare function trialEndBlocked(ctx: HandlerContext, sub: Row, discounts: Row[] | undefined): Response | undefined;
|
|
401
|
+
/** A price named by id, or given as an object. */
|
|
402
|
+
export declare function priceRow(ctx: HandlerContext, price: unknown): Row | undefined;
|
|
403
|
+
/** One period of the subscription's items as an update's `items` would leave them, before any discount: an entry naming
|
|
404
|
+
* an item changes its price and quantity (a new price resets the quantity to 1 unless one is given) or deletes it, and
|
|
405
|
+
* one naming none adds an item (applyItemChanges). */
|
|
406
|
+
export declare function dueAfter(ctx: HandlerContext, sub: Row, entries: Row[]): number;
|
|
407
|
+
/** One entry of an update's `items` on the lines it would leave (dueAfter). */
|
|
408
|
+
export declare function entryAfter(ctx: HandlerContext, lines: Map<string, {
|
|
409
|
+
price: Row | undefined;
|
|
410
|
+
quantity: number;
|
|
411
|
+
}>, e: Row, i: number): void;
|
|
412
|
+
/** A new trial on a subscription whose status the machine does not let start one. */
|
|
413
|
+
export declare function newTrialRefused(ctx: HandlerContext, sub: Row): Response | undefined;
|
|
414
|
+
/** What ending the trial charges, judged before anything is written: the period of the items as this update leaves them
|
|
415
|
+
* (dueAfter) under the discount it leaves, and whether the payer pays it (an attempt made, a payer, no decline). */
|
|
416
|
+
export declare function trialEndCharge(ctx: HandlerContext, sub: Row, discounts: Row[] | undefined): {
|
|
417
|
+
due: number;
|
|
418
|
+
pays: boolean;
|
|
419
|
+
declined?: ReturnType<typeof declineFor>;
|
|
420
|
+
};
|
|
421
|
+
/** A new item named with neither `price` nor `price_data`: "One of `price` or `price_data` is required"
|
|
422
|
+
* (docs.stripe.com/api/subscriptions/update). */
|
|
423
|
+
export declare function noItemPrice(ctx: HandlerContext): Response;
|
|
424
|
+
/** A subscription asked to fail when its first invoice cannot be paid at once (payment_behavior=error_if_incomplete):
|
|
425
|
+
* the card's decline, or no payment method to charge (docs.stripe.com/api/subscriptions/create#create_subscription-payment_behavior). */
|
|
426
|
+
export declare function firstPaymentRefused(ctx: HandlerContext, declined: Parameters<typeof cardError>[0] | null | undefined): Response;
|
|
427
|
+
/** An update's `items`: "A list of up to 20 subscription items, each with an attached price"
|
|
428
|
+
* (docs.stripe.com/api/subscriptions/update): an entry naming an item's `id` changes that item (its price, quantity,
|
|
429
|
+
* metadata) or, with `deleted` ("A flag that, if set to `true`, will delete the specified item"), removes it; "If you
|
|
430
|
+
* omit `id`, the API adds a new subscription item rather than updating the existing one". Each takes `price` or
|
|
431
|
+
* `price_data`, "Data used to generate a new Price object inline. One of `price` or `price_data` is required", and
|
|
432
|
+
* "When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided". An
|
|
433
|
+
* inline price is made as the manage-prices guide says: "By default, prices created with `price_data` are effectively
|
|
434
|
+
* archived (they're marked as `active=false`)" (docs.stripe.com/products-prices/manage-prices).
|
|
435
|
+
* Where the documentation stops and the twin decides: the update is all or nothing, every entry checked before any is
|
|
436
|
+
* written (Stripe answers one error for the request); the refusals are worded by the twin. */
|
|
437
|
+
export declare function applyItemChanges(ctx: HandlerContext, subId: string, entries: Row[]): Promise<Response | undefined>;
|
|
438
|
+
/** The refusal of an update's `items`, checked entry by entry before any is written (applyItemChanges). */
|
|
439
|
+
export declare function itemChangesRefused(ctx: HandlerContext, subId: string, entries: Row[]): Response | undefined;
|
|
440
|
+
/** An update's checked `items`, written. */
|
|
441
|
+
export declare function writeItemChanges(ctx: HandlerContext, subId: string, entries: Row[]): Promise<undefined>;
|
|
442
|
+
/** A subscription item's `price_data` Stripe would refuse: its required `currency`, `product` (an existing one) and
|
|
443
|
+
* `recurring[interval]`, and "Only one of `unit_amount` and `unit_amount_decimal` can be set". */
|
|
444
|
+
export declare function refuseInlinePrice(ctx: HandlerContext, d: Row): Response | undefined;
|
|
445
|
+
/** The inline Price a `price_data` generates: recurring, archived (active=false). Answers its id. */
|
|
446
|
+
export declare function inlinePrice(ctx: HandlerContext, d: Row): Promise<string>;
|
|
447
|
+
/** A new subscription's items, each its own subscription_item as Stripe keeps it (/v1/subscription_items/{id}). */
|
|
448
|
+
export declare function storeItems(ctx: HandlerContext, subId: string, items: Row[]): Promise<void>;
|
|
449
|
+
export declare function syncItems(ctx: HandlerContext, subId: string): Promise<void>;
|
|
450
|
+
export declare const listMissing: (ctx: HandlerContext, id: string, status?: number) => Response;
|
|
451
|
+
/** A value list's list_items, "List of items contained within this value list" (the served spec), kept in step with
|
|
452
|
+
* its items, at the address the fixture names (/v1/radar/value_list_items?value_list=…). */
|
|
453
|
+
export declare function radarSyncItems(ctx: HandlerContext, listId: string): Promise<void>;
|
|
454
|
+
/** An authorization as every egress carries it: its card embedded in full. */
|
|
455
|
+
export declare function withCard(ctx: HandlerContext, a: Row): Row;
|
|
456
|
+
export declare const authMissing: (ctx: HandlerContext, id: string) => Response;
|
|
457
|
+
/** A capture: an Issuing transaction (negative: it debits) and the issuing balance's debit. */
|
|
458
|
+
export declare function capture(ctx: HandlerContext, authId: string, auth: Row, amountCents: number): Promise<{
|
|
459
|
+
txnId: string;
|
|
460
|
+
btId: string;
|
|
461
|
+
}>;
|
|
462
|
+
/** Issuing refusals of a request no story sends: an unknown card status or authorization method, and a capture of an
|
|
463
|
+
* authorization that is not approved and pending. */
|
|
464
|
+
export declare function issuingRefusal(ctx: HandlerContext, what: 'card_status' | 'authorization_method' | 'not_capturable', auth?: Row): Response;
|
|
465
|
+
/** A partial approval's refusal: "You can specify the amount you want to approve by setting the amount in the webhook
|
|
466
|
+
* response body or the approve call" only "When an authorization is partially authorized, the is_amount_controllable
|
|
467
|
+
* field on the authorization request is set to true" (docs.stripe.com/issuing/purchases/authorizations), and never a
|
|
468
|
+
* credit. Answers the refusal, or undefined when the amount may be approved. */
|
|
469
|
+
export declare function partialApprovalRefused(ctx: HandlerContext, auth: Row): Response | undefined;
|
|
470
|
+
export declare function issuingDecide(approved: boolean): Handler;
|
|
471
|
+
/** Time's decision on a real-time request no one answered, caught up to the World's clock: once its window has ended,
|
|
472
|
+
* a pending authorization whose issuing_authorization.request went unanswered, and that no approve or decline decided,
|
|
473
|
+
* is decided automatically, its request_history reason webhook_timeout ("webhook_timeout for all other failure modes",
|
|
474
|
+
* the same page, beside webhook_error for a response Stripe cannot process).
|
|
475
|
+
* Where the documentation stops and the twin decides: the timeout setting is the Dashboard's, which the API does not
|
|
476
|
+
* answer, and the twin's is to decline; the window is measured in World time from the authorization's created. */
|
|
477
|
+
export declare function lapseRealtimeRequests(ctx: HandlerContext): Promise<void>;
|
|
478
|
+
/** An approval's hold: "If you approve the authorization, we deduct the `amount` from your Issuing balance and hold it
|
|
479
|
+
* in reserve until the authorization is either captured, voided, or expired without capture"
|
|
480
|
+
* (docs.stripe.com/issuing/purchases/authorizations). */
|
|
481
|
+
export declare function holdFor(ctx: HandlerContext, authId: string, amount: number, currency: string): Promise<Row>;
|
|
482
|
+
/** An authorization approved as it is presented, its amount held: approved and pending until the merchant captures. */
|
|
483
|
+
export declare function approvedAtOnce(ctx: HandlerContext, subject: Row, fields: Row, held: number, entry: Row): Promise<Response>;
|
|
484
|
+
/** An authorization as the platform's real-time answer makes it: approved (in part, only when the request was
|
|
485
|
+
* amount-controllable), declined, or declined for an answer Stripe cannot read (docs.stripe.com/issuing/controls/
|
|
486
|
+
* real-time-authorizations: the response's `approved` and `amount`; webhook_error "if we can't process your response"). */
|
|
487
|
+
export declare function answeredByEndpoint(ctx: HandlerContext, outcome: {
|
|
488
|
+
kind: 'approved';
|
|
489
|
+
amount?: number;
|
|
490
|
+
} | {
|
|
491
|
+
kind: 'declined';
|
|
492
|
+
} | {
|
|
493
|
+
kind: 'error';
|
|
494
|
+
message: string;
|
|
495
|
+
}, o: {
|
|
496
|
+
subject: Row;
|
|
497
|
+
fields: Row;
|
|
498
|
+
amount: number;
|
|
499
|
+
controllable: boolean;
|
|
500
|
+
entry: (e: {
|
|
501
|
+
amount: number;
|
|
502
|
+
approved: boolean;
|
|
503
|
+
reason: string;
|
|
504
|
+
reasonMessage: string | null;
|
|
505
|
+
}) => Row;
|
|
506
|
+
decline: (reason: string, message: string | null) => Promise<Response>;
|
|
507
|
+
}): Promise<Response>;
|
|
508
|
+
/** Time's settling of held refunds, caught up to the World's clock: each refund held for want of balance, oldest first,
|
|
509
|
+
* is made at the first moment the account's available balance covers it (the funds that come due then), its debit
|
|
510
|
+
* written then, as `refund.updated`. Where the documentation stops and the twin decides: a held refund is made the
|
|
511
|
+
* moment the balance covers it. */
|
|
512
|
+
export declare function settleHeldRefunds(ctx: HandlerContext): Promise<void>;
|
|
513
|
+
/** A pending refund can enter this surface only through the vendor-backed refund refresh. */
|
|
514
|
+
export declare function settleOneHeldRefund(ctx: HandlerContext, r: Row, now: number): Promise<void>;
|
|
515
|
+
export declare const accountMissing: (ctx: HandlerContext, id: string, status?: number) => Response;
|
|
516
|
+
/** The account, tombstones included where the hand-written routes looked past a deletion. */
|
|
517
|
+
export declare const accountRow: (ctx: HandlerContext, id: string) => Row | undefined;
|
|
518
|
+
/** Stripe's review of a Custom account once the platform gives it something: with nothing left due, its requested
|
|
519
|
+
* capabilities become active and it can take charges and receive payouts; with something due again (its bank account
|
|
520
|
+
* removed), they stop. Where the documentation stops and the twin decides: test-mode verification is immediate, and
|
|
521
|
+
* it owes what customRequirements lists. An Express or Standard account is onboarded on Stripe's own pages. */
|
|
522
|
+
export declare function connectReview(ctx: HandlerContext, id: string): Promise<void>;
|
|
523
|
+
/** The review of a Custom account (see review). */
|
|
524
|
+
export declare function reviewCustom(ctx: HandlerContext, id: string, account: Row): Promise<void>;
|
|
525
|
+
/** A transfer to an account whose transfers capability is not active. */
|
|
526
|
+
export declare function transfersInactive(ctx: HandlerContext): Response;
|
|
527
|
+
/** A transfer from a charge whose funds have settled: "With a source_transaction, the transfer request returns success
|
|
528
|
+
* regardless of your available balance if the related charge hasn't settled yet" (docs.stripe.com/connect/separate-
|
|
529
|
+
* charges-and-transfers), so a settled one comes out of the available balance. */
|
|
530
|
+
export declare function settledSourceRefused(ctx: HandlerContext, amount: number, currency: string): Response | undefined;
|
|
531
|
+
/** An earlier version's payment_method_types refused: the first value that names no payment method type the
|
|
532
|
+
* operation takes, in the intent's words or (a Checkout Session) the enum's. */
|
|
533
|
+
export declare function unknownMethodType(ctx: HandlerContext, opId: string, given: unknown): Response | undefined;
|
|
534
|
+
/** payment_method_types refused where the caller's version removed it. */
|
|
535
|
+
export declare const noLongerSupported: (ctx: HandlerContext, version: string) => Response;
|
|
536
|
+
/** Stripe's refusal of a request whose top-level parameters the operation does not take, or undefined. */
|
|
537
|
+
export declare function refuseParameters(ctx: HandlerContext): Response | undefined;
|
|
538
|
+
/** An answer in the shape of the API version the caller is served (./version.ts), a webhook endpoint's `secret` shown
|
|
539
|
+
* only at its creation ("Only returned at creation", docs.stripe.com/api/webhook_endpoints/object). */
|
|
540
|
+
export declare function rendered(request: Request, res: Response): Promise<Response>;
|
|
541
|
+
/** Write a draft's line list and the totals derived from it. */
|
|
542
|
+
export declare function writeLines(ctx: HandlerContext, invoiceId: string, next: Row[]): Promise<Row>;
|
|
543
|
+
/** 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). */
|
|
544
|
+
export declare function pullPendingItem(ctx: HandlerContext, invoiceId: string, inv: Row, item: Row, now: number): Promise<void>;
|
|
545
|
+
/** The intent the path names, and the machine's refusal when this operation may not move it. */
|
|
546
|
+
export declare function paymentIntentsLoad(ctx: HandlerContext, operationId: string): {
|
|
547
|
+
pi: Record<string, unknown>;
|
|
548
|
+
} | {
|
|
549
|
+
answer: Response;
|
|
550
|
+
};
|
|
551
|
+
/** A transfer reversal's two entries: back into the platform's balance, out of the destination's. */
|
|
552
|
+
export declare function settleTransferReversal(ctx: HandlerContext, reversalId: string, amount: number, currency: string, destination: string): Promise<string>;
|
|
553
|
+
/** A capture=false charge refunded while uncaptured: its authorization is released by the refund, as it would be
|
|
554
|
+
* "automatically refunded if uncaptured" (spec/openapi.json.gz, `capture_before`). The charge stays uncaptured and
|
|
555
|
+
* becomes refunded in full, a Refund records the release, and no money moves: none was ever received. Written as
|
|
556
|
+
* charge.refunded. Where the documentation stops and the twin decides: Stripe's basil change ("Partially capturing or
|
|
557
|
+
* canceling payments no longer creates a Refund", docs.stripe.com/changelog/basil/2025-03-31/remove-refund-from-partial-
|
|
558
|
+
* capture-and-payment-cancellation-flow) names partial capture and cancellation, not a refund asked for, so a refund
|
|
559
|
+
* still makes one; its reason is null and it has no balance transaction. Answers the Refund. */
|
|
560
|
+
export declare function releaseAuthorization(ctx: HandlerContext, ch: Row, operationId: string, given?: Row): Promise<Row>;
|
|
561
|
+
/** A PaymentIntent's authorization released by its cancel: "For PaymentIntents with a `status` of `requires_capture`, the
|
|
562
|
+
* remaining `amount_capturable` is automatically refunded" (docs.stripe.com/api/payment_intents/cancel), and since basil
|
|
563
|
+
* a cancellation makes no Refund: "`amount_captured` will be 0 instead of `nil` in payment cancellation flows",
|
|
564
|
+
* "`amount_refunded` will no longer be updated by these actions", "`refunded` will no longer be `true` for payment
|
|
565
|
+
* cancellation flows", and no charge.refunded is sent (docs.stripe.com/changelog/basil/2025-03-31/remove-refund-from-
|
|
566
|
+
* partial-capture-and-payment-cancellation-flow). The charge stays uncaptured; nothing is written as an event. */
|
|
567
|
+
export declare function cancelAuthorization(ctx: HandlerContext, ch: Row): Promise<Row>;
|
|
568
|
+
/**
|
|
569
|
+
* Create a refund and land it on its charge. An omitted amount is the whole remaining balance. The
|
|
570
|
+
* charge's write records `charge.refunded`, the event Stripe sends carrying the charge's new totals;
|
|
571
|
+
* `refunded` is true only at the full amount.
|
|
572
|
+
*/
|
|
573
|
+
/** A reason Stripe does not take (docs.stripe.com/api/refunds/create#create_refund-reason). */
|
|
574
|
+
export declare function badReason(ctx: HandlerContext): Response;
|
|
575
|
+
/** A bank-transfer payment refunded with origin=customer_balance goes back to the cash balance
|
|
576
|
+
* (docs.stripe.com/payments/customer-balance/refunding). */
|
|
577
|
+
export declare function backToCashBalance(ctx: HandlerContext, customer: string, currency: string, amount: number, refundId: string): Promise<void>;
|
|
578
|
+
/** A capture=false charge's refund, which releases its whole authorization (see the header). */
|
|
579
|
+
export declare function refundUncaptured(ctx: HandlerContext, charge: Row, amount: number, remaining: number, params: Row): Promise<Response>;
|
|
580
|
+
export declare function refundCharge(ctx: HandlerContext, charge: Row, params: Row): Promise<Response>;
|
|
581
|
+
/** The charge a refund aims at: named directly, or reached through its PaymentIntent. */
|
|
582
|
+
export declare function target(ctx: HandlerContext): Row | Response;
|
|
583
|
+
/** A pending invoice item contributes to a preview only on its customer's next invoice. */
|
|
584
|
+
export declare function pendingPreviewItem(ii: Row, customer: string, currency: string, now: number): Row | undefined;
|
|
585
|
+
export declare function pendingPreviewLines(ctx: HandlerContext, customer: string, currency: string, now: number): Row[];
|