@peable.to/contracts 5.2.0 → 5.4.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/merchants.js +6 -1
- package/dist/cjs/resources/payments/paymentIntents.js +7 -1
- package/dist/cjs/resources/payments/social.js +3 -1
- package/dist/cjs/vocabulary/checkout.js +38 -4
- 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/merchants.js +6 -1
- package/dist/esm/resources/payments/paymentIntents.js +8 -2
- package/dist/esm/resources/payments/social.js +3 -1
- package/dist/esm/vocabulary/checkout.js +36 -3
- 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 +132 -15
- package/dist/types/resources/checkout/index.d.ts +173 -20
- package/dist/types/resources/checkout/paymentLinks.d.ts +114 -15
- package/dist/types/resources/checkout/shared.d.ts +11 -2
- package/dist/types/vocabulary/checkout.d.ts +18 -3
- 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
|
@@ -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(),
|
|
@@ -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());
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// the wallet import them without the schemas (`@peable.to/contracts/vocabulary`,
|
|
5
5
|
// re-exported by `@peable.to/shared-types`).
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.PAYMENT_LINK_LIMITS = exports.CHECKOUT_SESSION_ID_TEMPLATE = exports.CHECKOUT_LIMITS = exports.CHECKOUT_TAX_ID_TYPES = exports.CHECKOUT_CUSTOM_FIELD_TYPES = exports.CHECKOUT_BILLING_ADDRESS_COLLECTIONS = exports.CHECKOUT_CUSTOMER_CREATIONS = exports.CHECKOUT_SUBMIT_TYPES = exports.CHECKOUT_LOCALES = exports.CHECKOUT_UI_MODES = exports.CHECKOUT_PAYMENT_STATUSES = exports.CHECKOUT_SESSION_STATUSES = exports.CHECKOUT_SESSION_MODES = exports.FAIRCOIN_UNAVAILABLE_REASONS = void 0;
|
|
7
|
+
exports.PAYMENT_LINK_LIMITS = exports.CHECKOUT_SESSION_ID_TEMPLATE = exports.CHECKOUT_LIMITS = exports.CHECKOUT_TAX_ID_TYPES = exports.CHECKOUT_CUSTOM_FIELD_TYPES = exports.CHECKOUT_BILLING_ADDRESS_COLLECTIONS = exports.CHECKOUT_CUSTOMER_CREATIONS = exports.CHECKOUT_SUBMIT_TYPES = exports.CHECKOUT_RTL_LOCALES = exports.CHECKOUT_LOCALES = exports.CHECKOUT_UI_MODES = exports.CHECKOUT_PAYMENT_STATUSES = exports.CHECKOUT_SESSION_STATUSES = exports.CHECKOUT_SESSION_MODES = exports.FAIRCOIN_UNAVAILABLE_REASONS = void 0;
|
|
8
|
+
exports.checkoutLocaleDirection = checkoutLocaleDirection;
|
|
8
9
|
/**
|
|
9
10
|
* Why FairCoin cannot be paid with on an order right now (ADR 0021). It is
|
|
10
11
|
* still offered — never hidden — and says why:
|
|
@@ -14,7 +15,8 @@ exports.PAYMENT_LINK_LIMITS = exports.CHECKOUT_SESSION_ID_TEMPLATE = exports.CHE
|
|
|
14
15
|
* - `faircoin_network_closed` — this deployment does not open payments on the
|
|
15
16
|
* order's FairCoin network yet (ADR 0002's gate);
|
|
16
17
|
* - `price_unavailable` — no fresh FairCoin price exists to quote a fiat order;
|
|
17
|
-
* - `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.
|
|
18
20
|
*/
|
|
19
21
|
exports.FAIRCOIN_UNAVAILABLE_REASONS = [
|
|
20
22
|
'faircoin_wallet_missing',
|
|
@@ -26,8 +28,40 @@ exports.CHECKOUT_SESSION_MODES = ['payment', 'setup', 'subscription'];
|
|
|
26
28
|
exports.CHECKOUT_SESSION_STATUSES = ['open', 'complete', 'expired'];
|
|
27
29
|
exports.CHECKOUT_PAYMENT_STATUSES = ['paid', 'unpaid', 'no_payment_required'];
|
|
28
30
|
exports.CHECKOUT_UI_MODES = ['hosted', 'embedded'];
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The languages every payer surface speaks — ONE set: the Pay with Peable
|
|
33
|
+
* sheet (`@peable.to/sdk/checkout/ui`), the hosted and embedded checkout, the
|
|
34
|
+
* hosted invoice and portal pages, and the customer emails. Each surface keeps
|
|
35
|
+
* its own catalog (their strings differ, and Metro does not tree-shake), typed
|
|
36
|
+
* `Record<CheckoutLocale, …>`, so a language added here is a compile error on
|
|
37
|
+
* every surface until it is translated.
|
|
38
|
+
*
|
|
39
|
+
* Language codes: `pt` is Brazilian Portuguese (`pt-BR`), `zh` Simplified
|
|
40
|
+
* Chinese (`zh-Hans`). A BCP 47 tag resolves to its language.
|
|
41
|
+
*/
|
|
42
|
+
exports.CHECKOUT_LOCALES = [
|
|
43
|
+
'ar',
|
|
44
|
+
'bn',
|
|
45
|
+
'ca',
|
|
46
|
+
'de',
|
|
47
|
+
'en',
|
|
48
|
+
'es',
|
|
49
|
+
'fr',
|
|
50
|
+
'hi',
|
|
51
|
+
'id',
|
|
52
|
+
'it',
|
|
53
|
+
'ja',
|
|
54
|
+
'pt',
|
|
55
|
+
'ru',
|
|
56
|
+
'tr',
|
|
57
|
+
'zh',
|
|
58
|
+
];
|
|
59
|
+
/** The locales written right to left: a surface sets `dir="rtl"` for them. */
|
|
60
|
+
exports.CHECKOUT_RTL_LOCALES = ['ar'];
|
|
61
|
+
/** The text direction a locale is written in. */
|
|
62
|
+
function checkoutLocaleDirection(locale) {
|
|
63
|
+
return exports.CHECKOUT_RTL_LOCALES.includes(locale) ? 'rtl' : 'ltr';
|
|
64
|
+
}
|
|
31
65
|
exports.CHECKOUT_SUBMIT_TYPES = ['auto', 'pay', 'book', 'donate'];
|
|
32
66
|
exports.CHECKOUT_CUSTOMER_CREATIONS = ['always', 'if_required'];
|
|
33
67
|
exports.CHECKOUT_BILLING_ADDRESS_COLLECTIONS = ['auto', 'required'];
|
|
@@ -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
|
|
@@ -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(),
|
|
@@ -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',
|
|
@@ -23,8 +24,40 @@ export const CHECKOUT_SESSION_MODES = ['payment', 'setup', 'subscription'];
|
|
|
23
24
|
export const CHECKOUT_SESSION_STATUSES = ['open', 'complete', 'expired'];
|
|
24
25
|
export const CHECKOUT_PAYMENT_STATUSES = ['paid', 'unpaid', 'no_payment_required'];
|
|
25
26
|
export const CHECKOUT_UI_MODES = ['hosted', 'embedded'];
|
|
26
|
-
/**
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The languages every payer surface speaks — ONE set: the Pay with Peable
|
|
29
|
+
* sheet (`@peable.to/sdk/checkout/ui`), the hosted and embedded checkout, the
|
|
30
|
+
* hosted invoice and portal pages, and the customer emails. Each surface keeps
|
|
31
|
+
* its own catalog (their strings differ, and Metro does not tree-shake), typed
|
|
32
|
+
* `Record<CheckoutLocale, …>`, so a language added here is a compile error on
|
|
33
|
+
* every surface until it is translated.
|
|
34
|
+
*
|
|
35
|
+
* Language codes: `pt` is Brazilian Portuguese (`pt-BR`), `zh` Simplified
|
|
36
|
+
* Chinese (`zh-Hans`). A BCP 47 tag resolves to its language.
|
|
37
|
+
*/
|
|
38
|
+
export const CHECKOUT_LOCALES = [
|
|
39
|
+
'ar',
|
|
40
|
+
'bn',
|
|
41
|
+
'ca',
|
|
42
|
+
'de',
|
|
43
|
+
'en',
|
|
44
|
+
'es',
|
|
45
|
+
'fr',
|
|
46
|
+
'hi',
|
|
47
|
+
'id',
|
|
48
|
+
'it',
|
|
49
|
+
'ja',
|
|
50
|
+
'pt',
|
|
51
|
+
'ru',
|
|
52
|
+
'tr',
|
|
53
|
+
'zh',
|
|
54
|
+
];
|
|
55
|
+
/** The locales written right to left: a surface sets `dir="rtl"` for them. */
|
|
56
|
+
export const CHECKOUT_RTL_LOCALES = ['ar'];
|
|
57
|
+
/** The text direction a locale is written in. */
|
|
58
|
+
export function checkoutLocaleDirection(locale) {
|
|
59
|
+
return CHECKOUT_RTL_LOCALES.includes(locale) ? 'rtl' : 'ltr';
|
|
60
|
+
}
|
|
28
61
|
export const CHECKOUT_SUBMIT_TYPES = ['auto', 'pay', 'book', 'donate'];
|
|
29
62
|
export const CHECKOUT_CUSTOMER_CREATIONS = ['always', 'if_required'];
|
|
30
63
|
export const CHECKOUT_BILLING_ADDRESS_COLLECTIONS = ['auto', 'required'];
|
|
@@ -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
|
|
@@ -134,12 +134,21 @@ export declare const checkoutSessionSchema: z.ZodObject<{
|
|
|
134
134
|
embedded: "embedded";
|
|
135
135
|
}>;
|
|
136
136
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
137
|
+
id: "id";
|
|
138
|
+
ar: "ar";
|
|
139
|
+
bn: "bn";
|
|
140
|
+
ca: "ca";
|
|
141
|
+
de: "de";
|
|
137
142
|
en: "en";
|
|
138
143
|
es: "es";
|
|
139
144
|
fr: "fr";
|
|
140
|
-
|
|
145
|
+
hi: "hi";
|
|
141
146
|
it: "it";
|
|
147
|
+
ja: "ja";
|
|
142
148
|
pt: "pt";
|
|
149
|
+
ru: "ru";
|
|
150
|
+
tr: "tr";
|
|
151
|
+
zh: "zh";
|
|
143
152
|
}>>;
|
|
144
153
|
submit_type: z.ZodEnum<{
|
|
145
154
|
auto: "auto";
|
|
@@ -410,12 +419,21 @@ export declare const checkoutSessionPublicSchema: z.ZodObject<{
|
|
|
410
419
|
embedded: "embedded";
|
|
411
420
|
}>;
|
|
412
421
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
422
|
+
id: "id";
|
|
423
|
+
ar: "ar";
|
|
424
|
+
bn: "bn";
|
|
425
|
+
ca: "ca";
|
|
426
|
+
de: "de";
|
|
413
427
|
en: "en";
|
|
414
428
|
es: "es";
|
|
415
429
|
fr: "fr";
|
|
416
|
-
|
|
430
|
+
hi: "hi";
|
|
417
431
|
it: "it";
|
|
432
|
+
ja: "ja";
|
|
418
433
|
pt: "pt";
|
|
434
|
+
ru: "ru";
|
|
435
|
+
tr: "tr";
|
|
436
|
+
zh: "zh";
|
|
419
437
|
}>>;
|
|
420
438
|
submit_type: z.ZodEnum<{
|
|
421
439
|
auto: "auto";
|
|
@@ -575,14 +593,23 @@ export declare const createCheckoutSessionParams: z.ZodObject<{
|
|
|
575
593
|
faircoin: "faircoin";
|
|
576
594
|
}>>>;
|
|
577
595
|
locale: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
596
|
+
id: "id";
|
|
597
|
+
ar: "ar";
|
|
598
|
+
bn: "bn";
|
|
599
|
+
ca: "ca";
|
|
600
|
+
de: "de";
|
|
578
601
|
en: "en";
|
|
579
602
|
es: "es";
|
|
580
603
|
fr: "fr";
|
|
581
|
-
|
|
604
|
+
hi: "hi";
|
|
582
605
|
it: "it";
|
|
606
|
+
ja: "ja";
|
|
583
607
|
pt: "pt";
|
|
608
|
+
ru: "ru";
|
|
609
|
+
tr: "tr";
|
|
610
|
+
zh: "zh";
|
|
584
611
|
auto: "auto";
|
|
585
|
-
}>, z.ZodTransform<"en" | "es" | "fr" | "
|
|
612
|
+
}>, z.ZodTransform<"id" | "ar" | "bn" | "ca" | "de" | "en" | "es" | "fr" | "hi" | "it" | "ja" | "pt" | "ru" | "tr" | "zh" | null, "id" | "ar" | "bn" | "ca" | "de" | "en" | "es" | "fr" | "hi" | "it" | "ja" | "pt" | "ru" | "tr" | "zh" | "auto">>>;
|
|
586
613
|
ui_mode: z.ZodOptional<z.ZodEnum<{
|
|
587
614
|
hosted: "hosted";
|
|
588
615
|
embedded: "embedded";
|
|
@@ -868,14 +895,23 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
868
895
|
faircoin: "faircoin";
|
|
869
896
|
}>>>;
|
|
870
897
|
locale: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
898
|
+
id: "id";
|
|
899
|
+
ar: "ar";
|
|
900
|
+
bn: "bn";
|
|
901
|
+
ca: "ca";
|
|
902
|
+
de: "de";
|
|
871
903
|
en: "en";
|
|
872
904
|
es: "es";
|
|
873
905
|
fr: "fr";
|
|
874
|
-
|
|
906
|
+
hi: "hi";
|
|
875
907
|
it: "it";
|
|
908
|
+
ja: "ja";
|
|
876
909
|
pt: "pt";
|
|
910
|
+
ru: "ru";
|
|
911
|
+
tr: "tr";
|
|
912
|
+
zh: "zh";
|
|
877
913
|
auto: "auto";
|
|
878
|
-
}>, z.ZodTransform<"en" | "es" | "fr" | "
|
|
914
|
+
}>, z.ZodTransform<"id" | "ar" | "bn" | "ca" | "de" | "en" | "es" | "fr" | "hi" | "it" | "ja" | "pt" | "ru" | "tr" | "zh" | null, "id" | "ar" | "bn" | "ca" | "de" | "en" | "es" | "fr" | "hi" | "it" | "ja" | "pt" | "ru" | "tr" | "zh" | "auto">>>;
|
|
879
915
|
ui_mode: z.ZodOptional<z.ZodEnum<{
|
|
880
916
|
hosted: "hosted";
|
|
881
917
|
embedded: "embedded";
|
|
@@ -1157,12 +1193,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
1157
1193
|
embedded: "embedded";
|
|
1158
1194
|
}>;
|
|
1159
1195
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
1196
|
+
id: "id";
|
|
1197
|
+
ar: "ar";
|
|
1198
|
+
bn: "bn";
|
|
1199
|
+
ca: "ca";
|
|
1200
|
+
de: "de";
|
|
1160
1201
|
en: "en";
|
|
1161
1202
|
es: "es";
|
|
1162
1203
|
fr: "fr";
|
|
1163
|
-
|
|
1204
|
+
hi: "hi";
|
|
1164
1205
|
it: "it";
|
|
1206
|
+
ja: "ja";
|
|
1165
1207
|
pt: "pt";
|
|
1208
|
+
ru: "ru";
|
|
1209
|
+
tr: "tr";
|
|
1210
|
+
zh: "zh";
|
|
1166
1211
|
}>>;
|
|
1167
1212
|
submit_type: z.ZodEnum<{
|
|
1168
1213
|
auto: "auto";
|
|
@@ -1385,12 +1430,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
1385
1430
|
embedded: "embedded";
|
|
1386
1431
|
}>;
|
|
1387
1432
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
1433
|
+
id: "id";
|
|
1434
|
+
ar: "ar";
|
|
1435
|
+
bn: "bn";
|
|
1436
|
+
ca: "ca";
|
|
1437
|
+
de: "de";
|
|
1388
1438
|
en: "en";
|
|
1389
1439
|
es: "es";
|
|
1390
1440
|
fr: "fr";
|
|
1391
|
-
|
|
1441
|
+
hi: "hi";
|
|
1392
1442
|
it: "it";
|
|
1443
|
+
ja: "ja";
|
|
1393
1444
|
pt: "pt";
|
|
1445
|
+
ru: "ru";
|
|
1446
|
+
tr: "tr";
|
|
1447
|
+
zh: "zh";
|
|
1394
1448
|
}>>;
|
|
1395
1449
|
submit_type: z.ZodEnum<{
|
|
1396
1450
|
auto: "auto";
|
|
@@ -1594,12 +1648,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
1594
1648
|
embedded: "embedded";
|
|
1595
1649
|
}>;
|
|
1596
1650
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
1651
|
+
id: "id";
|
|
1652
|
+
ar: "ar";
|
|
1653
|
+
bn: "bn";
|
|
1654
|
+
ca: "ca";
|
|
1655
|
+
de: "de";
|
|
1597
1656
|
en: "en";
|
|
1598
1657
|
es: "es";
|
|
1599
1658
|
fr: "fr";
|
|
1600
|
-
|
|
1659
|
+
hi: "hi";
|
|
1601
1660
|
it: "it";
|
|
1661
|
+
ja: "ja";
|
|
1602
1662
|
pt: "pt";
|
|
1663
|
+
ru: "ru";
|
|
1664
|
+
tr: "tr";
|
|
1665
|
+
zh: "zh";
|
|
1603
1666
|
}>>;
|
|
1604
1667
|
submit_type: z.ZodEnum<{
|
|
1605
1668
|
auto: "auto";
|
|
@@ -1803,12 +1866,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
1803
1866
|
embedded: "embedded";
|
|
1804
1867
|
}>;
|
|
1805
1868
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
1869
|
+
id: "id";
|
|
1870
|
+
ar: "ar";
|
|
1871
|
+
bn: "bn";
|
|
1872
|
+
ca: "ca";
|
|
1873
|
+
de: "de";
|
|
1806
1874
|
en: "en";
|
|
1807
1875
|
es: "es";
|
|
1808
1876
|
fr: "fr";
|
|
1809
|
-
|
|
1877
|
+
hi: "hi";
|
|
1810
1878
|
it: "it";
|
|
1879
|
+
ja: "ja";
|
|
1811
1880
|
pt: "pt";
|
|
1881
|
+
ru: "ru";
|
|
1882
|
+
tr: "tr";
|
|
1883
|
+
zh: "zh";
|
|
1812
1884
|
}>>;
|
|
1813
1885
|
submit_type: z.ZodEnum<{
|
|
1814
1886
|
auto: "auto";
|
|
@@ -2011,12 +2083,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
2011
2083
|
embedded: "embedded";
|
|
2012
2084
|
}>;
|
|
2013
2085
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
2086
|
+
id: "id";
|
|
2087
|
+
ar: "ar";
|
|
2088
|
+
bn: "bn";
|
|
2089
|
+
ca: "ca";
|
|
2090
|
+
de: "de";
|
|
2014
2091
|
en: "en";
|
|
2015
2092
|
es: "es";
|
|
2016
2093
|
fr: "fr";
|
|
2017
|
-
|
|
2094
|
+
hi: "hi";
|
|
2018
2095
|
it: "it";
|
|
2096
|
+
ja: "ja";
|
|
2019
2097
|
pt: "pt";
|
|
2098
|
+
ru: "ru";
|
|
2099
|
+
tr: "tr";
|
|
2100
|
+
zh: "zh";
|
|
2020
2101
|
}>>;
|
|
2021
2102
|
submit_type: z.ZodEnum<{
|
|
2022
2103
|
auto: "auto";
|
|
@@ -2359,12 +2440,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
2359
2440
|
embedded: "embedded";
|
|
2360
2441
|
}>;
|
|
2361
2442
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
2443
|
+
id: "id";
|
|
2444
|
+
ar: "ar";
|
|
2445
|
+
bn: "bn";
|
|
2446
|
+
ca: "ca";
|
|
2447
|
+
de: "de";
|
|
2362
2448
|
en: "en";
|
|
2363
2449
|
es: "es";
|
|
2364
2450
|
fr: "fr";
|
|
2365
|
-
|
|
2451
|
+
hi: "hi";
|
|
2366
2452
|
it: "it";
|
|
2453
|
+
ja: "ja";
|
|
2367
2454
|
pt: "pt";
|
|
2455
|
+
ru: "ru";
|
|
2456
|
+
tr: "tr";
|
|
2457
|
+
zh: "zh";
|
|
2368
2458
|
}>>;
|
|
2369
2459
|
submit_type: z.ZodEnum<{
|
|
2370
2460
|
auto: "auto";
|
|
@@ -2684,12 +2774,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
2684
2774
|
embedded: "embedded";
|
|
2685
2775
|
}>;
|
|
2686
2776
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
2777
|
+
id: "id";
|
|
2778
|
+
ar: "ar";
|
|
2779
|
+
bn: "bn";
|
|
2780
|
+
ca: "ca";
|
|
2781
|
+
de: "de";
|
|
2687
2782
|
en: "en";
|
|
2688
2783
|
es: "es";
|
|
2689
2784
|
fr: "fr";
|
|
2690
|
-
|
|
2785
|
+
hi: "hi";
|
|
2691
2786
|
it: "it";
|
|
2787
|
+
ja: "ja";
|
|
2692
2788
|
pt: "pt";
|
|
2789
|
+
ru: "ru";
|
|
2790
|
+
tr: "tr";
|
|
2791
|
+
zh: "zh";
|
|
2693
2792
|
}>>;
|
|
2694
2793
|
submit_type: z.ZodEnum<{
|
|
2695
2794
|
auto: "auto";
|
|
@@ -2966,12 +3065,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
2966
3065
|
embedded: "embedded";
|
|
2967
3066
|
}>;
|
|
2968
3067
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
3068
|
+
id: "id";
|
|
3069
|
+
ar: "ar";
|
|
3070
|
+
bn: "bn";
|
|
3071
|
+
ca: "ca";
|
|
3072
|
+
de: "de";
|
|
2969
3073
|
en: "en";
|
|
2970
3074
|
es: "es";
|
|
2971
3075
|
fr: "fr";
|
|
2972
|
-
|
|
3076
|
+
hi: "hi";
|
|
2973
3077
|
it: "it";
|
|
3078
|
+
ja: "ja";
|
|
2974
3079
|
pt: "pt";
|
|
3080
|
+
ru: "ru";
|
|
3081
|
+
tr: "tr";
|
|
3082
|
+
zh: "zh";
|
|
2975
3083
|
}>>;
|
|
2976
3084
|
submit_type: z.ZodEnum<{
|
|
2977
3085
|
auto: "auto";
|
|
@@ -3171,12 +3279,21 @@ export declare const checkoutSessionRoutes: readonly [{
|
|
|
3171
3279
|
embedded: "embedded";
|
|
3172
3280
|
}>;
|
|
3173
3281
|
locale: z.ZodNullable<z.ZodEnum<{
|
|
3282
|
+
id: "id";
|
|
3283
|
+
ar: "ar";
|
|
3284
|
+
bn: "bn";
|
|
3285
|
+
ca: "ca";
|
|
3286
|
+
de: "de";
|
|
3174
3287
|
en: "en";
|
|
3175
3288
|
es: "es";
|
|
3176
3289
|
fr: "fr";
|
|
3177
|
-
|
|
3290
|
+
hi: "hi";
|
|
3178
3291
|
it: "it";
|
|
3292
|
+
ja: "ja";
|
|
3179
3293
|
pt: "pt";
|
|
3294
|
+
ru: "ru";
|
|
3295
|
+
tr: "tr";
|
|
3296
|
+
zh: "zh";
|
|
3180
3297
|
}>>;
|
|
3181
3298
|
submit_type: z.ZodEnum<{
|
|
3182
3299
|
auto: "auto";
|