@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
|
@@ -288,14 +288,23 @@ export declare const amountParam: z.ZodString;
|
|
|
288
288
|
export declare const redirectUrlParam: z.ZodString;
|
|
289
289
|
/** `auto` follows the payer's browser: parsed as `null`. */
|
|
290
290
|
export declare const localeParam: z.ZodPipe<z.ZodEnum<{
|
|
291
|
+
id: "id";
|
|
292
|
+
ar: "ar";
|
|
293
|
+
bn: "bn";
|
|
294
|
+
ca: "ca";
|
|
295
|
+
de: "de";
|
|
291
296
|
en: "en";
|
|
292
297
|
es: "es";
|
|
293
298
|
fr: "fr";
|
|
294
|
-
|
|
299
|
+
hi: "hi";
|
|
295
300
|
it: "it";
|
|
301
|
+
ja: "ja";
|
|
296
302
|
pt: "pt";
|
|
303
|
+
ru: "ru";
|
|
304
|
+
tr: "tr";
|
|
305
|
+
zh: "zh";
|
|
297
306
|
auto: "auto";
|
|
298
|
-
}>, z.ZodTransform<"en" | "es" | "fr" | "
|
|
307
|
+
}>, 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">>;
|
|
299
308
|
export declare const checkoutEmailParam: z.ZodString;
|
|
300
309
|
declare const customFieldParam: z.ZodObject<{
|
|
301
310
|
key: z.ZodString;
|
|
@@ -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];
|
|
@@ -19,9 +20,23 @@ export declare const CHECKOUT_PAYMENT_STATUSES: readonly ["paid", "unpaid", "no_
|
|
|
19
20
|
export type CheckoutSessionPaymentStatus = (typeof CHECKOUT_PAYMENT_STATUSES)[number];
|
|
20
21
|
export declare const CHECKOUT_UI_MODES: readonly ["hosted", "embedded"];
|
|
21
22
|
export type CheckoutUiMode = (typeof CHECKOUT_UI_MODES)[number];
|
|
22
|
-
/**
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The languages every payer surface speaks — ONE set: the Pay with Peable
|
|
25
|
+
* sheet (`@peable.to/sdk/checkout/ui`), the hosted and embedded checkout, the
|
|
26
|
+
* hosted invoice and portal pages, and the customer emails. Each surface keeps
|
|
27
|
+
* its own catalog (their strings differ, and Metro does not tree-shake), typed
|
|
28
|
+
* `Record<CheckoutLocale, …>`, so a language added here is a compile error on
|
|
29
|
+
* every surface until it is translated.
|
|
30
|
+
*
|
|
31
|
+
* Language codes: `pt` is Brazilian Portuguese (`pt-BR`), `zh` Simplified
|
|
32
|
+
* Chinese (`zh-Hans`). A BCP 47 tag resolves to its language.
|
|
33
|
+
*/
|
|
34
|
+
export declare const CHECKOUT_LOCALES: readonly ["ar", "bn", "ca", "de", "en", "es", "fr", "hi", "id", "it", "ja", "pt", "ru", "tr", "zh"];
|
|
24
35
|
export type CheckoutLocale = (typeof CHECKOUT_LOCALES)[number];
|
|
36
|
+
/** The locales written right to left: a surface sets `dir="rtl"` for them. */
|
|
37
|
+
export declare const CHECKOUT_RTL_LOCALES: readonly CheckoutLocale[];
|
|
38
|
+
/** The text direction a locale is written in. */
|
|
39
|
+
export declare function checkoutLocaleDirection(locale: CheckoutLocale): 'ltr' | 'rtl';
|
|
25
40
|
export declare const CHECKOUT_SUBMIT_TYPES: readonly ["auto", "pay", "book", "donate"];
|
|
26
41
|
export type CheckoutSubmitType = (typeof CHECKOUT_SUBMIT_TYPES)[number];
|
|
27
42
|
export declare const CHECKOUT_CUSTOMER_CREATIONS: readonly ["always", "if_required"];
|
|
@@ -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.4.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",
|