@peable.to/contracts 0.3.0 → 1.0.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/common/address.js +81 -0
- package/dist/cjs/common/envelopes.js +101 -0
- package/dist/cjs/common/objects.js +85 -0
- package/dist/cjs/common/params.js +211 -0
- package/dist/cjs/common/primitives.js +39 -0
- package/dist/cjs/contributions.js +22 -0
- package/dist/cjs/index.js +40 -97
- package/dist/cjs/openapi/document.js +297 -0
- package/dist/cjs/openapi/index.js +7 -0
- package/dist/cjs/openapi/webhooks.js +17 -0
- package/dist/cjs/resources/billingEngine/billingPortal.js +237 -0
- package/dist/cjs/resources/billingEngine/creditNotes.js +189 -0
- package/dist/cjs/resources/billingEngine/customerBalanceTransactions.js +90 -0
- package/dist/cjs/resources/billingEngine/index.js +43 -0
- package/dist/cjs/resources/billingEngine/invoiceItems.js +155 -0
- package/dist/cjs/resources/billingEngine/invoices.js +509 -0
- package/dist/cjs/resources/billingEngine/params.js +43 -0
- package/dist/cjs/resources/billingEngine/public.js +326 -0
- package/dist/cjs/resources/billingEngine/subscriptions.js +476 -0
- package/dist/cjs/resources/catalog/billing.js +755 -0
- package/dist/cjs/resources/catalog/billingSettings.js +131 -0
- package/dist/cjs/resources/catalog/coupons.js +222 -0
- package/dist/cjs/resources/catalog/entitlements.js +257 -0
- package/dist/cjs/resources/catalog/index.js +58 -0
- package/dist/cjs/resources/catalog/meters.js +279 -0
- package/dist/cjs/resources/catalog/prices.js +423 -0
- package/dist/cjs/resources/catalog/products.js +228 -0
- package/dist/cjs/resources/catalog/promotionCodes.js +174 -0
- package/dist/cjs/resources/catalog/shared.js +75 -0
- package/dist/cjs/resources/catalog/testClocks.js +127 -0
- package/dist/cjs/resources/checkout/checkoutSessions.js +582 -0
- package/dist/cjs/resources/checkout/contributions.js +172 -0
- package/dist/cjs/resources/checkout/files.js +133 -0
- package/dist/cjs/resources/checkout/index.js +57 -0
- package/dist/cjs/resources/checkout/merchants.js +290 -0
- package/dist/cjs/resources/checkout/paymentLinks.js +330 -0
- package/dist/cjs/resources/checkout/paymentMethodConfigurations.js +262 -0
- package/dist/cjs/resources/checkout/shared.js +368 -0
- package/dist/cjs/resources/connect/account.js +332 -0
- package/dist/cjs/resources/connect/applicationFees.js +113 -0
- package/dist/cjs/resources/connect/balance.js +212 -0
- package/dist/cjs/resources/connect/connectedAccounts.js +260 -0
- package/dist/cjs/resources/connect/index.js +51 -0
- package/dist/cjs/resources/connect/onboarding.js +82 -0
- package/dist/cjs/resources/connect/payouts.js +196 -0
- package/dist/cjs/resources/connect/reporting.js +235 -0
- package/dist/cjs/resources/connect/requestLogs.js +110 -0
- package/dist/cjs/resources/connect/transfers.js +227 -0
- package/dist/cjs/resources/core/customers.js +194 -0
- package/dist/cjs/resources/core/index.js +23 -0
- package/dist/cjs/resources/core/paymentMethods.js +134 -0
- package/dist/cjs/resources/events/events.js +357 -0
- package/dist/cjs/resources/events/index.js +29 -0
- package/dist/cjs/resources/events/webhookDeliveries.js +93 -0
- package/dist/cjs/resources/events/webhookEndpoints.js +215 -0
- package/dist/cjs/resources/payments/charges.js +157 -0
- package/dist/cjs/resources/payments/disputes.js +204 -0
- package/dist/cjs/resources/payments/index.js +41 -0
- package/dist/cjs/resources/payments/paymentIntents.js +529 -0
- package/dist/cjs/resources/payments/refunds.js +245 -0
- package/dist/cjs/resources/payments/setupIntents.js +158 -0
- package/dist/cjs/resources/payments/social.js +182 -0
- package/dist/cjs/resources/payments/testHelpers.js +39 -0
- package/dist/cjs/resources/tax/assessments.js +217 -0
- package/dist/cjs/resources/tax/businessProfile.js +99 -0
- package/dist/cjs/resources/tax/calculations.js +176 -0
- package/dist/cjs/resources/tax/capabilities.js +42 -0
- package/dist/cjs/resources/tax/codes.js +37 -0
- package/dist/cjs/resources/tax/complianceActions.js +56 -0
- package/dist/cjs/resources/tax/deadlines.js +59 -0
- package/dist/cjs/resources/tax/documents.js +128 -0
- package/dist/cjs/resources/tax/index.js +80 -0
- package/dist/cjs/resources/tax/locationEvidence.js +131 -0
- package/dist/cjs/resources/tax/operatingLocations.js +98 -0
- package/dist/cjs/resources/tax/products.js +67 -0
- package/dist/cjs/resources/tax/registrationDeclarations.js +124 -0
- package/dist/cjs/resources/tax/registrations.js +82 -0
- package/dist/cjs/resources/tax/reports.js +92 -0
- package/dist/cjs/resources/tax/reviewItems.js +116 -0
- package/dist/cjs/resources/tax/ruleSet.js +68 -0
- package/dist/cjs/resources/tax/salesDestinations.js +94 -0
- package/dist/cjs/resources/tax/settings.js +104 -0
- package/dist/cjs/resources/tax/shared.js +62 -0
- package/dist/cjs/resources/tax/transactions.js +102 -0
- package/dist/cjs/route.js +22 -0
- package/dist/cjs/routes.js +31 -0
- package/dist/cjs/vocabulary/billingPortal.js +15 -0
- package/dist/cjs/vocabulary/catalog.js +110 -0
- package/dist/cjs/vocabulary/checkout.js +53 -0
- package/dist/cjs/vocabulary/connect.js +95 -0
- package/dist/cjs/vocabulary/errors.js +174 -0
- package/dist/cjs/vocabulary/events.js +176 -0
- package/dist/cjs/vocabulary/files.js +44 -0
- package/dist/cjs/vocabulary/index.js +37 -0
- package/dist/cjs/vocabulary/invoices.js +52 -0
- package/dist/cjs/vocabulary/lists.js +22 -0
- package/dist/cjs/vocabulary/merchants.js +23 -0
- package/dist/cjs/vocabulary/money.js +104 -0
- package/dist/cjs/vocabulary/paymentMethodConfigurations.js +36 -0
- package/dist/cjs/vocabulary/payments.js +195 -0
- package/dist/cjs/vocabulary/reporting.js +27 -0
- package/dist/cjs/vocabulary/subscriptions.js +60 -0
- package/dist/cjs/vocabulary/tax.js +237 -0
- package/dist/cjs/vocabulary/version.js +12 -0
- package/dist/esm/common/address.js +76 -0
- package/dist/esm/common/envelopes.js +95 -0
- package/dist/esm/common/objects.js +74 -0
- package/dist/esm/common/params.js +203 -0
- package/dist/esm/common/primitives.js +35 -0
- package/dist/esm/contributions.js +5 -0
- package/dist/esm/index.js +26 -94
- package/dist/esm/openapi/document.js +294 -0
- package/dist/esm/openapi/index.js +2 -0
- package/dist/esm/openapi/webhooks.js +14 -0
- package/dist/esm/resources/billingEngine/billingPortal.js +234 -0
- package/dist/esm/resources/billingEngine/creditNotes.js +186 -0
- package/dist/esm/resources/billingEngine/customerBalanceTransactions.js +87 -0
- package/dist/esm/resources/billingEngine/index.js +26 -0
- package/dist/esm/resources/billingEngine/invoiceItems.js +152 -0
- package/dist/esm/resources/billingEngine/invoices.js +506 -0
- package/dist/esm/resources/billingEngine/params.js +39 -0
- package/dist/esm/resources/billingEngine/public.js +323 -0
- package/dist/esm/resources/billingEngine/subscriptions.js +473 -0
- package/dist/esm/resources/catalog/billing.js +752 -0
- package/dist/esm/resources/catalog/billingSettings.js +128 -0
- package/dist/esm/resources/catalog/coupons.js +219 -0
- package/dist/esm/resources/catalog/entitlements.js +254 -0
- package/dist/esm/resources/catalog/index.js +38 -0
- package/dist/esm/resources/catalog/meters.js +276 -0
- package/dist/esm/resources/catalog/prices.js +419 -0
- package/dist/esm/resources/catalog/products.js +225 -0
- package/dist/esm/resources/catalog/promotionCodes.js +171 -0
- package/dist/esm/resources/catalog/shared.js +67 -0
- package/dist/esm/resources/catalog/testClocks.js +124 -0
- package/dist/esm/resources/checkout/checkoutSessions.js +579 -0
- package/dist/esm/resources/checkout/contributions.js +167 -0
- package/dist/esm/resources/checkout/files.js +130 -0
- package/dist/esm/resources/checkout/index.js +25 -0
- package/dist/esm/resources/checkout/merchants.js +287 -0
- package/dist/esm/resources/checkout/paymentLinks.js +327 -0
- package/dist/esm/resources/checkout/paymentMethodConfigurations.js +259 -0
- package/dist/esm/resources/checkout/shared.js +363 -0
- package/dist/esm/resources/connect/account.js +329 -0
- package/dist/esm/resources/connect/applicationFees.js +110 -0
- package/dist/esm/resources/connect/balance.js +209 -0
- package/dist/esm/resources/connect/connectedAccounts.js +257 -0
- package/dist/esm/resources/connect/index.js +34 -0
- package/dist/esm/resources/connect/onboarding.js +79 -0
- package/dist/esm/resources/connect/payouts.js +193 -0
- package/dist/esm/resources/connect/reporting.js +232 -0
- package/dist/esm/resources/connect/requestLogs.js +107 -0
- package/dist/esm/resources/connect/transfers.js +224 -0
- package/dist/esm/resources/core/customers.js +191 -0
- package/dist/esm/resources/core/index.js +6 -0
- package/dist/esm/resources/core/paymentMethods.js +131 -0
- package/dist/esm/resources/events/events.js +353 -0
- package/dist/esm/resources/events/index.js +12 -0
- package/dist/esm/resources/events/webhookDeliveries.js +90 -0
- package/dist/esm/resources/events/webhookEndpoints.js +212 -0
- package/dist/esm/resources/payments/charges.js +154 -0
- package/dist/esm/resources/payments/disputes.js +201 -0
- package/dist/esm/resources/payments/index.js +24 -0
- package/dist/esm/resources/payments/paymentIntents.js +526 -0
- package/dist/esm/resources/payments/refunds.js +242 -0
- package/dist/esm/resources/payments/setupIntents.js +155 -0
- package/dist/esm/resources/payments/social.js +179 -0
- package/dist/esm/resources/payments/testHelpers.js +36 -0
- package/dist/esm/resources/tax/assessments.js +214 -0
- package/dist/esm/resources/tax/businessProfile.js +96 -0
- package/dist/esm/resources/tax/calculations.js +173 -0
- package/dist/esm/resources/tax/capabilities.js +39 -0
- package/dist/esm/resources/tax/codes.js +34 -0
- package/dist/esm/resources/tax/complianceActions.js +53 -0
- package/dist/esm/resources/tax/deadlines.js +56 -0
- package/dist/esm/resources/tax/documents.js +125 -0
- package/dist/esm/resources/tax/index.js +63 -0
- package/dist/esm/resources/tax/locationEvidence.js +128 -0
- package/dist/esm/resources/tax/operatingLocations.js +95 -0
- package/dist/esm/resources/tax/products.js +64 -0
- package/dist/esm/resources/tax/registrationDeclarations.js +121 -0
- package/dist/esm/resources/tax/registrations.js +79 -0
- package/dist/esm/resources/tax/reports.js +89 -0
- package/dist/esm/resources/tax/reviewItems.js +113 -0
- package/dist/esm/resources/tax/ruleSet.js +65 -0
- package/dist/esm/resources/tax/salesDestinations.js +91 -0
- package/dist/esm/resources/tax/settings.js +101 -0
- package/dist/esm/resources/tax/shared.js +58 -0
- package/dist/esm/resources/tax/transactions.js +99 -0
- package/dist/esm/route.js +16 -0
- package/dist/esm/routes.js +27 -0
- package/dist/esm/vocabulary/billingPortal.js +12 -0
- package/dist/esm/vocabulary/catalog.js +106 -0
- package/dist/esm/vocabulary/checkout.js +50 -0
- package/dist/esm/vocabulary/connect.js +92 -0
- package/dist/esm/vocabulary/errors.js +169 -0
- package/dist/esm/vocabulary/events.js +173 -0
- package/dist/esm/vocabulary/files.js +41 -0
- package/dist/esm/vocabulary/index.js +21 -0
- package/dist/esm/vocabulary/invoices.js +49 -0
- package/dist/esm/vocabulary/lists.js +19 -0
- package/dist/esm/vocabulary/merchants.js +20 -0
- package/dist/esm/vocabulary/money.js +98 -0
- package/dist/esm/vocabulary/paymentMethodConfigurations.js +33 -0
- package/dist/esm/vocabulary/payments.js +192 -0
- package/dist/esm/vocabulary/reporting.js +24 -0
- package/dist/esm/vocabulary/subscriptions.js +57 -0
- package/dist/esm/vocabulary/tax.js +233 -0
- package/dist/esm/vocabulary/version.js +9 -0
- package/dist/types/common/address.d.ts +62 -0
- package/dist/types/common/envelopes.d.ts +88 -0
- package/dist/types/common/objects.d.ts +107 -0
- package/dist/types/common/params.d.ts +156 -0
- package/dist/types/common/primitives.d.ts +56 -0
- package/dist/types/contributions.d.ts +1 -0
- package/dist/types/index.d.ts +16 -134
- package/dist/types/openapi/document.d.ts +16 -0
- package/dist/types/openapi/index.d.ts +2 -0
- package/dist/types/openapi/webhooks.d.ts +15 -0
- package/dist/types/resources/billingEngine/billingPortal.d.ts +742 -0
- package/dist/types/resources/billingEngine/creditNotes.d.ts +655 -0
- package/dist/types/resources/billingEngine/customerBalanceTransactions.d.ts +282 -0
- package/dist/types/resources/billingEngine/index.d.ts +6071 -0
- package/dist/types/resources/billingEngine/invoiceItems.d.ts +502 -0
- package/dist/types/resources/billingEngine/invoices.d.ts +2547 -0
- package/dist/types/resources/billingEngine/params.d.ts +51 -0
- package/dist/types/resources/billingEngine/public.d.ts +1860 -0
- package/dist/types/resources/billingEngine/subscriptions.d.ts +1519 -0
- package/dist/types/resources/catalog/billing.d.ts +1723 -0
- package/dist/types/resources/catalog/billingSettings.d.ts +160 -0
- package/dist/types/resources/catalog/coupons.d.ts +403 -0
- package/dist/types/resources/catalog/entitlements.d.ts +422 -0
- package/dist/types/resources/catalog/index.d.ts +3155 -0
- package/dist/types/resources/catalog/meters.d.ts +474 -0
- package/dist/types/resources/catalog/prices.d.ts +1091 -0
- package/dist/types/resources/catalog/products.d.ts +430 -0
- package/dist/types/resources/catalog/promotionCodes.d.ts +369 -0
- package/dist/types/resources/catalog/shared.d.ts +34 -0
- package/dist/types/resources/catalog/testClocks.d.ts +220 -0
- package/dist/types/resources/checkout/checkoutSessions.d.ts +3207 -0
- package/dist/types/resources/checkout/contributions.d.ts +375 -0
- package/dist/types/resources/checkout/files.d.ts +280 -0
- package/dist/types/resources/checkout/index.d.ts +5678 -0
- package/dist/types/resources/checkout/merchants.d.ts +395 -0
- package/dist/types/resources/checkout/paymentLinks.d.ts +1728 -0
- package/dist/types/resources/checkout/paymentMethodConfigurations.d.ts +2104 -0
- package/dist/types/resources/checkout/shared.d.ts +419 -0
- package/dist/types/resources/connect/account.d.ts +483 -0
- package/dist/types/resources/connect/applicationFees.d.ts +198 -0
- package/dist/types/resources/connect/balance.d.ts +399 -0
- package/dist/types/resources/connect/connectedAccounts.d.ts +494 -0
- package/dist/types/resources/connect/index.d.ts +2094 -0
- package/dist/types/resources/connect/onboarding.d.ts +95 -0
- package/dist/types/resources/connect/payouts.d.ts +527 -0
- package/dist/types/resources/connect/reporting.d.ts +506 -0
- package/dist/types/resources/connect/requestLogs.d.ts +236 -0
- package/dist/types/resources/connect/transfers.d.ts +436 -0
- package/dist/types/resources/core/customers.d.ts +619 -0
- package/dist/types/resources/core/index.d.ts +679 -0
- package/dist/types/resources/core/paymentMethods.d.ts +336 -0
- package/dist/types/resources/events/events.d.ts +731 -0
- package/dist/types/resources/events/index.d.ts +1727 -0
- package/dist/types/resources/events/webhookDeliveries.d.ts +436 -0
- package/dist/types/resources/events/webhookEndpoints.d.ts +1502 -0
- package/dist/types/resources/payments/charges.d.ts +390 -0
- package/dist/types/resources/payments/disputes.d.ts +822 -0
- package/dist/types/resources/payments/index.d.ts +3517 -0
- package/dist/types/resources/payments/paymentIntents.d.ts +2080 -0
- package/dist/types/resources/payments/refunds.d.ts +684 -0
- package/dist/types/resources/payments/setupIntents.d.ts +391 -0
- package/dist/types/resources/payments/social.d.ts +266 -0
- package/dist/types/resources/payments/testHelpers.d.ts +178 -0
- package/dist/types/resources/tax/assessments.d.ts +787 -0
- package/dist/types/resources/tax/businessProfile.d.ts +134 -0
- package/dist/types/resources/tax/calculations.d.ts +261 -0
- package/dist/types/resources/tax/capabilities.d.ts +81 -0
- package/dist/types/resources/tax/codes.d.ts +29 -0
- package/dist/types/resources/tax/complianceActions.d.ts +97 -0
- package/dist/types/resources/tax/deadlines.d.ts +133 -0
- package/dist/types/resources/tax/documents.d.ts +257 -0
- package/dist/types/resources/tax/index.d.ts +1946 -0
- package/dist/types/resources/tax/locationEvidence.d.ts +246 -0
- package/dist/types/resources/tax/operatingLocations.d.ts +170 -0
- package/dist/types/resources/tax/products.d.ts +68 -0
- package/dist/types/resources/tax/registrationDeclarations.d.ts +270 -0
- package/dist/types/resources/tax/registrations.d.ts +103 -0
- package/dist/types/resources/tax/reports.d.ts +129 -0
- package/dist/types/resources/tax/reviewItems.d.ts +226 -0
- package/dist/types/resources/tax/ruleSet.d.ts +219 -0
- package/dist/types/resources/tax/salesDestinations.d.ts +158 -0
- package/dist/types/resources/tax/settings.d.ts +122 -0
- package/dist/types/resources/tax/shared.d.ts +43 -0
- package/dist/types/resources/tax/transactions.d.ts +404 -0
- package/dist/types/route.d.ts +86 -0
- package/dist/types/routes.d.ts +23 -0
- package/dist/types/vocabulary/billingPortal.d.ts +15 -0
- package/dist/types/vocabulary/catalog.d.ts +97 -0
- package/dist/types/vocabulary/checkout.d.ts +49 -0
- package/dist/types/vocabulary/connect.d.ts +62 -0
- package/dist/types/vocabulary/errors.d.ts +145 -0
- package/dist/types/vocabulary/events.d.ts +171 -0
- package/dist/types/vocabulary/files.d.ts +30 -0
- package/dist/types/vocabulary/index.d.ts +17 -0
- package/dist/types/vocabulary/invoices.d.ts +39 -0
- package/dist/types/vocabulary/lists.d.ts +9 -0
- package/dist/types/vocabulary/merchants.d.ts +9 -0
- package/dist/types/vocabulary/money.d.ts +59 -0
- package/dist/types/vocabulary/paymentMethodConfigurations.d.ts +22 -0
- package/dist/types/vocabulary/payments.d.ts +117 -0
- package/dist/types/vocabulary/reporting.d.ts +18 -0
- package/dist/types/vocabulary/subscriptions.d.ts +45 -0
- package/dist/types/vocabulary/tax.d.ts +163 -0
- package/dist/types/vocabulary/version.d.ts +10 -0
- package/package.json +51 -11
- package/dist/cjs/openapi.js +0 -138
- package/dist/esm/openapi.js +0 -134
- package/dist/types/openapi.d.ts +0 -145
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { listOf } from '../../common/envelopes.js';
|
|
3
|
+
import { defineComponent, defineObject } from '../../common/objects.js';
|
|
4
|
+
import { expandOnlyQuery, expandParam, listQuery, metadataCreateParam, metadataUpdateParam, queryBoolean, } from '../../common/params.js';
|
|
5
|
+
import { currency, livemode, metadata, network, unixSeconds } from '../../common/primitives.js';
|
|
6
|
+
import { defineRoute } from '../../route.js';
|
|
7
|
+
import { CHECKOUT_CUSTOMER_CREATIONS, CHECKOUT_LOCALES, CHECKOUT_SUBMIT_TYPES, PAYMENT_LINK_LIMITS, } from '../../vocabulary/checkout.js';
|
|
8
|
+
import { contributionAmountSchema, contributionDetailsSchema } from './contributions.js';
|
|
9
|
+
import { adjustableIssues, adjustableQuantityParam, checkoutBrandingSchema, checkoutIdParam, checkoutLineItemSchema, collectionParams, collectionResponseFields, localeParam, merchantDisplaySchema, quantityParam, railSchema, redirectUrlParam, } from './shared.js';
|
|
10
|
+
/**
|
|
11
|
+
* Payment Links (`link_…`, Orbit Phase 3) — Stripe's model: a shareable URL
|
|
12
|
+
* over catalog PRICES. A payer visiting it creates a Checkout Session with the
|
|
13
|
+
* link's line items and options; the session creates the payment when the
|
|
14
|
+
* payer confirms. Nothing about a link mints a payment on its own.
|
|
15
|
+
*
|
|
16
|
+
* A contribution link (an Oxy organization's FairCoin collection) is a payment
|
|
17
|
+
* link whose one line is the contribution itself — a fixed amount, or one the
|
|
18
|
+
* payer chooses — rather than a price.
|
|
19
|
+
*/
|
|
20
|
+
export const checkoutAfterCompletionSchema = defineComponent('CheckoutAfterCompletion', z
|
|
21
|
+
.object({
|
|
22
|
+
type: z.enum(['redirect', 'hosted_confirmation']),
|
|
23
|
+
redirect: z.object({ url: z.string() }).strict().nullable(),
|
|
24
|
+
hosted_confirmation: z.object({ custom_message: z.string().nullable() }).strict().nullable(),
|
|
25
|
+
})
|
|
26
|
+
.strict());
|
|
27
|
+
const linkFields = {
|
|
28
|
+
id: z.string(),
|
|
29
|
+
object: z.literal('payment_link'),
|
|
30
|
+
livemode,
|
|
31
|
+
active: z.boolean(),
|
|
32
|
+
currency,
|
|
33
|
+
rail: railSchema,
|
|
34
|
+
network: network.nullable(),
|
|
35
|
+
line_items: z
|
|
36
|
+
.array(checkoutLineItemSchema)
|
|
37
|
+
.describe("The link's prices (`GET /v1/payment_links/{id}/line_items` lists them in full)."),
|
|
38
|
+
contribution: contributionDetailsSchema
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Present on an organization contribution link (FairCoin).'),
|
|
41
|
+
locale: z.enum(CHECKOUT_LOCALES).nullable(),
|
|
42
|
+
};
|
|
43
|
+
export const paymentLinkSchema = defineObject('payment_link', 'PaymentLink', z
|
|
44
|
+
.object({
|
|
45
|
+
...linkFields,
|
|
46
|
+
allow_promotion_codes: z.boolean(),
|
|
47
|
+
...collectionResponseFields,
|
|
48
|
+
automatic_tax: z.object({ enabled: z.boolean() }).strict(),
|
|
49
|
+
customer_creation: z.enum(CHECKOUT_CUSTOMER_CREATIONS),
|
|
50
|
+
after_completion: checkoutAfterCompletionSchema,
|
|
51
|
+
restrictions: z
|
|
52
|
+
.object({
|
|
53
|
+
completed_sessions: z
|
|
54
|
+
.object({ limit: z.number().int(), count: z.number().int() })
|
|
55
|
+
.strict(),
|
|
56
|
+
})
|
|
57
|
+
.strict()
|
|
58
|
+
.nullable(),
|
|
59
|
+
submit_type: z.enum(CHECKOUT_SUBMIT_TYPES),
|
|
60
|
+
metadata,
|
|
61
|
+
url: z
|
|
62
|
+
.string()
|
|
63
|
+
.describe('`checkout.peable.to/l/<id>` — share it, or render it as a QR code.'),
|
|
64
|
+
created: unixSeconds,
|
|
65
|
+
updated_at: unixSeconds,
|
|
66
|
+
})
|
|
67
|
+
.strict(), {
|
|
68
|
+
examples: [
|
|
69
|
+
{
|
|
70
|
+
id: 'link_0193b8f2c1a87d3e9f4a',
|
|
71
|
+
object: 'payment_link',
|
|
72
|
+
livemode: false,
|
|
73
|
+
active: true,
|
|
74
|
+
currency: 'EUR',
|
|
75
|
+
rail: 'card',
|
|
76
|
+
network: null,
|
|
77
|
+
line_items: [],
|
|
78
|
+
allow_promotion_codes: false,
|
|
79
|
+
billing_address_collection: 'auto',
|
|
80
|
+
shipping_address_collection: null,
|
|
81
|
+
phone_number_collection: { enabled: false },
|
|
82
|
+
tax_id_collection: { enabled: false },
|
|
83
|
+
custom_fields: [],
|
|
84
|
+
consent_collection: null,
|
|
85
|
+
automatic_tax: { enabled: false },
|
|
86
|
+
customer_creation: 'if_required',
|
|
87
|
+
after_completion: {
|
|
88
|
+
type: 'hosted_confirmation',
|
|
89
|
+
redirect: null,
|
|
90
|
+
hosted_confirmation: { custom_message: null },
|
|
91
|
+
},
|
|
92
|
+
restrictions: null,
|
|
93
|
+
submit_type: 'auto',
|
|
94
|
+
locale: null,
|
|
95
|
+
metadata: {},
|
|
96
|
+
url: 'https://checkout.peable.to/l/link_0193b8f2c1a87d3e9f4a',
|
|
97
|
+
created: 1793750400,
|
|
98
|
+
updated_at: 1793750400,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
/** What an anonymous visitor may see before checkout starts — no metadata, no counts. */
|
|
103
|
+
export const publicPaymentLinkSchema = defineComponent('PublicPaymentLink', z
|
|
104
|
+
.object({
|
|
105
|
+
...linkFields,
|
|
106
|
+
contribution_amount: z
|
|
107
|
+
.string()
|
|
108
|
+
.nullable()
|
|
109
|
+
.describe("A fixed contribution's amount; `null` when the payer chooses (or for a price link)."),
|
|
110
|
+
merchant: merchantDisplaySchema,
|
|
111
|
+
branding: checkoutBrandingSchema,
|
|
112
|
+
})
|
|
113
|
+
.strict());
|
|
114
|
+
/** `POST /v1/payment_links/{id}/checkout_sessions`' answer: the hosted session and the secret that opens it. */
|
|
115
|
+
export const paymentLinkSessionStartSchema = defineComponent('PaymentLinkSessionStart', z
|
|
116
|
+
.object({
|
|
117
|
+
object: z.literal('checkout_session_start'),
|
|
118
|
+
id: z.string().describe('The Checkout Session (`cs_…`).'),
|
|
119
|
+
client_secret: z.string(),
|
|
120
|
+
url: z.string().describe('The hosted checkout to send the payer to.'),
|
|
121
|
+
})
|
|
122
|
+
.strict());
|
|
123
|
+
// ---- Requests --------------------------------------------------------------------
|
|
124
|
+
/** One `line_items[]` entry of a payment link — a catalog price only. */
|
|
125
|
+
export const linkLineItemParams = z
|
|
126
|
+
.object({
|
|
127
|
+
price: checkoutIdParam,
|
|
128
|
+
quantity: quantityParam,
|
|
129
|
+
adjustable_quantity: adjustableQuantityParam.optional(),
|
|
130
|
+
})
|
|
131
|
+
.strict()
|
|
132
|
+
.superRefine((line, ctx) => adjustableIssues(line.quantity, line.adjustable_quantity, ctx));
|
|
133
|
+
const afterCompletionParams = z
|
|
134
|
+
.object({
|
|
135
|
+
type: z.enum(['redirect', 'hosted_confirmation']),
|
|
136
|
+
redirect: z.object({ url: redirectUrlParam }).strict().optional(),
|
|
137
|
+
hosted_confirmation: z
|
|
138
|
+
.object({
|
|
139
|
+
custom_message: z
|
|
140
|
+
.string()
|
|
141
|
+
.trim()
|
|
142
|
+
.min(1)
|
|
143
|
+
.max(PAYMENT_LINK_LIMITS.customMessageMax)
|
|
144
|
+
.optional(),
|
|
145
|
+
})
|
|
146
|
+
.strict()
|
|
147
|
+
.optional(),
|
|
148
|
+
})
|
|
149
|
+
.strict()
|
|
150
|
+
.superRefine((value, ctx) => {
|
|
151
|
+
if (value.type === 'redirect' && !value.redirect) {
|
|
152
|
+
ctx.addIssue({ code: 'custom', path: ['redirect'], message: 'redirect.url is required' });
|
|
153
|
+
}
|
|
154
|
+
if (value.type === 'redirect' && value.hosted_confirmation) {
|
|
155
|
+
ctx.addIssue({
|
|
156
|
+
code: 'custom',
|
|
157
|
+
path: ['hosted_confirmation'],
|
|
158
|
+
message: 'hosted_confirmation is for type hosted_confirmation',
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (value.type === 'hosted_confirmation' && value.redirect) {
|
|
162
|
+
ctx.addIssue({
|
|
163
|
+
code: 'custom',
|
|
164
|
+
path: ['redirect'],
|
|
165
|
+
message: 'redirect is for type redirect',
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
const restrictionsParams = z
|
|
170
|
+
.object({
|
|
171
|
+
completed_sessions: z.object({ limit: z.number().int().min(1).max(1000000) }).strict(),
|
|
172
|
+
})
|
|
173
|
+
.strict();
|
|
174
|
+
const optionParams = {
|
|
175
|
+
allow_promotion_codes: z.boolean().optional(),
|
|
176
|
+
...collectionParams,
|
|
177
|
+
automatic_tax: z.object({ enabled: z.boolean() }).strict().optional(),
|
|
178
|
+
customer_creation: z.enum(CHECKOUT_CUSTOMER_CREATIONS).optional(),
|
|
179
|
+
after_completion: afterCompletionParams.optional(),
|
|
180
|
+
submit_type: z.enum(CHECKOUT_SUBMIT_TYPES).optional(),
|
|
181
|
+
locale: localeParam.optional(),
|
|
182
|
+
};
|
|
183
|
+
/** `POST /v1/payment_links`: 1–20 one-time prices of ONE currency. */
|
|
184
|
+
export const createPaymentLinkParams = z
|
|
185
|
+
.object({
|
|
186
|
+
line_items: z.array(linkLineItemParams).min(1).max(PAYMENT_LINK_LIMITS.lineItemsMax),
|
|
187
|
+
...optionParams,
|
|
188
|
+
restrictions: restrictionsParams.optional(),
|
|
189
|
+
metadata: metadataCreateParam.optional(),
|
|
190
|
+
expand: expandParam.optional(),
|
|
191
|
+
})
|
|
192
|
+
.strict();
|
|
193
|
+
/**
|
|
194
|
+
* `POST /v1/payment_links/{id}` — everything but the line items, which are
|
|
195
|
+
* fixed once shared (a payer may hold a session priced from them). `""`
|
|
196
|
+
* clears; `metadata` is a patch.
|
|
197
|
+
*/
|
|
198
|
+
export const updatePaymentLinkParams = z
|
|
199
|
+
.object({
|
|
200
|
+
active: z.boolean().optional(),
|
|
201
|
+
...optionParams,
|
|
202
|
+
shipping_address_collection: z
|
|
203
|
+
.union([collectionParams.shipping_address_collection.unwrap(), z.literal('')])
|
|
204
|
+
.optional(),
|
|
205
|
+
custom_fields: z.union([collectionParams.custom_fields.unwrap(), z.literal('')]).optional(),
|
|
206
|
+
restrictions: z.union([restrictionsParams, z.literal('')]).optional(),
|
|
207
|
+
metadata: metadataUpdateParam.optional(),
|
|
208
|
+
expand: expandParam.optional(),
|
|
209
|
+
})
|
|
210
|
+
.strict();
|
|
211
|
+
export const listPaymentLinksQuery = listQuery({ active: queryBoolean.optional() });
|
|
212
|
+
/** A link's lines: a complete set of at most twenty (`has_more` is `false`). */
|
|
213
|
+
export const listPaymentLinkLineItemsQuery = listQuery({});
|
|
214
|
+
/**
|
|
215
|
+
* `POST /v1/payment_links/{id}/checkout_sessions` — a payer starting checkout.
|
|
216
|
+
* A contribution link the payer prices takes `amount`; nothing else is the
|
|
217
|
+
* payer's to say.
|
|
218
|
+
*/
|
|
219
|
+
export const createPaymentLinkSessionParams = z
|
|
220
|
+
.object({
|
|
221
|
+
amount: z
|
|
222
|
+
.string()
|
|
223
|
+
.refine((value) => contributionAmountSchema.safeParse(value).success, 'Enter a positive FairCoin base-unit amount within the supported range')
|
|
224
|
+
.optional()
|
|
225
|
+
.describe("A free contribution's amount, in FAIR base units."),
|
|
226
|
+
})
|
|
227
|
+
.strict();
|
|
228
|
+
const linkId = { id: 'The payment link (`link_…`).' };
|
|
229
|
+
export const paymentLinkRoutes = [
|
|
230
|
+
defineRoute({
|
|
231
|
+
operationId: 'createPaymentLink',
|
|
232
|
+
method: 'post',
|
|
233
|
+
path: '/v1/payment_links',
|
|
234
|
+
tag: 'Payment Links',
|
|
235
|
+
summary: 'Create a payment link',
|
|
236
|
+
auth: 'service',
|
|
237
|
+
scope: 'payments:write',
|
|
238
|
+
idempotent: true,
|
|
239
|
+
body: createPaymentLinkParams,
|
|
240
|
+
response: paymentLinkSchema,
|
|
241
|
+
status: 201,
|
|
242
|
+
sdk: 'paymentLinks.create',
|
|
243
|
+
expandable: 'payment_link',
|
|
244
|
+
}),
|
|
245
|
+
defineRoute({
|
|
246
|
+
operationId: 'listPaymentLinks',
|
|
247
|
+
method: 'get',
|
|
248
|
+
path: '/v1/payment_links',
|
|
249
|
+
tag: 'Payment Links',
|
|
250
|
+
summary: 'List payment links',
|
|
251
|
+
auth: 'service',
|
|
252
|
+
scope: 'payments:read',
|
|
253
|
+
query: listPaymentLinksQuery,
|
|
254
|
+
response: listOf(paymentLinkSchema),
|
|
255
|
+
sdk: 'paymentLinks.list',
|
|
256
|
+
expandable: 'payment_link',
|
|
257
|
+
}),
|
|
258
|
+
defineRoute({
|
|
259
|
+
operationId: 'retrievePaymentLink',
|
|
260
|
+
method: 'get',
|
|
261
|
+
path: '/v1/payment_links/{id}',
|
|
262
|
+
tag: 'Payment Links',
|
|
263
|
+
summary: 'Retrieve a payment link',
|
|
264
|
+
auth: 'service',
|
|
265
|
+
scope: 'payments:read',
|
|
266
|
+
params: linkId,
|
|
267
|
+
query: expandOnlyQuery,
|
|
268
|
+
response: paymentLinkSchema,
|
|
269
|
+
sdk: 'paymentLinks.retrieve',
|
|
270
|
+
expandable: 'payment_link',
|
|
271
|
+
}),
|
|
272
|
+
defineRoute({
|
|
273
|
+
operationId: 'updatePaymentLink',
|
|
274
|
+
method: 'post',
|
|
275
|
+
path: '/v1/payment_links/{id}',
|
|
276
|
+
tag: 'Payment Links',
|
|
277
|
+
summary: 'Update a payment link',
|
|
278
|
+
description: 'Everything but the line items. `""` clears a field; `metadata` is a patch.',
|
|
279
|
+
auth: 'service',
|
|
280
|
+
scope: 'payments:write',
|
|
281
|
+
idempotent: true,
|
|
282
|
+
params: linkId,
|
|
283
|
+
body: updatePaymentLinkParams,
|
|
284
|
+
response: paymentLinkSchema,
|
|
285
|
+
sdk: 'paymentLinks.update',
|
|
286
|
+
expandable: 'payment_link',
|
|
287
|
+
}),
|
|
288
|
+
defineRoute({
|
|
289
|
+
operationId: 'listPaymentLinkLineItems',
|
|
290
|
+
method: 'get',
|
|
291
|
+
path: '/v1/payment_links/{id}/line_items',
|
|
292
|
+
tag: 'Payment Links',
|
|
293
|
+
summary: "List a payment link's line items",
|
|
294
|
+
description: 'A complete set of at most twenty lines: `has_more` is always `false`.',
|
|
295
|
+
auth: 'service',
|
|
296
|
+
scope: 'payments:read',
|
|
297
|
+
params: linkId,
|
|
298
|
+
query: listPaymentLinkLineItemsQuery,
|
|
299
|
+
response: listOf(checkoutLineItemSchema),
|
|
300
|
+
sdk: 'paymentLinks.listLineItems',
|
|
301
|
+
expandable: 'item',
|
|
302
|
+
}),
|
|
303
|
+
defineRoute({
|
|
304
|
+
operationId: 'retrievePaymentLinkPublic',
|
|
305
|
+
method: 'get',
|
|
306
|
+
path: '/v1/payment_links/{id}/public',
|
|
307
|
+
tag: 'Payment Links',
|
|
308
|
+
summary: 'Retrieve a payment link as a visitor',
|
|
309
|
+
description: 'Anonymous and rate-limited: what a visitor sees before checkout starts. An inactive (or expired contribution) link answers with `active: false`, so the page can say so.',
|
|
310
|
+
auth: 'public',
|
|
311
|
+
params: linkId,
|
|
312
|
+
response: publicPaymentLinkSchema,
|
|
313
|
+
}),
|
|
314
|
+
defineRoute({
|
|
315
|
+
operationId: 'createPaymentLinkCheckoutSession',
|
|
316
|
+
method: 'post',
|
|
317
|
+
path: '/v1/payment_links/{id}/checkout_sessions',
|
|
318
|
+
tag: 'Payment Links',
|
|
319
|
+
summary: 'Start checkout from a payment link',
|
|
320
|
+
description: 'Anonymous and rate-limited. Creates a Checkout Session from the STORED link — never a payment. A contribution link requires a UUID `Idempotency-Key` header, written by the page before the request, so a lost answer recovers the same session.',
|
|
321
|
+
auth: 'public',
|
|
322
|
+
params: linkId,
|
|
323
|
+
body: createPaymentLinkSessionParams,
|
|
324
|
+
response: paymentLinkSessionStartSchema,
|
|
325
|
+
status: 201,
|
|
326
|
+
}),
|
|
327
|
+
];
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { listOf } from '../../common/envelopes.js';
|
|
3
|
+
import { defineComponent, defineObject } from '../../common/objects.js';
|
|
4
|
+
import { expandOnlyQuery, listQuery, queryBoolean } from '../../common/params.js';
|
|
5
|
+
import { fiatCurrency, livemode, unixSeconds } from '../../common/primitives.js';
|
|
6
|
+
import { defineRoute } from '../../route.js';
|
|
7
|
+
import { PAYMENT_METHOD_CONFIGURATION_TYPES, PAYMENT_METHOD_UNAVAILABLE_REASONS, } from '../../vocabulary/paymentMethodConfigurations.js';
|
|
8
|
+
/**
|
|
9
|
+
* Payment method breadth on the card rail — which methods a merchant's payers
|
|
10
|
+
* are offered (`pmc_…`), and the web domains wallets may run on (`pmd_…`).
|
|
11
|
+
* Both are Orbit's objects; the provider's configuration and domain are
|
|
12
|
+
* bindings behind them (ADR 0016). Card data and bank credentials are entered
|
|
13
|
+
* in the provider's hosted fields and never reach Peable (PCI SAQ-A).
|
|
14
|
+
*/
|
|
15
|
+
/** The merchant's choice (`none`: Orbit's default) and what is in effect. */
|
|
16
|
+
export const paymentMethodDisplayPreferenceSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
preference: z.enum(['on', 'off', 'none']),
|
|
19
|
+
value: z.enum(['on', 'off']),
|
|
20
|
+
})
|
|
21
|
+
.strict();
|
|
22
|
+
export const paymentMethodConfigurationEntrySchema = defineComponent('PaymentMethodConfigurationEntry', z
|
|
23
|
+
.object({
|
|
24
|
+
available: z
|
|
25
|
+
.boolean()
|
|
26
|
+
.describe('Whether payers can be offered this method: it is on and nothing prevents it.'),
|
|
27
|
+
display_preference: paymentMethodDisplayPreferenceSchema,
|
|
28
|
+
unavailable_reason: z
|
|
29
|
+
.enum(PAYMENT_METHOD_UNAVAILABLE_REASONS)
|
|
30
|
+
.nullable()
|
|
31
|
+
.describe('Why it cannot be offered whatever the merchant chooses; `null` when it can.'),
|
|
32
|
+
currencies: z.array(fiatCurrency).describe('The payment currencies it is offered on.'),
|
|
33
|
+
})
|
|
34
|
+
.strict());
|
|
35
|
+
const entryFields = Object.fromEntries(PAYMENT_METHOD_CONFIGURATION_TYPES.map((type) => [type, paymentMethodConfigurationEntrySchema]));
|
|
36
|
+
export const paymentMethodConfigurationSchema = defineObject('payment_method_configuration', 'PaymentMethodConfiguration', z
|
|
37
|
+
.object({
|
|
38
|
+
id: z.string(),
|
|
39
|
+
object: z.literal('payment_method_configuration'),
|
|
40
|
+
livemode,
|
|
41
|
+
name: z.string(),
|
|
42
|
+
active: z
|
|
43
|
+
.boolean()
|
|
44
|
+
.describe('An inactive configuration cannot be named on a new PaymentIntent. The default is always active.'),
|
|
45
|
+
is_default: z
|
|
46
|
+
.boolean()
|
|
47
|
+
.describe('The configuration a PaymentIntent uses when it names none. One per merchant.'),
|
|
48
|
+
created: unixSeconds,
|
|
49
|
+
updated_at: unixSeconds,
|
|
50
|
+
...entryFields,
|
|
51
|
+
})
|
|
52
|
+
.strict());
|
|
53
|
+
/** A wallet's standing on one domain. */
|
|
54
|
+
export const paymentMethodDomainWalletStatusSchema = defineComponent('PaymentMethodDomainWalletStatus', z
|
|
55
|
+
.object({
|
|
56
|
+
status: z
|
|
57
|
+
.enum(['active', 'inactive'])
|
|
58
|
+
.describe('`active`: the wallet can run on pages served from this domain.'),
|
|
59
|
+
status_details: z
|
|
60
|
+
.object({ error_message: z.string() })
|
|
61
|
+
.strict()
|
|
62
|
+
.nullable()
|
|
63
|
+
.describe("Present while `inactive`: what the wallet's verification said."),
|
|
64
|
+
})
|
|
65
|
+
.strict());
|
|
66
|
+
/**
|
|
67
|
+
* A web domain the merchant serves payment pages from (`pmd_…`), registered so
|
|
68
|
+
* Apple Pay and Google Pay run there. Peable's own hosted checkout needs none.
|
|
69
|
+
*/
|
|
70
|
+
export const paymentMethodDomainSchema = defineObject('payment_method_domain', 'PaymentMethodDomain', z
|
|
71
|
+
.object({
|
|
72
|
+
id: z.string(),
|
|
73
|
+
object: z.literal('payment_method_domain'),
|
|
74
|
+
livemode,
|
|
75
|
+
domain_name: z.string().describe('Lowercase hostname, no scheme, port or path.'),
|
|
76
|
+
enabled: z.boolean().describe('Whether wallets may run on it at all.'),
|
|
77
|
+
apple_pay: paymentMethodDomainWalletStatusSchema,
|
|
78
|
+
google_pay: paymentMethodDomainWalletStatusSchema,
|
|
79
|
+
created: unixSeconds,
|
|
80
|
+
})
|
|
81
|
+
.strict(), {
|
|
82
|
+
examples: [
|
|
83
|
+
{
|
|
84
|
+
id: 'pmd_0193b8f2c1a87d3e9f4a',
|
|
85
|
+
object: 'payment_method_domain',
|
|
86
|
+
livemode: false,
|
|
87
|
+
domain_name: 'shop.example.com',
|
|
88
|
+
enabled: true,
|
|
89
|
+
apple_pay: { status: 'active', status_details: null },
|
|
90
|
+
google_pay: { status: 'active', status_details: null },
|
|
91
|
+
created: 1793750400,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
});
|
|
95
|
+
/** One method's setting in a create or update. `none` returns it to Orbit's default. */
|
|
96
|
+
export const paymentMethodConfigurationEntryParams = z
|
|
97
|
+
.object({
|
|
98
|
+
display_preference: z.object({ preference: z.enum(['on', 'off', 'none']) }).strict(),
|
|
99
|
+
})
|
|
100
|
+
.strict();
|
|
101
|
+
const methodParams = Object.fromEntries(PAYMENT_METHOD_CONFIGURATION_TYPES.map((type) => [
|
|
102
|
+
type,
|
|
103
|
+
paymentMethodConfigurationEntryParams.optional(),
|
|
104
|
+
]));
|
|
105
|
+
/** `POST /v1/payment_method_configurations` — an additional, non-default configuration. */
|
|
106
|
+
export const createPaymentMethodConfigurationParams = z
|
|
107
|
+
.object({ name: z.string().min(1).max(100).optional(), ...methodParams })
|
|
108
|
+
.strict();
|
|
109
|
+
/** `POST /v1/payment_method_configurations/{id}` — methods (merged), name, active. */
|
|
110
|
+
export const updatePaymentMethodConfigurationParams = z
|
|
111
|
+
.object({
|
|
112
|
+
name: z.string().min(1).max(100).optional(),
|
|
113
|
+
active: z.boolean().optional(),
|
|
114
|
+
...methodParams,
|
|
115
|
+
})
|
|
116
|
+
.strict();
|
|
117
|
+
export const listPaymentMethodConfigurationsQuery = listQuery({});
|
|
118
|
+
export const createPaymentMethodDomainParams = z
|
|
119
|
+
.object({ domain_name: z.string().min(1).max(300), enabled: z.boolean().optional() })
|
|
120
|
+
.strict();
|
|
121
|
+
export const updatePaymentMethodDomainParams = z
|
|
122
|
+
.object({ enabled: z.boolean().optional() })
|
|
123
|
+
.strict();
|
|
124
|
+
/** The validate body: nothing. */
|
|
125
|
+
export const validatePaymentMethodDomainParams = z.object({}).strict();
|
|
126
|
+
export const listPaymentMethodDomainsQuery = listQuery({
|
|
127
|
+
domain_name: z.string().min(1).max(253).optional().describe('Exact match, any case.'),
|
|
128
|
+
enabled: queryBoolean.optional(),
|
|
129
|
+
});
|
|
130
|
+
const pmcId = { id: 'The configuration (`pmc_…`).' };
|
|
131
|
+
const pmdId = { id: 'The domain (`pmd_…`).' };
|
|
132
|
+
export const paymentMethodConfigurationRoutes = [
|
|
133
|
+
defineRoute({
|
|
134
|
+
operationId: 'listPaymentMethodConfigurations',
|
|
135
|
+
method: 'get',
|
|
136
|
+
path: '/v1/payment_method_configurations',
|
|
137
|
+
tag: 'Payment method configurations',
|
|
138
|
+
summary: 'List payment method configurations',
|
|
139
|
+
description: 'The default configuration is created on first read.',
|
|
140
|
+
auth: 'service',
|
|
141
|
+
scope: 'payments:read',
|
|
142
|
+
query: listPaymentMethodConfigurationsQuery,
|
|
143
|
+
response: listOf(paymentMethodConfigurationSchema),
|
|
144
|
+
sdk: 'paymentMethodConfigurations.list',
|
|
145
|
+
expandable: 'payment_method_configuration',
|
|
146
|
+
}),
|
|
147
|
+
defineRoute({
|
|
148
|
+
operationId: 'createPaymentMethodConfiguration',
|
|
149
|
+
method: 'post',
|
|
150
|
+
path: '/v1/payment_method_configurations',
|
|
151
|
+
tag: 'Payment method configurations',
|
|
152
|
+
summary: 'Create a payment method configuration',
|
|
153
|
+
description: 'An additional, non-default configuration. Turning `on` a method the processing provider does not offer is refused.',
|
|
154
|
+
auth: 'service',
|
|
155
|
+
scope: 'payments:write',
|
|
156
|
+
idempotent: true,
|
|
157
|
+
body: createPaymentMethodConfigurationParams,
|
|
158
|
+
response: paymentMethodConfigurationSchema,
|
|
159
|
+
sdk: 'paymentMethodConfigurations.create',
|
|
160
|
+
}),
|
|
161
|
+
defineRoute({
|
|
162
|
+
operationId: 'retrievePaymentMethodConfiguration',
|
|
163
|
+
method: 'get',
|
|
164
|
+
path: '/v1/payment_method_configurations/{id}',
|
|
165
|
+
tag: 'Payment method configurations',
|
|
166
|
+
summary: 'Retrieve a payment method configuration',
|
|
167
|
+
auth: 'service',
|
|
168
|
+
scope: 'payments:read',
|
|
169
|
+
params: pmcId,
|
|
170
|
+
query: expandOnlyQuery,
|
|
171
|
+
response: paymentMethodConfigurationSchema,
|
|
172
|
+
sdk: 'paymentMethodConfigurations.retrieve',
|
|
173
|
+
expandable: 'payment_method_configuration',
|
|
174
|
+
}),
|
|
175
|
+
defineRoute({
|
|
176
|
+
operationId: 'updatePaymentMethodConfiguration',
|
|
177
|
+
method: 'post',
|
|
178
|
+
path: '/v1/payment_method_configurations/{id}',
|
|
179
|
+
tag: 'Payment method configurations',
|
|
180
|
+
summary: 'Update a payment method configuration',
|
|
181
|
+
description: 'Method settings are merged; the default configuration is always active.',
|
|
182
|
+
auth: 'service',
|
|
183
|
+
scope: 'payments:write',
|
|
184
|
+
idempotent: true,
|
|
185
|
+
params: pmcId,
|
|
186
|
+
body: updatePaymentMethodConfigurationParams,
|
|
187
|
+
response: paymentMethodConfigurationSchema,
|
|
188
|
+
sdk: 'paymentMethodConfigurations.update',
|
|
189
|
+
}),
|
|
190
|
+
defineRoute({
|
|
191
|
+
operationId: 'listPaymentMethodDomains',
|
|
192
|
+
method: 'get',
|
|
193
|
+
path: '/v1/payment_method_domains',
|
|
194
|
+
tag: 'Payment method domains',
|
|
195
|
+
summary: 'List payment method domains',
|
|
196
|
+
auth: 'service',
|
|
197
|
+
scope: 'payments:read',
|
|
198
|
+
query: listPaymentMethodDomainsQuery,
|
|
199
|
+
response: listOf(paymentMethodDomainSchema),
|
|
200
|
+
sdk: 'paymentMethodDomains.list',
|
|
201
|
+
expandable: 'payment_method_domain',
|
|
202
|
+
}),
|
|
203
|
+
defineRoute({
|
|
204
|
+
operationId: 'createPaymentMethodDomain',
|
|
205
|
+
method: 'post',
|
|
206
|
+
path: '/v1/payment_method_domains',
|
|
207
|
+
tag: 'Payment method domains',
|
|
208
|
+
summary: 'Register a payment method domain',
|
|
209
|
+
auth: 'service',
|
|
210
|
+
scope: 'payments:write',
|
|
211
|
+
idempotent: true,
|
|
212
|
+
body: createPaymentMethodDomainParams,
|
|
213
|
+
response: paymentMethodDomainSchema,
|
|
214
|
+
sdk: 'paymentMethodDomains.create',
|
|
215
|
+
}),
|
|
216
|
+
defineRoute({
|
|
217
|
+
operationId: 'retrievePaymentMethodDomain',
|
|
218
|
+
method: 'get',
|
|
219
|
+
path: '/v1/payment_method_domains/{id}',
|
|
220
|
+
tag: 'Payment method domains',
|
|
221
|
+
summary: 'Retrieve a payment method domain',
|
|
222
|
+
auth: 'service',
|
|
223
|
+
scope: 'payments:read',
|
|
224
|
+
params: pmdId,
|
|
225
|
+
query: expandOnlyQuery,
|
|
226
|
+
response: paymentMethodDomainSchema,
|
|
227
|
+
sdk: 'paymentMethodDomains.retrieve',
|
|
228
|
+
expandable: 'payment_method_domain',
|
|
229
|
+
}),
|
|
230
|
+
defineRoute({
|
|
231
|
+
operationId: 'updatePaymentMethodDomain',
|
|
232
|
+
method: 'post',
|
|
233
|
+
path: '/v1/payment_method_domains/{id}',
|
|
234
|
+
tag: 'Payment method domains',
|
|
235
|
+
summary: 'Update a payment method domain',
|
|
236
|
+
auth: 'service',
|
|
237
|
+
scope: 'payments:write',
|
|
238
|
+
idempotent: true,
|
|
239
|
+
params: pmdId,
|
|
240
|
+
body: updatePaymentMethodDomainParams,
|
|
241
|
+
response: paymentMethodDomainSchema,
|
|
242
|
+
sdk: 'paymentMethodDomains.update',
|
|
243
|
+
}),
|
|
244
|
+
defineRoute({
|
|
245
|
+
operationId: 'validatePaymentMethodDomain',
|
|
246
|
+
method: 'post',
|
|
247
|
+
path: '/v1/payment_method_domains/{id}/validate',
|
|
248
|
+
tag: 'Payment method domains',
|
|
249
|
+
summary: 'Validate a payment method domain',
|
|
250
|
+
description: "Re-runs the wallets' verification of the domain.",
|
|
251
|
+
auth: 'service',
|
|
252
|
+
scope: 'payments:write',
|
|
253
|
+
idempotent: true,
|
|
254
|
+
params: pmdId,
|
|
255
|
+
body: validatePaymentMethodDomainParams,
|
|
256
|
+
response: paymentMethodDomainSchema,
|
|
257
|
+
sdk: 'paymentMethodDomains.validate',
|
|
258
|
+
}),
|
|
259
|
+
];
|