@peable.to/contracts 3.1.0 → 4.1.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.
Files changed (43) hide show
  1. package/dist/cjs/resources/billingEngine/public.js +22 -3
  2. package/dist/cjs/resources/checkout/checkoutSessions.js +34 -9
  3. package/dist/cjs/resources/checkout/merchants.js +10 -23
  4. package/dist/cjs/resources/checkout/paymentMethodConfigurations.js +56 -10
  5. package/dist/cjs/resources/connect/balance.js +5 -0
  6. package/dist/cjs/resources/connect/connectedAccounts.js +11 -12
  7. package/dist/cjs/resources/connect/onboarding.js +13 -24
  8. package/dist/cjs/resources/payments/paymentIntents.js +39 -2
  9. package/dist/cjs/vocabulary/checkout.js +18 -1
  10. package/dist/cjs/vocabulary/errors.js +5 -3
  11. package/dist/cjs/vocabulary/paymentMethodConfigurations.js +24 -4
  12. package/dist/esm/resources/billingEngine/public.js +22 -3
  13. package/dist/esm/resources/checkout/checkoutSessions.js +35 -10
  14. package/dist/esm/resources/checkout/merchants.js +10 -23
  15. package/dist/esm/resources/checkout/paymentMethodConfigurations.js +57 -11
  16. package/dist/esm/resources/connect/balance.js +5 -0
  17. package/dist/esm/resources/connect/connectedAccounts.js +11 -12
  18. package/dist/esm/resources/connect/onboarding.js +12 -23
  19. package/dist/esm/resources/payments/paymentIntents.js +39 -2
  20. package/dist/esm/vocabulary/checkout.js +17 -0
  21. package/dist/esm/vocabulary/errors.js +5 -3
  22. package/dist/esm/vocabulary/paymentMethodConfigurations.js +25 -5
  23. package/dist/types/resources/billingEngine/index.d.ts +16 -2
  24. package/dist/types/resources/billingEngine/public.d.ts +32 -3
  25. package/dist/types/resources/checkout/checkoutSessions.d.ts +96 -31
  26. package/dist/types/resources/checkout/index.d.ts +406 -41
  27. package/dist/types/resources/checkout/merchants.d.ts +17 -28
  28. package/dist/types/resources/checkout/paymentMethodConfigurations.d.ts +440 -8
  29. package/dist/types/resources/connect/balance.d.ts +98 -5
  30. package/dist/types/resources/connect/connectedAccounts.d.ts +4 -4
  31. package/dist/types/resources/connect/index.d.ts +101 -10
  32. package/dist/types/resources/connect/onboarding.d.ts +15 -15
  33. package/dist/types/resources/connect/payouts.d.ts +64 -2
  34. package/dist/types/resources/payments/index.d.ts +310 -0
  35. package/dist/types/resources/payments/paymentIntents.d.ts +380 -0
  36. package/dist/types/resources/payments/testHelpers.d.ts +31 -0
  37. package/dist/types/resources/tax/deadlines.d.ts +3 -3
  38. package/dist/types/resources/tax/index.d.ts +2 -2
  39. package/dist/types/resources/tax/registrations.d.ts +2 -2
  40. package/dist/types/vocabulary/checkout.d.ts +13 -0
  41. package/dist/types/vocabulary/errors.d.ts +5 -3
  42. package/dist/types/vocabulary/paymentMethodConfigurations.d.ts +21 -7
  43. package/package.json +1 -1
@@ -1,6 +1,13 @@
1
- import { type FiatCurrencyCode } from './money';
1
+ import { type CurrencyCode } from './money';
2
2
  /**
3
- * The methods a configuration can turn on.
3
+ * The methods a configuration lists.
4
+ *
5
+ * `faircoin` is listed and LOCKED (ADR 0021 D2): every payer can always pay
6
+ * with FairCoin, so its entry is always `display_preference.value: 'on'` with
7
+ * `locked: true`, and a create or update that sets it `off` is refused with
8
+ * `payment_method_locked`. It is the chain rail, never a card-provider method:
9
+ * it is never pushed to the provider and never appears in a card PaymentIntent's
10
+ * `payment_method_types`. Every other method is the merchant's to turn on and off.
4
11
  *
5
12
  * `apple_pay` and `google_pay` are WALLETS over a card: a payment made with one
6
13
  * is a `card` payment, so they appear here and never in a PaymentIntent's
@@ -11,19 +18,26 @@ import { type FiatCurrencyCode } from './money';
11
18
  * checkout, `payment-provider-boundary.md`) and giropay (discontinued by the
12
19
  * scheme).
13
20
  */
14
- export declare const PAYMENT_METHOD_CONFIGURATION_TYPES: readonly ["card", "apple_pay", "google_pay", "sepa_debit", "ideal", "bancontact", "eps", "bizum"];
21
+ export declare const PAYMENT_METHOD_CONFIGURATION_TYPES: readonly ["faircoin", "card", "apple_pay", "google_pay", "sepa_debit", "ideal", "bancontact", "eps", "bizum"];
15
22
  export type PaymentMethodConfigurationType = (typeof PAYMENT_METHOD_CONFIGURATION_TYPES)[number];
16
23
  /**
17
24
  * Why a method cannot be offered whatever the merchant chooses.
18
25
  *
19
26
  * - `provider_unsupported` — the processing provider does not offer it;
20
- * - `requires_card` — a wallet rides on card payments, and card is off.
27
+ * - `requires_card` — a wallet rides on card payments, and card is off;
28
+ * - `faircoin_wallet_missing` — the Peable wallet of the account that owns
29
+ * the merchant isn't set up yet (no identity key), so FairCoin cannot be
30
+ * received (ADR 0021 D5); the owner sets it up in Peable;
31
+ * - `faircoin_network_closed` — the deployment does not open the merchant's
32
+ * FairCoin network yet (ADR 0002's gate);
33
+ * - `temporarily_unavailable` — the wallet could not be checked just now.
21
34
  */
22
- export declare const PAYMENT_METHOD_UNAVAILABLE_REASONS: readonly ["provider_unsupported", "requires_card"];
35
+ export declare const PAYMENT_METHOD_UNAVAILABLE_REASONS: readonly ["provider_unsupported", "requires_card", "faircoin_wallet_missing", "faircoin_network_closed", "temporarily_unavailable"];
23
36
  export type PaymentMethodUnavailableReason = (typeof PAYMENT_METHOD_UNAVAILABLE_REASONS)[number];
24
37
  /**
25
38
  * The currencies each method can take a payment in. A method is offered on a
26
39
  * payment only when its currency is listed — so iDEAL never appears on a USD
27
- * payment, and a payer is never shown a method that would fail.
40
+ * payment, and a payer is never shown a method that would fail. FairCoin takes
41
+ * every currency: a `FAIR` order directly, a fiat one at a quoted price (ADR 0021).
28
42
  */
29
- export declare const PAYMENT_METHOD_CURRENCIES: Readonly<Record<PaymentMethodConfigurationType, readonly FiatCurrencyCode[]>>;
43
+ export declare const PAYMENT_METHOD_CURRENCIES: Readonly<Record<PaymentMethodConfigurationType, readonly CurrencyCode[]>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peable.to/contracts",
3
- "version": "3.1.0",
3
+ "version": "4.1.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",