@peable.to/contracts 5.3.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/resources/checkout/checkoutSessions.js +4 -0
- package/dist/cjs/resources/checkout/merchants.js +6 -1
- package/dist/cjs/resources/core/customers.js +14 -0
- package/dist/cjs/resources/payments/paymentIntents.js +7 -1
- package/dist/cjs/resources/payments/social.js +3 -1
- package/dist/cjs/vocabulary/checkout.js +2 -1
- package/dist/cjs/vocabulary/errors.js +1 -0
- package/dist/cjs/vocabulary/paymentMethodConfigurations.js +2 -1
- package/dist/cjs/vocabulary/payments.js +8 -1
- package/dist/esm/resources/checkout/checkoutSessions.js +4 -0
- package/dist/esm/resources/checkout/merchants.js +6 -1
- package/dist/esm/resources/core/customers.js +14 -0
- package/dist/esm/resources/payments/paymentIntents.js +8 -2
- package/dist/esm/resources/payments/social.js +3 -1
- package/dist/esm/vocabulary/checkout.js +2 -1
- package/dist/esm/vocabulary/errors.js +1 -0
- package/dist/esm/vocabulary/paymentMethodConfigurations.js +2 -1
- package/dist/esm/vocabulary/payments.js +7 -0
- package/dist/types/resources/checkout/checkoutSessions.d.ts +34 -0
- package/dist/types/resources/checkout/index.d.ts +17 -0
- package/dist/types/resources/core/customers.d.ts +170 -0
- package/dist/types/resources/core/index.d.ts +119 -0
- package/dist/types/vocabulary/checkout.d.ts +2 -1
- package/dist/types/vocabulary/errors.d.ts +1 -0
- package/dist/types/vocabulary/paymentMethodConfigurations.d.ts +2 -1
- package/dist/types/vocabulary/payments.d.ts +7 -0
- package/package.json +1 -1
|
@@ -474,6 +474,10 @@ exports.confirmCheckoutSessionPublicParams = zod_1.z
|
|
|
474
474
|
.enum(['card', 'faircoin'])
|
|
475
475
|
.optional()
|
|
476
476
|
.describe("How the payer pays: one of the session's `payment_method_types`. Default: the rail of the order's currency (`card` on a fiat order). `faircoin` on a fiat order quotes its total in FAIR for 10 minutes; confirming again with the other method replaces a payment that has not started moving money."),
|
|
477
|
+
locale: zod_1.z
|
|
478
|
+
.enum(checkout_1.CHECKOUT_LOCALES)
|
|
479
|
+
.optional()
|
|
480
|
+
.describe("The language the payer is completing checkout in. Recorded on the session (never on its `locale`) and given to a customer checkout creates as its `preferred_locales`; the session's emails are written in it when the customer has no preferred language."),
|
|
477
481
|
})
|
|
478
482
|
.strict();
|
|
479
483
|
/** `POST /v1/test_helpers/checkout_sessions/{id}/expire` takes nothing. */
|
|
@@ -73,7 +73,12 @@ const merchantDescription = zod_1.z.string().min(1).max(512);
|
|
|
73
73
|
*/
|
|
74
74
|
exports.registerMerchantParams = zod_1.z
|
|
75
75
|
.object({
|
|
76
|
-
required_confirmations: zod_1.z
|
|
76
|
+
required_confirmations: zod_1.z
|
|
77
|
+
.number()
|
|
78
|
+
.int()
|
|
79
|
+
.positive()
|
|
80
|
+
.optional()
|
|
81
|
+
.describe('Confirmations a FairCoin payment needs to succeed. Defaults to 6 for a live (mainnet) merchant, 1 on testnet.'),
|
|
77
82
|
display_name: displayName.optional(),
|
|
78
83
|
avatar_file_id: avatarFileId.optional(),
|
|
79
84
|
description: merchantDescription.optional(),
|
|
@@ -8,6 +8,7 @@ const objects_1 = require("../../common/objects");
|
|
|
8
8
|
const params_1 = require("../../common/params");
|
|
9
9
|
const primitives_1 = require("../../common/primitives");
|
|
10
10
|
const route_1 = require("../../route");
|
|
11
|
+
const checkout_1 = require("../../vocabulary/checkout");
|
|
11
12
|
/**
|
|
12
13
|
* Customers (`cus_…`) — Orbit's own object (ADR 0016). A provider customer is an
|
|
13
14
|
* internal binding created lazily, per mode, when a card payment method is
|
|
@@ -24,6 +25,9 @@ exports.customerSchema = (0, objects_1.defineObject)('customer', 'Customer', zod
|
|
|
24
25
|
description: zod_1.z.string().nullable(),
|
|
25
26
|
address: address_1.addressSchema.nullable(),
|
|
26
27
|
shipping: address_1.shippingSchema.nullable(),
|
|
28
|
+
preferred_locales: zod_1.z
|
|
29
|
+
.array(zod_1.z.enum(checkout_1.CHECKOUT_LOCALES))
|
|
30
|
+
.describe("The customer's preferred languages, most preferred first (Stripe's `preferred_locales`), from the payer locale set. Receipts, invoices and dunning emails are written in the first; empty when none is known. A customer Checkout creates gets the language the payer completed it in."),
|
|
27
31
|
invoice_settings: zod_1.z
|
|
28
32
|
.object({
|
|
29
33
|
default_payment_method: (0, objects_1.expandable)('payment_method', '`pm_…`, or the PaymentMethod with `expand[]=invoice_settings.default_payment_method`.').nullable(),
|
|
@@ -52,6 +56,7 @@ exports.customerSchema = (0, objects_1.defineObject)('customer', 'Customer', zod
|
|
|
52
56
|
description: null,
|
|
53
57
|
address: null,
|
|
54
58
|
shipping: null,
|
|
59
|
+
preferred_locales: ['fr', 'en'],
|
|
55
60
|
invoice_settings: { default_payment_method: null },
|
|
56
61
|
metadata: { order_id: '6735' },
|
|
57
62
|
balance: '0',
|
|
@@ -66,6 +71,11 @@ exports.deletedCustomerSchema = (0, objects_1.defineComponent)('DeletedCustomer'
|
|
|
66
71
|
const name = zod_1.z.string().max(500);
|
|
67
72
|
const phone = zod_1.z.string().max(40);
|
|
68
73
|
const description = zod_1.z.string().max(1000);
|
|
74
|
+
const preferredLocales = zod_1.z
|
|
75
|
+
.array(zod_1.z.enum(checkout_1.CHECKOUT_LOCALES))
|
|
76
|
+
.max(checkout_1.CHECKOUT_LOCALES.length)
|
|
77
|
+
.refine((locales) => new Set(locales).size === locales.length, 'a language is listed once')
|
|
78
|
+
.describe('Most preferred first, each once, from the payer locale set (`ar`, `bn`, `ca`, `de`, `en`, `es`, `fr`, `hi`, `id`, `it`, `ja`, `pt`, `ru`, `tr`, `zh`).');
|
|
69
79
|
exports.createCustomerParams = zod_1.z
|
|
70
80
|
.object({
|
|
71
81
|
email: address_1.emailParam.optional(),
|
|
@@ -74,6 +84,7 @@ exports.createCustomerParams = zod_1.z
|
|
|
74
84
|
description: description.optional(),
|
|
75
85
|
address: address_1.addressParams.optional(),
|
|
76
86
|
shipping: address_1.shippingParams.optional(),
|
|
87
|
+
preferred_locales: preferredLocales.optional(),
|
|
77
88
|
invoice_settings: zod_1.z.object({ default_payment_method: params_1.idParam.optional() }).strict().optional(),
|
|
78
89
|
metadata: params_1.metadataCreateParam.optional(),
|
|
79
90
|
test_clock: params_1.idParam
|
|
@@ -91,6 +102,9 @@ exports.updateCustomerParams = zod_1.z
|
|
|
91
102
|
description: (0, params_1.clearable)(description).optional(),
|
|
92
103
|
address: (0, params_1.clearable)(address_1.addressParams).optional(),
|
|
93
104
|
shipping: (0, params_1.clearable)(address_1.shippingParams).optional(),
|
|
105
|
+
preferred_locales: (0, params_1.clearable)(preferredLocales)
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Replaces the list; `[]` or `""` clears it.'),
|
|
94
108
|
invoice_settings: zod_1.z
|
|
95
109
|
.object({ default_payment_method: (0, params_1.clearable)(params_1.idParam).optional() })
|
|
96
110
|
.strict()
|
|
@@ -318,7 +318,13 @@ exports.createPaymentIntentParams = zod_1.z
|
|
|
318
318
|
...exports.railParams,
|
|
319
319
|
...exports.connectedAccountParam,
|
|
320
320
|
metadata: params_1.metadataCreateParam.optional(),
|
|
321
|
-
expires_in_seconds: zod_1.z
|
|
321
|
+
expires_in_seconds: zod_1.z
|
|
322
|
+
.number()
|
|
323
|
+
.int()
|
|
324
|
+
.positive()
|
|
325
|
+
.max(payments_1.PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS)
|
|
326
|
+
.optional()
|
|
327
|
+
.describe('How long the payment stays payable, in seconds: at most 86400 (24 hours). Defaults to 900 (15 minutes).'),
|
|
322
328
|
payment_method_types: zod_1.z
|
|
323
329
|
.array(zod_1.z.enum(payments_1.PAYMENT_METHOD_TYPES))
|
|
324
330
|
.min(1)
|
|
@@ -77,7 +77,9 @@ exports.socialNextAddressParams = zod_1.z
|
|
|
77
77
|
.strict();
|
|
78
78
|
exports.socialNextAddressSchema = (0, objects_1.defineComponent)('SocialNextAddress', zod_1.z
|
|
79
79
|
.object({
|
|
80
|
-
address: zod_1.z
|
|
80
|
+
address: zod_1.z
|
|
81
|
+
.string()
|
|
82
|
+
.describe("A single-use address of the recipient's: the one this sender already holds and has not paid, or a fresh one."),
|
|
81
83
|
index: zod_1.z.number().int().nonnegative().describe('Its social-receive derivation index.'),
|
|
82
84
|
})
|
|
83
85
|
.strict());
|
|
@@ -15,7 +15,8 @@ exports.checkoutLocaleDirection = checkoutLocaleDirection;
|
|
|
15
15
|
* - `faircoin_network_closed` — this deployment does not open payments on the
|
|
16
16
|
* order's FairCoin network yet (ADR 0002's gate);
|
|
17
17
|
* - `price_unavailable` — no fresh FairCoin price exists to quote a fiat order;
|
|
18
|
-
* - `temporarily_unavailable` — whether the wallet exists could not be checked
|
|
18
|
+
* - `temporarily_unavailable` — whether the wallet exists could not be checked, or every
|
|
19
|
+
* address the recipient can hold open is open (ADR 0021 D9) — try again shortly.
|
|
19
20
|
*/
|
|
20
21
|
exports.FAIRCOIN_UNAVAILABLE_REASONS = [
|
|
21
22
|
'faircoin_wallet_missing',
|
|
@@ -134,6 +134,7 @@ exports.ERROR_CODE_DESCRIPTIONS = {
|
|
|
134
134
|
faircoin_price_unavailable: 'No fresh FairCoin price exists right now, so this order cannot be quoted in FAIR. The other payment methods still work; try FairCoin again shortly.',
|
|
135
135
|
faircoin_wallet_missing: "The Peable wallet that receives this payment (the merchant owner's, or the seller's) isn't set up yet, so it cannot be paid in FairCoin. The other payment methods still work.",
|
|
136
136
|
faircoin_network_closed: 'FairCoin payments on this network are not open on this deployment yet. The other payment methods still work.',
|
|
137
|
+
faircoin_capacity_reached: 'Too many FairCoin payments to this recipient are waiting to be paid right now, so no new FairCoin address can be handed out. The other payment methods still work; try FairCoin again shortly.',
|
|
137
138
|
faircoin_amount_too_small: "One seller's share of this order is below the smallest amount the FairCoin network relays, so it cannot be paid in FairCoin. The other payment methods still work.",
|
|
138
139
|
credit_note_exceeds_invoice: "The credit note's amount exceeds what the invoice can still credit.",
|
|
139
140
|
test_clock_unexpected_state: 'The test clock is advancing; wait until it is ready.',
|
|
@@ -44,7 +44,8 @@ exports.PAYMENT_METHOD_CONFIGURATION_TYPES = [
|
|
|
44
44
|
* received (ADR 0021 D5); the owner sets it up in Peable;
|
|
45
45
|
* - `faircoin_network_closed` — the deployment does not open the merchant's
|
|
46
46
|
* FairCoin network yet (ADR 0002's gate);
|
|
47
|
-
* - `temporarily_unavailable` — the wallet could not be checked just now
|
|
47
|
+
* - `temporarily_unavailable` — the wallet could not be checked just now, or every
|
|
48
|
+
* address the recipient can hold open is open (ADR 0021 D9) — try again shortly.
|
|
48
49
|
*/
|
|
49
50
|
exports.PAYMENT_METHOD_UNAVAILABLE_REASONS = [
|
|
50
51
|
'provider_unsupported',
|
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
// contracts are built from. Zod-free, so the wallet and the shared types read
|
|
5
5
|
// them without bundling a schema.
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SIMULATED_FAIRCOIN_OUTCOMES = exports.ENRICH_MAX_ADDRESSES = exports.ENRICHMENT_KINDS = exports.SOCIAL_PAYMENT_DIRECTIONS = exports.SOCIAL_SOURCE_REF_MAX_LENGTH = exports.SOCIAL_SOURCE_APP_MAX_LENGTH = exports.SETUP_INTENT_CANCELLATION_REASONS = exports.SETUP_INTENT_USAGES = exports.SETUP_INTENT_STATUSES = exports.DISPUTE_EVIDENCE_TEXT_MAX = exports.DISPUTE_FILE_EVIDENCE_FIELDS = exports.DISPUTE_TEXT_EVIDENCE_FIELDS = exports.DISPUTE_REASONS = exports.DISPUTE_STATUSES = exports.SETTLEMENT_STATUSES = exports.REFUND_ORIGINS = exports.REFUND_REASONS = exports.REFUND_STATUSES = exports.CLIENT_ACTION_KINDS = exports.PAYMENT_ERROR_TYPES = exports.PAYMENT_METHOD_TYPES = exports.CARD_RAIL_PAYMENT_METHOD_TYPES = exports.PAYMENT_INTENT_SETUP_FUTURE_USAGES = exports.PAYMENT_INTENT_CAPTURE_METHODS = exports.MERCHANT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_STATUSES = exports.PAYMENT_INTENT_RAILS = void 0;
|
|
7
|
+
exports.SIMULATED_FAIRCOIN_OUTCOMES = exports.ENRICH_MAX_ADDRESSES = exports.ENRICHMENT_KINDS = exports.SOCIAL_PAYMENT_DIRECTIONS = exports.SOCIAL_SOURCE_REF_MAX_LENGTH = exports.SOCIAL_SOURCE_APP_MAX_LENGTH = exports.SETUP_INTENT_CANCELLATION_REASONS = exports.SETUP_INTENT_USAGES = exports.SETUP_INTENT_STATUSES = exports.DISPUTE_EVIDENCE_TEXT_MAX = exports.DISPUTE_FILE_EVIDENCE_FIELDS = exports.DISPUTE_TEXT_EVIDENCE_FIELDS = exports.DISPUTE_REASONS = exports.DISPUTE_STATUSES = exports.SETTLEMENT_STATUSES = exports.REFUND_ORIGINS = exports.REFUND_REASONS = exports.REFUND_STATUSES = exports.CLIENT_ACTION_KINDS = exports.PAYMENT_ERROR_TYPES = exports.PAYMENT_METHOD_TYPES = exports.CARD_RAIL_PAYMENT_METHOD_TYPES = exports.PAYMENT_INTENT_SETUP_FUTURE_USAGES = exports.PAYMENT_INTENT_CAPTURE_METHODS = exports.MERCHANT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_STATUSES = exports.PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS = exports.PAYMENT_INTENT_RAILS = void 0;
|
|
8
8
|
/**
|
|
9
9
|
* Which rail moves the money (ADR 0001 D1). On the INTENT, not on the merchant:
|
|
10
10
|
* one merchant takes both, and the rail decides which fields mean anything.
|
|
11
11
|
*/
|
|
12
12
|
exports.PAYMENT_INTENT_RAILS = ['faircoin', 'card'];
|
|
13
|
+
/**
|
|
14
|
+
* The longest a PaymentIntent created through the API may stay payable before
|
|
15
|
+
* it expires (`expires_in_seconds`): 24 hours. A FairCoin payment holds a
|
|
16
|
+
* reserved address in the recipient's wallet for as long as it is payable, so
|
|
17
|
+
* an unbounded expiry is an address nobody can ever recycle (ADR 0021 D9).
|
|
18
|
+
*/
|
|
19
|
+
exports.PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS = 24 * 60 * 60;
|
|
13
20
|
/**
|
|
14
21
|
* Stripe's seven statuses, and no others (ADR 0019). The FairCoin rail walks
|
|
15
22
|
* four of them (`requires_action` → `processing` → `succeeded` | `canceled`); a
|
|
@@ -471,6 +471,10 @@ export const confirmCheckoutSessionPublicParams = z
|
|
|
471
471
|
.enum(['card', 'faircoin'])
|
|
472
472
|
.optional()
|
|
473
473
|
.describe("How the payer pays: one of the session's `payment_method_types`. Default: the rail of the order's currency (`card` on a fiat order). `faircoin` on a fiat order quotes its total in FAIR for 10 minutes; confirming again with the other method replaces a payment that has not started moving money."),
|
|
474
|
+
locale: z
|
|
475
|
+
.enum(CHECKOUT_LOCALES)
|
|
476
|
+
.optional()
|
|
477
|
+
.describe("The language the payer is completing checkout in. Recorded on the session (never on its `locale`) and given to a customer checkout creates as its `preferred_locales`; the session's emails are written in it when the customer has no preferred language."),
|
|
474
478
|
})
|
|
475
479
|
.strict();
|
|
476
480
|
/** `POST /v1/test_helpers/checkout_sessions/{id}/expire` takes nothing. */
|
|
@@ -70,7 +70,12 @@ const merchantDescription = z.string().min(1).max(512);
|
|
|
70
70
|
*/
|
|
71
71
|
export const registerMerchantParams = z
|
|
72
72
|
.object({
|
|
73
|
-
required_confirmations: z
|
|
73
|
+
required_confirmations: z
|
|
74
|
+
.number()
|
|
75
|
+
.int()
|
|
76
|
+
.positive()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe('Confirmations a FairCoin payment needs to succeed. Defaults to 6 for a live (mainnet) merchant, 1 on testnet.'),
|
|
74
79
|
display_name: displayName.optional(),
|
|
75
80
|
avatar_file_id: avatarFileId.optional(),
|
|
76
81
|
description: merchantDescription.optional(),
|
|
@@ -5,6 +5,7 @@ import { defineComponent, defineObject, expandable } from '../../common/objects.
|
|
|
5
5
|
import { clearable, expandOnlyQuery, expandParam, idParam, listQuery, metadataCreateParam, metadataUpdateParam, searchQuery, } from '../../common/params.js';
|
|
6
6
|
import { currency, livemode, metadata, signedAmount, unixSeconds } from '../../common/primitives.js';
|
|
7
7
|
import { defineRoute } from '../../route.js';
|
|
8
|
+
import { CHECKOUT_LOCALES } from '../../vocabulary/checkout.js';
|
|
8
9
|
/**
|
|
9
10
|
* Customers (`cus_…`) — Orbit's own object (ADR 0016). A provider customer is an
|
|
10
11
|
* internal binding created lazily, per mode, when a card payment method is
|
|
@@ -21,6 +22,9 @@ export const customerSchema = defineObject('customer', 'Customer', z
|
|
|
21
22
|
description: z.string().nullable(),
|
|
22
23
|
address: addressSchema.nullable(),
|
|
23
24
|
shipping: shippingSchema.nullable(),
|
|
25
|
+
preferred_locales: z
|
|
26
|
+
.array(z.enum(CHECKOUT_LOCALES))
|
|
27
|
+
.describe("The customer's preferred languages, most preferred first (Stripe's `preferred_locales`), from the payer locale set. Receipts, invoices and dunning emails are written in the first; empty when none is known. A customer Checkout creates gets the language the payer completed it in."),
|
|
24
28
|
invoice_settings: z
|
|
25
29
|
.object({
|
|
26
30
|
default_payment_method: expandable('payment_method', '`pm_…`, or the PaymentMethod with `expand[]=invoice_settings.default_payment_method`.').nullable(),
|
|
@@ -49,6 +53,7 @@ export const customerSchema = defineObject('customer', 'Customer', z
|
|
|
49
53
|
description: null,
|
|
50
54
|
address: null,
|
|
51
55
|
shipping: null,
|
|
56
|
+
preferred_locales: ['fr', 'en'],
|
|
52
57
|
invoice_settings: { default_payment_method: null },
|
|
53
58
|
metadata: { order_id: '6735' },
|
|
54
59
|
balance: '0',
|
|
@@ -63,6 +68,11 @@ export const deletedCustomerSchema = defineComponent('DeletedCustomer', deletedO
|
|
|
63
68
|
const name = z.string().max(500);
|
|
64
69
|
const phone = z.string().max(40);
|
|
65
70
|
const description = z.string().max(1000);
|
|
71
|
+
const preferredLocales = z
|
|
72
|
+
.array(z.enum(CHECKOUT_LOCALES))
|
|
73
|
+
.max(CHECKOUT_LOCALES.length)
|
|
74
|
+
.refine((locales) => new Set(locales).size === locales.length, 'a language is listed once')
|
|
75
|
+
.describe('Most preferred first, each once, from the payer locale set (`ar`, `bn`, `ca`, `de`, `en`, `es`, `fr`, `hi`, `id`, `it`, `ja`, `pt`, `ru`, `tr`, `zh`).');
|
|
66
76
|
export const createCustomerParams = z
|
|
67
77
|
.object({
|
|
68
78
|
email: emailParam.optional(),
|
|
@@ -71,6 +81,7 @@ export const createCustomerParams = z
|
|
|
71
81
|
description: description.optional(),
|
|
72
82
|
address: addressParams.optional(),
|
|
73
83
|
shipping: shippingParams.optional(),
|
|
84
|
+
preferred_locales: preferredLocales.optional(),
|
|
74
85
|
invoice_settings: z.object({ default_payment_method: idParam.optional() }).strict().optional(),
|
|
75
86
|
metadata: metadataCreateParam.optional(),
|
|
76
87
|
test_clock: idParam
|
|
@@ -88,6 +99,9 @@ export const updateCustomerParams = z
|
|
|
88
99
|
description: clearable(description).optional(),
|
|
89
100
|
address: clearable(addressParams).optional(),
|
|
90
101
|
shipping: clearable(shippingParams).optional(),
|
|
102
|
+
preferred_locales: clearable(preferredLocales)
|
|
103
|
+
.optional()
|
|
104
|
+
.describe('Replaces the list; `[]` or `""` clears it.'),
|
|
91
105
|
invoice_settings: z
|
|
92
106
|
.object({ default_payment_method: clearable(idParam).optional() })
|
|
93
107
|
.strict()
|
|
@@ -6,7 +6,7 @@ import { clearable, expandParam, idParam, listQuery, metadataCreateParam, metada
|
|
|
6
6
|
import { amount, currency, fiatCurrency, livemode, metadata, network, nullableString, unixSeconds, } from '../../common/primitives.js';
|
|
7
7
|
import { defineRoute } from '../../route.js';
|
|
8
8
|
import { CURRENCY_CODES, isBaseUnitString, NETWORK_TYPES } from '../../vocabulary/money.js';
|
|
9
|
-
import { CARD_RAIL_PAYMENT_METHOD_TYPES, CLIENT_ACTION_KINDS, MERCHANT_CANCELLATION_REASONS, PAYMENT_ERROR_TYPES, PAYMENT_INTENT_CANCELLATION_REASONS, PAYMENT_INTENT_CAPTURE_METHODS, PAYMENT_INTENT_RAILS, PAYMENT_INTENT_SETUP_FUTURE_USAGES, PAYMENT_INTENT_STATUSES, PAYMENT_METHOD_TYPES, } from '../../vocabulary/payments.js';
|
|
9
|
+
import { CARD_RAIL_PAYMENT_METHOD_TYPES, CLIENT_ACTION_KINDS, MERCHANT_CANCELLATION_REASONS, PAYMENT_ERROR_TYPES, PAYMENT_INTENT_CANCELLATION_REASONS, PAYMENT_INTENT_CAPTURE_METHODS, PAYMENT_INTENT_RAILS, PAYMENT_INTENT_SETUP_FUTURE_USAGES, PAYMENT_INTENT_STATUSES, PAYMENT_METHOD_TYPES, PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS, } from '../../vocabulary/payments.js';
|
|
10
10
|
/**
|
|
11
11
|
* PaymentIntents (`pi_…`) — Stripe's PaymentIntent, at the root (ADR 0019):
|
|
12
12
|
* one status vocabulary over two rails, the non-custodial FairCoin lifecycle
|
|
@@ -315,7 +315,13 @@ export const createPaymentIntentParams = z
|
|
|
315
315
|
...railParams,
|
|
316
316
|
...connectedAccountParam,
|
|
317
317
|
metadata: metadataCreateParam.optional(),
|
|
318
|
-
expires_in_seconds: z
|
|
318
|
+
expires_in_seconds: z
|
|
319
|
+
.number()
|
|
320
|
+
.int()
|
|
321
|
+
.positive()
|
|
322
|
+
.max(PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS)
|
|
323
|
+
.optional()
|
|
324
|
+
.describe('How long the payment stays payable, in seconds: at most 86400 (24 hours). Defaults to 900 (15 minutes).'),
|
|
319
325
|
payment_method_types: z
|
|
320
326
|
.array(z.enum(PAYMENT_METHOD_TYPES))
|
|
321
327
|
.min(1)
|
|
@@ -74,7 +74,9 @@ export const socialNextAddressParams = z
|
|
|
74
74
|
.strict();
|
|
75
75
|
export const socialNextAddressSchema = defineComponent('SocialNextAddress', z
|
|
76
76
|
.object({
|
|
77
|
-
address: z
|
|
77
|
+
address: z
|
|
78
|
+
.string()
|
|
79
|
+
.describe("A single-use address of the recipient's: the one this sender already holds and has not paid, or a fresh one."),
|
|
78
80
|
index: z.number().int().nonnegative().describe('Its social-receive derivation index.'),
|
|
79
81
|
})
|
|
80
82
|
.strict());
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
* - `faircoin_network_closed` — this deployment does not open payments on the
|
|
12
12
|
* order's FairCoin network yet (ADR 0002's gate);
|
|
13
13
|
* - `price_unavailable` — no fresh FairCoin price exists to quote a fiat order;
|
|
14
|
-
* - `temporarily_unavailable` — whether the wallet exists could not be checked
|
|
14
|
+
* - `temporarily_unavailable` — whether the wallet exists could not be checked, or every
|
|
15
|
+
* address the recipient can hold open is open (ADR 0021 D9) — try again shortly.
|
|
15
16
|
*/
|
|
16
17
|
export const FAIRCOIN_UNAVAILABLE_REASONS = [
|
|
17
18
|
'faircoin_wallet_missing',
|
|
@@ -129,6 +129,7 @@ export const ERROR_CODE_DESCRIPTIONS = {
|
|
|
129
129
|
faircoin_price_unavailable: 'No fresh FairCoin price exists right now, so this order cannot be quoted in FAIR. The other payment methods still work; try FairCoin again shortly.',
|
|
130
130
|
faircoin_wallet_missing: "The Peable wallet that receives this payment (the merchant owner's, or the seller's) isn't set up yet, so it cannot be paid in FairCoin. The other payment methods still work.",
|
|
131
131
|
faircoin_network_closed: 'FairCoin payments on this network are not open on this deployment yet. The other payment methods still work.',
|
|
132
|
+
faircoin_capacity_reached: 'Too many FairCoin payments to this recipient are waiting to be paid right now, so no new FairCoin address can be handed out. The other payment methods still work; try FairCoin again shortly.',
|
|
132
133
|
faircoin_amount_too_small: "One seller's share of this order is below the smallest amount the FairCoin network relays, so it cannot be paid in FairCoin. The other payment methods still work.",
|
|
133
134
|
credit_note_exceeds_invoice: "The credit note's amount exceeds what the invoice can still credit.",
|
|
134
135
|
test_clock_unexpected_state: 'The test clock is advancing; wait until it is ready.',
|
|
@@ -41,7 +41,8 @@ export const PAYMENT_METHOD_CONFIGURATION_TYPES = [
|
|
|
41
41
|
* received (ADR 0021 D5); the owner sets it up in Peable;
|
|
42
42
|
* - `faircoin_network_closed` — the deployment does not open the merchant's
|
|
43
43
|
* FairCoin network yet (ADR 0002's gate);
|
|
44
|
-
* - `temporarily_unavailable` — the wallet could not be checked just now
|
|
44
|
+
* - `temporarily_unavailable` — the wallet could not be checked just now, or every
|
|
45
|
+
* address the recipient can hold open is open (ADR 0021 D9) — try again shortly.
|
|
45
46
|
*/
|
|
46
47
|
export const PAYMENT_METHOD_UNAVAILABLE_REASONS = [
|
|
47
48
|
'provider_unsupported',
|
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
* one merchant takes both, and the rail decides which fields mean anything.
|
|
8
8
|
*/
|
|
9
9
|
export const PAYMENT_INTENT_RAILS = ['faircoin', 'card'];
|
|
10
|
+
/**
|
|
11
|
+
* The longest a PaymentIntent created through the API may stay payable before
|
|
12
|
+
* it expires (`expires_in_seconds`): 24 hours. A FairCoin payment holds a
|
|
13
|
+
* reserved address in the recipient's wallet for as long as it is payable, so
|
|
14
|
+
* an unbounded expiry is an address nobody can ever recycle (ADR 0021 D9).
|
|
15
|
+
*/
|
|
16
|
+
export const PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS = 24 * 60 * 60;
|
|
10
17
|
/**
|
|
11
18
|
* Stripe's seven statuses, and no others (ADR 0019). The FairCoin rail walks
|
|
12
19
|
* four of them (`requires_action` → `processing` → `succeeded` | `canceled`); a
|
|
@@ -873,6 +873,23 @@ export declare const confirmCheckoutSessionPublicParams: z.ZodObject<{
|
|
|
873
873
|
card: "card";
|
|
874
874
|
faircoin: "faircoin";
|
|
875
875
|
}>>;
|
|
876
|
+
locale: z.ZodOptional<z.ZodEnum<{
|
|
877
|
+
id: "id";
|
|
878
|
+
ar: "ar";
|
|
879
|
+
bn: "bn";
|
|
880
|
+
ca: "ca";
|
|
881
|
+
de: "de";
|
|
882
|
+
en: "en";
|
|
883
|
+
es: "es";
|
|
884
|
+
fr: "fr";
|
|
885
|
+
hi: "hi";
|
|
886
|
+
it: "it";
|
|
887
|
+
ja: "ja";
|
|
888
|
+
pt: "pt";
|
|
889
|
+
ru: "ru";
|
|
890
|
+
tr: "tr";
|
|
891
|
+
zh: "zh";
|
|
892
|
+
}>>;
|
|
876
893
|
}, z.core.$strict>;
|
|
877
894
|
export type ConfirmCheckoutSessionPublicParams = z.input<typeof confirmCheckoutSessionPublicParams>;
|
|
878
895
|
/** `POST /v1/test_helpers/checkout_sessions/{id}/expire` takes nothing. */
|
|
@@ -2856,6 +2873,23 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
2856
2873
|
card: "card";
|
|
2857
2874
|
faircoin: "faircoin";
|
|
2858
2875
|
}>>;
|
|
2876
|
+
locale: z.ZodOptional<z.ZodEnum<{
|
|
2877
|
+
id: "id";
|
|
2878
|
+
ar: "ar";
|
|
2879
|
+
bn: "bn";
|
|
2880
|
+
ca: "ca";
|
|
2881
|
+
de: "de";
|
|
2882
|
+
en: "en";
|
|
2883
|
+
es: "es";
|
|
2884
|
+
fr: "fr";
|
|
2885
|
+
hi: "hi";
|
|
2886
|
+
it: "it";
|
|
2887
|
+
ja: "ja";
|
|
2888
|
+
pt: "pt";
|
|
2889
|
+
ru: "ru";
|
|
2890
|
+
tr: "tr";
|
|
2891
|
+
zh: "zh";
|
|
2892
|
+
}>>;
|
|
2859
2893
|
}, z.core.$strict>;
|
|
2860
2894
|
readonly response: z.ZodObject<{
|
|
2861
2895
|
line_items: z.ZodArray<z.ZodObject<{
|
|
@@ -1985,6 +1985,23 @@ export declare const checkoutRoutes: readonly [{
|
|
|
1985
1985
|
card: "card";
|
|
1986
1986
|
faircoin: "faircoin";
|
|
1987
1987
|
}>>;
|
|
1988
|
+
locale: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1989
|
+
id: "id";
|
|
1990
|
+
ar: "ar";
|
|
1991
|
+
bn: "bn";
|
|
1992
|
+
ca: "ca";
|
|
1993
|
+
de: "de";
|
|
1994
|
+
en: "en";
|
|
1995
|
+
es: "es";
|
|
1996
|
+
fr: "fr";
|
|
1997
|
+
hi: "hi";
|
|
1998
|
+
it: "it";
|
|
1999
|
+
ja: "ja";
|
|
2000
|
+
pt: "pt";
|
|
2001
|
+
ru: "ru";
|
|
2002
|
+
tr: "tr";
|
|
2003
|
+
zh: "zh";
|
|
2004
|
+
}>>;
|
|
1988
2005
|
}, import("zod/v4/core").$strict>;
|
|
1989
2006
|
readonly response: import("zod").ZodObject<{
|
|
1990
2007
|
line_items: import("zod").ZodArray<import("zod").ZodObject<{
|
|
@@ -35,6 +35,23 @@ export declare const customerSchema: z.ZodObject<{
|
|
|
35
35
|
carrier: z.ZodNullable<z.ZodString>;
|
|
36
36
|
tracking_number: z.ZodNullable<z.ZodString>;
|
|
37
37
|
}, z.core.$strict>>;
|
|
38
|
+
preferred_locales: z.ZodArray<z.ZodEnum<{
|
|
39
|
+
id: "id";
|
|
40
|
+
ar: "ar";
|
|
41
|
+
bn: "bn";
|
|
42
|
+
ca: "ca";
|
|
43
|
+
de: "de";
|
|
44
|
+
en: "en";
|
|
45
|
+
es: "es";
|
|
46
|
+
fr: "fr";
|
|
47
|
+
hi: "hi";
|
|
48
|
+
it: "it";
|
|
49
|
+
ja: "ja";
|
|
50
|
+
pt: "pt";
|
|
51
|
+
ru: "ru";
|
|
52
|
+
tr: "tr";
|
|
53
|
+
zh: "zh";
|
|
54
|
+
}>>;
|
|
38
55
|
invoice_settings: z.ZodObject<{
|
|
39
56
|
default_payment_method: z.ZodNullable<z.ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, z.core.$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
40
57
|
}, z.core.$strict>;
|
|
@@ -98,6 +115,23 @@ export declare const createCustomerParams: z.ZodObject<{
|
|
|
98
115
|
carrier: z.ZodOptional<z.ZodString>;
|
|
99
116
|
tracking_number: z.ZodOptional<z.ZodString>;
|
|
100
117
|
}, z.core.$strict>>;
|
|
118
|
+
preferred_locales: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
119
|
+
id: "id";
|
|
120
|
+
ar: "ar";
|
|
121
|
+
bn: "bn";
|
|
122
|
+
ca: "ca";
|
|
123
|
+
de: "de";
|
|
124
|
+
en: "en";
|
|
125
|
+
es: "es";
|
|
126
|
+
fr: "fr";
|
|
127
|
+
hi: "hi";
|
|
128
|
+
it: "it";
|
|
129
|
+
ja: "ja";
|
|
130
|
+
pt: "pt";
|
|
131
|
+
ru: "ru";
|
|
132
|
+
tr: "tr";
|
|
133
|
+
zh: "zh";
|
|
134
|
+
}>>>;
|
|
101
135
|
invoice_settings: z.ZodOptional<z.ZodObject<{
|
|
102
136
|
default_payment_method: z.ZodOptional<z.ZodString>;
|
|
103
137
|
}, z.core.$strict>>;
|
|
@@ -134,6 +168,23 @@ export declare const updateCustomerParams: z.ZodObject<{
|
|
|
134
168
|
carrier: z.ZodOptional<z.ZodString>;
|
|
135
169
|
tracking_number: z.ZodOptional<z.ZodString>;
|
|
136
170
|
}, z.core.$strict>, z.ZodLiteral<"">]>>;
|
|
171
|
+
preferred_locales: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{
|
|
172
|
+
id: "id";
|
|
173
|
+
ar: "ar";
|
|
174
|
+
bn: "bn";
|
|
175
|
+
ca: "ca";
|
|
176
|
+
de: "de";
|
|
177
|
+
en: "en";
|
|
178
|
+
es: "es";
|
|
179
|
+
fr: "fr";
|
|
180
|
+
hi: "hi";
|
|
181
|
+
it: "it";
|
|
182
|
+
ja: "ja";
|
|
183
|
+
pt: "pt";
|
|
184
|
+
ru: "ru";
|
|
185
|
+
tr: "tr";
|
|
186
|
+
zh: "zh";
|
|
187
|
+
}>>, z.ZodLiteral<"">]>>;
|
|
137
188
|
invoice_settings: z.ZodOptional<z.ZodObject<{
|
|
138
189
|
default_payment_method: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"">]>>;
|
|
139
190
|
}, z.core.$strict>>;
|
|
@@ -196,6 +247,23 @@ export declare const customerRoutes: readonly [{
|
|
|
196
247
|
carrier: z.ZodOptional<z.ZodString>;
|
|
197
248
|
tracking_number: z.ZodOptional<z.ZodString>;
|
|
198
249
|
}, z.core.$strict>>;
|
|
250
|
+
preferred_locales: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
251
|
+
id: "id";
|
|
252
|
+
ar: "ar";
|
|
253
|
+
bn: "bn";
|
|
254
|
+
ca: "ca";
|
|
255
|
+
de: "de";
|
|
256
|
+
en: "en";
|
|
257
|
+
es: "es";
|
|
258
|
+
fr: "fr";
|
|
259
|
+
hi: "hi";
|
|
260
|
+
it: "it";
|
|
261
|
+
ja: "ja";
|
|
262
|
+
pt: "pt";
|
|
263
|
+
ru: "ru";
|
|
264
|
+
tr: "tr";
|
|
265
|
+
zh: "zh";
|
|
266
|
+
}>>>;
|
|
199
267
|
invoice_settings: z.ZodOptional<z.ZodObject<{
|
|
200
268
|
default_payment_method: z.ZodOptional<z.ZodString>;
|
|
201
269
|
}, z.core.$strict>>;
|
|
@@ -233,6 +301,23 @@ export declare const customerRoutes: readonly [{
|
|
|
233
301
|
carrier: z.ZodNullable<z.ZodString>;
|
|
234
302
|
tracking_number: z.ZodNullable<z.ZodString>;
|
|
235
303
|
}, z.core.$strict>>;
|
|
304
|
+
preferred_locales: z.ZodArray<z.ZodEnum<{
|
|
305
|
+
id: "id";
|
|
306
|
+
ar: "ar";
|
|
307
|
+
bn: "bn";
|
|
308
|
+
ca: "ca";
|
|
309
|
+
de: "de";
|
|
310
|
+
en: "en";
|
|
311
|
+
es: "es";
|
|
312
|
+
fr: "fr";
|
|
313
|
+
hi: "hi";
|
|
314
|
+
it: "it";
|
|
315
|
+
ja: "ja";
|
|
316
|
+
pt: "pt";
|
|
317
|
+
ru: "ru";
|
|
318
|
+
tr: "tr";
|
|
319
|
+
zh: "zh";
|
|
320
|
+
}>>;
|
|
236
321
|
invoice_settings: z.ZodObject<{
|
|
237
322
|
default_payment_method: z.ZodNullable<z.ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, z.core.$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
238
323
|
}, z.core.$strict>;
|
|
@@ -318,6 +403,23 @@ export declare const customerRoutes: readonly [{
|
|
|
318
403
|
carrier: z.ZodNullable<z.ZodString>;
|
|
319
404
|
tracking_number: z.ZodNullable<z.ZodString>;
|
|
320
405
|
}, z.core.$strict>>;
|
|
406
|
+
preferred_locales: z.ZodArray<z.ZodEnum<{
|
|
407
|
+
id: "id";
|
|
408
|
+
ar: "ar";
|
|
409
|
+
bn: "bn";
|
|
410
|
+
ca: "ca";
|
|
411
|
+
de: "de";
|
|
412
|
+
en: "en";
|
|
413
|
+
es: "es";
|
|
414
|
+
fr: "fr";
|
|
415
|
+
hi: "hi";
|
|
416
|
+
it: "it";
|
|
417
|
+
ja: "ja";
|
|
418
|
+
pt: "pt";
|
|
419
|
+
ru: "ru";
|
|
420
|
+
tr: "tr";
|
|
421
|
+
zh: "zh";
|
|
422
|
+
}>>;
|
|
321
423
|
invoice_settings: z.ZodObject<{
|
|
322
424
|
default_payment_method: z.ZodNullable<z.ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, z.core.$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
323
425
|
}, z.core.$strict>;
|
|
@@ -391,6 +493,23 @@ export declare const customerRoutes: readonly [{
|
|
|
391
493
|
carrier: z.ZodNullable<z.ZodString>;
|
|
392
494
|
tracking_number: z.ZodNullable<z.ZodString>;
|
|
393
495
|
}, z.core.$strict>>;
|
|
496
|
+
preferred_locales: z.ZodArray<z.ZodEnum<{
|
|
497
|
+
id: "id";
|
|
498
|
+
ar: "ar";
|
|
499
|
+
bn: "bn";
|
|
500
|
+
ca: "ca";
|
|
501
|
+
de: "de";
|
|
502
|
+
en: "en";
|
|
503
|
+
es: "es";
|
|
504
|
+
fr: "fr";
|
|
505
|
+
hi: "hi";
|
|
506
|
+
it: "it";
|
|
507
|
+
ja: "ja";
|
|
508
|
+
pt: "pt";
|
|
509
|
+
ru: "ru";
|
|
510
|
+
tr: "tr";
|
|
511
|
+
zh: "zh";
|
|
512
|
+
}>>;
|
|
394
513
|
invoice_settings: z.ZodObject<{
|
|
395
514
|
default_payment_method: z.ZodNullable<z.ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, z.core.$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
396
515
|
}, z.core.$strict>;
|
|
@@ -460,6 +579,23 @@ export declare const customerRoutes: readonly [{
|
|
|
460
579
|
carrier: z.ZodOptional<z.ZodString>;
|
|
461
580
|
tracking_number: z.ZodOptional<z.ZodString>;
|
|
462
581
|
}, z.core.$strict>, z.ZodLiteral<"">]>>;
|
|
582
|
+
preferred_locales: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{
|
|
583
|
+
id: "id";
|
|
584
|
+
ar: "ar";
|
|
585
|
+
bn: "bn";
|
|
586
|
+
ca: "ca";
|
|
587
|
+
de: "de";
|
|
588
|
+
en: "en";
|
|
589
|
+
es: "es";
|
|
590
|
+
fr: "fr";
|
|
591
|
+
hi: "hi";
|
|
592
|
+
it: "it";
|
|
593
|
+
ja: "ja";
|
|
594
|
+
pt: "pt";
|
|
595
|
+
ru: "ru";
|
|
596
|
+
tr: "tr";
|
|
597
|
+
zh: "zh";
|
|
598
|
+
}>>, z.ZodLiteral<"">]>>;
|
|
463
599
|
invoice_settings: z.ZodOptional<z.ZodObject<{
|
|
464
600
|
default_payment_method: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"">]>>;
|
|
465
601
|
}, z.core.$strict>>;
|
|
@@ -496,6 +632,23 @@ export declare const customerRoutes: readonly [{
|
|
|
496
632
|
carrier: z.ZodNullable<z.ZodString>;
|
|
497
633
|
tracking_number: z.ZodNullable<z.ZodString>;
|
|
498
634
|
}, z.core.$strict>>;
|
|
635
|
+
preferred_locales: z.ZodArray<z.ZodEnum<{
|
|
636
|
+
id: "id";
|
|
637
|
+
ar: "ar";
|
|
638
|
+
bn: "bn";
|
|
639
|
+
ca: "ca";
|
|
640
|
+
de: "de";
|
|
641
|
+
en: "en";
|
|
642
|
+
es: "es";
|
|
643
|
+
fr: "fr";
|
|
644
|
+
hi: "hi";
|
|
645
|
+
it: "it";
|
|
646
|
+
ja: "ja";
|
|
647
|
+
pt: "pt";
|
|
648
|
+
ru: "ru";
|
|
649
|
+
tr: "tr";
|
|
650
|
+
zh: "zh";
|
|
651
|
+
}>>;
|
|
499
652
|
invoice_settings: z.ZodObject<{
|
|
500
653
|
default_payment_method: z.ZodNullable<z.ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, z.core.$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
501
654
|
}, z.core.$strict>;
|
|
@@ -586,6 +739,23 @@ export declare const customerRoutes: readonly [{
|
|
|
586
739
|
carrier: z.ZodNullable<z.ZodString>;
|
|
587
740
|
tracking_number: z.ZodNullable<z.ZodString>;
|
|
588
741
|
}, z.core.$strict>>;
|
|
742
|
+
preferred_locales: z.ZodArray<z.ZodEnum<{
|
|
743
|
+
id: "id";
|
|
744
|
+
ar: "ar";
|
|
745
|
+
bn: "bn";
|
|
746
|
+
ca: "ca";
|
|
747
|
+
de: "de";
|
|
748
|
+
en: "en";
|
|
749
|
+
es: "es";
|
|
750
|
+
fr: "fr";
|
|
751
|
+
hi: "hi";
|
|
752
|
+
it: "it";
|
|
753
|
+
ja: "ja";
|
|
754
|
+
pt: "pt";
|
|
755
|
+
ru: "ru";
|
|
756
|
+
tr: "tr";
|
|
757
|
+
zh: "zh";
|
|
758
|
+
}>>;
|
|
589
759
|
invoice_settings: z.ZodObject<{
|
|
590
760
|
default_payment_method: z.ZodNullable<z.ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, z.core.$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
591
761
|
}, z.core.$strict>;
|
|
@@ -37,6 +37,23 @@ export declare const coreRoutes: readonly [{
|
|
|
37
37
|
carrier: import("zod").ZodOptional<import("zod").ZodString>;
|
|
38
38
|
tracking_number: import("zod").ZodOptional<import("zod").ZodString>;
|
|
39
39
|
}, import("zod/v4/core").$strict>>;
|
|
40
|
+
preferred_locales: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
41
|
+
id: "id";
|
|
42
|
+
ar: "ar";
|
|
43
|
+
bn: "bn";
|
|
44
|
+
ca: "ca";
|
|
45
|
+
de: "de";
|
|
46
|
+
en: "en";
|
|
47
|
+
es: "es";
|
|
48
|
+
fr: "fr";
|
|
49
|
+
hi: "hi";
|
|
50
|
+
it: "it";
|
|
51
|
+
ja: "ja";
|
|
52
|
+
pt: "pt";
|
|
53
|
+
ru: "ru";
|
|
54
|
+
tr: "tr";
|
|
55
|
+
zh: "zh";
|
|
56
|
+
}>>>;
|
|
40
57
|
invoice_settings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
41
58
|
default_payment_method: import("zod").ZodOptional<import("zod").ZodString>;
|
|
42
59
|
}, import("zod/v4/core").$strict>>;
|
|
@@ -74,6 +91,23 @@ export declare const coreRoutes: readonly [{
|
|
|
74
91
|
carrier: import("zod").ZodNullable<import("zod").ZodString>;
|
|
75
92
|
tracking_number: import("zod").ZodNullable<import("zod").ZodString>;
|
|
76
93
|
}, import("zod/v4/core").$strict>>;
|
|
94
|
+
preferred_locales: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
95
|
+
id: "id";
|
|
96
|
+
ar: "ar";
|
|
97
|
+
bn: "bn";
|
|
98
|
+
ca: "ca";
|
|
99
|
+
de: "de";
|
|
100
|
+
en: "en";
|
|
101
|
+
es: "es";
|
|
102
|
+
fr: "fr";
|
|
103
|
+
hi: "hi";
|
|
104
|
+
it: "it";
|
|
105
|
+
ja: "ja";
|
|
106
|
+
pt: "pt";
|
|
107
|
+
ru: "ru";
|
|
108
|
+
tr: "tr";
|
|
109
|
+
zh: "zh";
|
|
110
|
+
}>>;
|
|
77
111
|
invoice_settings: import("zod").ZodObject<{
|
|
78
112
|
default_payment_method: import("zod").ZodNullable<import("zod").ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, import("zod/v4/core").$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
79
113
|
}, import("zod/v4/core").$strict>;
|
|
@@ -159,6 +193,23 @@ export declare const coreRoutes: readonly [{
|
|
|
159
193
|
carrier: import("zod").ZodNullable<import("zod").ZodString>;
|
|
160
194
|
tracking_number: import("zod").ZodNullable<import("zod").ZodString>;
|
|
161
195
|
}, import("zod/v4/core").$strict>>;
|
|
196
|
+
preferred_locales: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
197
|
+
id: "id";
|
|
198
|
+
ar: "ar";
|
|
199
|
+
bn: "bn";
|
|
200
|
+
ca: "ca";
|
|
201
|
+
de: "de";
|
|
202
|
+
en: "en";
|
|
203
|
+
es: "es";
|
|
204
|
+
fr: "fr";
|
|
205
|
+
hi: "hi";
|
|
206
|
+
it: "it";
|
|
207
|
+
ja: "ja";
|
|
208
|
+
pt: "pt";
|
|
209
|
+
ru: "ru";
|
|
210
|
+
tr: "tr";
|
|
211
|
+
zh: "zh";
|
|
212
|
+
}>>;
|
|
162
213
|
invoice_settings: import("zod").ZodObject<{
|
|
163
214
|
default_payment_method: import("zod").ZodNullable<import("zod").ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, import("zod/v4/core").$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
164
215
|
}, import("zod/v4/core").$strict>;
|
|
@@ -232,6 +283,23 @@ export declare const coreRoutes: readonly [{
|
|
|
232
283
|
carrier: import("zod").ZodNullable<import("zod").ZodString>;
|
|
233
284
|
tracking_number: import("zod").ZodNullable<import("zod").ZodString>;
|
|
234
285
|
}, import("zod/v4/core").$strict>>;
|
|
286
|
+
preferred_locales: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
287
|
+
id: "id";
|
|
288
|
+
ar: "ar";
|
|
289
|
+
bn: "bn";
|
|
290
|
+
ca: "ca";
|
|
291
|
+
de: "de";
|
|
292
|
+
en: "en";
|
|
293
|
+
es: "es";
|
|
294
|
+
fr: "fr";
|
|
295
|
+
hi: "hi";
|
|
296
|
+
it: "it";
|
|
297
|
+
ja: "ja";
|
|
298
|
+
pt: "pt";
|
|
299
|
+
ru: "ru";
|
|
300
|
+
tr: "tr";
|
|
301
|
+
zh: "zh";
|
|
302
|
+
}>>;
|
|
235
303
|
invoice_settings: import("zod").ZodObject<{
|
|
236
304
|
default_payment_method: import("zod").ZodNullable<import("zod").ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, import("zod/v4/core").$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
237
305
|
}, import("zod/v4/core").$strict>;
|
|
@@ -301,6 +369,23 @@ export declare const coreRoutes: readonly [{
|
|
|
301
369
|
carrier: import("zod").ZodOptional<import("zod").ZodString>;
|
|
302
370
|
tracking_number: import("zod").ZodOptional<import("zod").ZodString>;
|
|
303
371
|
}, import("zod/v4/core").$strict>, import("zod").ZodLiteral<"">]>>;
|
|
372
|
+
preferred_locales: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodArray<import("zod").ZodEnum<{
|
|
373
|
+
id: "id";
|
|
374
|
+
ar: "ar";
|
|
375
|
+
bn: "bn";
|
|
376
|
+
ca: "ca";
|
|
377
|
+
de: "de";
|
|
378
|
+
en: "en";
|
|
379
|
+
es: "es";
|
|
380
|
+
fr: "fr";
|
|
381
|
+
hi: "hi";
|
|
382
|
+
it: "it";
|
|
383
|
+
ja: "ja";
|
|
384
|
+
pt: "pt";
|
|
385
|
+
ru: "ru";
|
|
386
|
+
tr: "tr";
|
|
387
|
+
zh: "zh";
|
|
388
|
+
}>>, import("zod").ZodLiteral<"">]>>;
|
|
304
389
|
invoice_settings: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
305
390
|
default_payment_method: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<"">]>>;
|
|
306
391
|
}, import("zod/v4/core").$strict>>;
|
|
@@ -337,6 +422,23 @@ export declare const coreRoutes: readonly [{
|
|
|
337
422
|
carrier: import("zod").ZodNullable<import("zod").ZodString>;
|
|
338
423
|
tracking_number: import("zod").ZodNullable<import("zod").ZodString>;
|
|
339
424
|
}, import("zod/v4/core").$strict>>;
|
|
425
|
+
preferred_locales: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
426
|
+
id: "id";
|
|
427
|
+
ar: "ar";
|
|
428
|
+
bn: "bn";
|
|
429
|
+
ca: "ca";
|
|
430
|
+
de: "de";
|
|
431
|
+
en: "en";
|
|
432
|
+
es: "es";
|
|
433
|
+
fr: "fr";
|
|
434
|
+
hi: "hi";
|
|
435
|
+
it: "it";
|
|
436
|
+
ja: "ja";
|
|
437
|
+
pt: "pt";
|
|
438
|
+
ru: "ru";
|
|
439
|
+
tr: "tr";
|
|
440
|
+
zh: "zh";
|
|
441
|
+
}>>;
|
|
340
442
|
invoice_settings: import("zod").ZodObject<{
|
|
341
443
|
default_payment_method: import("zod").ZodNullable<import("zod").ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, import("zod/v4/core").$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
342
444
|
}, import("zod/v4/core").$strict>;
|
|
@@ -427,6 +529,23 @@ export declare const coreRoutes: readonly [{
|
|
|
427
529
|
carrier: import("zod").ZodNullable<import("zod").ZodString>;
|
|
428
530
|
tracking_number: import("zod").ZodNullable<import("zod").ZodString>;
|
|
429
531
|
}, import("zod/v4/core").$strict>>;
|
|
532
|
+
preferred_locales: import("zod").ZodArray<import("zod").ZodEnum<{
|
|
533
|
+
id: "id";
|
|
534
|
+
ar: "ar";
|
|
535
|
+
bn: "bn";
|
|
536
|
+
ca: "ca";
|
|
537
|
+
de: "de";
|
|
538
|
+
en: "en";
|
|
539
|
+
es: "es";
|
|
540
|
+
fr: "fr";
|
|
541
|
+
hi: "hi";
|
|
542
|
+
it: "it";
|
|
543
|
+
ja: "ja";
|
|
544
|
+
pt: "pt";
|
|
545
|
+
ru: "ru";
|
|
546
|
+
tr: "tr";
|
|
547
|
+
zh: "zh";
|
|
548
|
+
}>>;
|
|
430
549
|
invoice_settings: import("zod").ZodObject<{
|
|
431
550
|
default_payment_method: import("zod").ZodNullable<import("zod").ZodType<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">, import("zod/v4/core").$ZodTypeInternals<string | import("../..").Ref<"payment_method">, string | import("../..").Ref<"payment_method">>>>;
|
|
432
551
|
}, import("zod/v4/core").$strict>;
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* - `faircoin_network_closed` — this deployment does not open payments on the
|
|
8
8
|
* order's FairCoin network yet (ADR 0002's gate);
|
|
9
9
|
* - `price_unavailable` — no fresh FairCoin price exists to quote a fiat order;
|
|
10
|
-
* - `temporarily_unavailable` — whether the wallet exists could not be checked
|
|
10
|
+
* - `temporarily_unavailable` — whether the wallet exists could not be checked, or every
|
|
11
|
+
* address the recipient can hold open is open (ADR 0021 D9) — try again shortly.
|
|
11
12
|
*/
|
|
12
13
|
export declare const FAIRCOIN_UNAVAILABLE_REASONS: readonly ["faircoin_wallet_missing", "faircoin_network_closed", "price_unavailable", "temporarily_unavailable"];
|
|
13
14
|
export type FaircoinUnavailableReason = (typeof FAIRCOIN_UNAVAILABLE_REASONS)[number];
|
|
@@ -108,6 +108,7 @@ export declare const ERROR_CODE_DESCRIPTIONS: {
|
|
|
108
108
|
readonly faircoin_price_unavailable: "No fresh FairCoin price exists right now, so this order cannot be quoted in FAIR. The other payment methods still work; try FairCoin again shortly.";
|
|
109
109
|
readonly faircoin_wallet_missing: "The Peable wallet that receives this payment (the merchant owner's, or the seller's) isn't set up yet, so it cannot be paid in FairCoin. The other payment methods still work.";
|
|
110
110
|
readonly faircoin_network_closed: "FairCoin payments on this network are not open on this deployment yet. The other payment methods still work.";
|
|
111
|
+
readonly faircoin_capacity_reached: "Too many FairCoin payments to this recipient are waiting to be paid right now, so no new FairCoin address can be handed out. The other payment methods still work; try FairCoin again shortly.";
|
|
111
112
|
readonly faircoin_amount_too_small: "One seller's share of this order is below the smallest amount the FairCoin network relays, so it cannot be paid in FairCoin. The other payment methods still work.";
|
|
112
113
|
readonly credit_note_exceeds_invoice: "The credit note's amount exceeds what the invoice can still credit.";
|
|
113
114
|
readonly test_clock_unexpected_state: "The test clock is advancing; wait until it is ready.";
|
|
@@ -30,7 +30,8 @@ export type PaymentMethodConfigurationType = (typeof PAYMENT_METHOD_CONFIGURATIO
|
|
|
30
30
|
* received (ADR 0021 D5); the owner sets it up in Peable;
|
|
31
31
|
* - `faircoin_network_closed` — the deployment does not open the merchant's
|
|
32
32
|
* FairCoin network yet (ADR 0002's gate);
|
|
33
|
-
* - `temporarily_unavailable` — the wallet could not be checked just now
|
|
33
|
+
* - `temporarily_unavailable` — the wallet could not be checked just now, or every
|
|
34
|
+
* address the recipient can hold open is open (ADR 0021 D9) — try again shortly.
|
|
34
35
|
*/
|
|
35
36
|
export declare const PAYMENT_METHOD_UNAVAILABLE_REASONS: readonly ["provider_unsupported", "requires_card", "faircoin_wallet_missing", "faircoin_network_closed", "temporarily_unavailable"];
|
|
36
37
|
export type PaymentMethodUnavailableReason = (typeof PAYMENT_METHOD_UNAVAILABLE_REASONS)[number];
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const PAYMENT_INTENT_RAILS: readonly ["faircoin", "card"];
|
|
6
6
|
export type PaymentIntentRail = (typeof PAYMENT_INTENT_RAILS)[number];
|
|
7
|
+
/**
|
|
8
|
+
* The longest a PaymentIntent created through the API may stay payable before
|
|
9
|
+
* it expires (`expires_in_seconds`): 24 hours. A FairCoin payment holds a
|
|
10
|
+
* reserved address in the recipient's wallet for as long as it is payable, so
|
|
11
|
+
* an unbounded expiry is an address nobody can ever recycle (ADR 0021 D9).
|
|
12
|
+
*/
|
|
13
|
+
export declare const PAYMENT_INTENT_MAX_EXPIRES_IN_SECONDS: number;
|
|
7
14
|
/**
|
|
8
15
|
* Stripe's seven statuses, and no others (ADR 0019). The FairCoin rail walks
|
|
9
16
|
* four of them (`requires_action` → `processing` → `succeeded` | `canceled`); a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peable.to/contracts",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "The Peable wire, declared once: Zod contracts of every public route, the OpenAPI 3.1 generator and the closed value sets (ADR 0014 D5).",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|