@peable.to/contracts 2.0.0 → 3.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.
- package/dist/cjs/resources/catalog/index.js +1 -5
- package/dist/cjs/resources/checkout/checkoutSessions.js +0 -4
- package/dist/cjs/resources/events/events.js +1 -32
- package/dist/cjs/resources/events/webhookDeliveries.js +1 -1
- package/dist/cjs/resources/events/webhookEndpoints.js +1 -1
- package/dist/cjs/resources/payments/disputes.js +16 -0
- package/dist/cjs/resources/payments/refunds.js +46 -11
- package/dist/cjs/vocabulary/catalog.js +1 -17
- package/dist/cjs/vocabulary/errors.js +0 -13
- package/dist/cjs/vocabulary/events.js +5 -1
- package/dist/esm/resources/catalog/index.js +1 -5
- package/dist/esm/resources/checkout/checkoutSessions.js +0 -4
- package/dist/esm/resources/events/events.js +0 -31
- package/dist/esm/resources/events/webhookDeliveries.js +1 -1
- package/dist/esm/resources/events/webhookEndpoints.js +1 -1
- package/dist/esm/resources/payments/disputes.js +16 -0
- package/dist/esm/resources/payments/refunds.js +46 -11
- package/dist/esm/vocabulary/catalog.js +0 -16
- package/dist/esm/vocabulary/errors.js +0 -13
- package/dist/esm/vocabulary/events.js +5 -1
- package/dist/types/resources/catalog/index.d.ts +1 -851
- package/dist/types/resources/checkout/checkoutSessions.d.ts +13 -61
- package/dist/types/resources/checkout/index.d.ts +10 -46
- package/dist/types/resources/connect/balance.d.ts +5 -5
- package/dist/types/resources/connect/index.d.ts +4 -4
- package/dist/types/resources/connect/payouts.d.ts +2 -2
- package/dist/types/resources/events/events.d.ts +0 -22
- package/dist/types/resources/events/index.d.ts +7 -15
- package/dist/types/resources/events/webhookDeliveries.d.ts +0 -3
- package/dist/types/resources/events/webhookEndpoints.d.ts +11 -16
- package/dist/types/resources/payments/disputes.d.ts +35 -0
- package/dist/types/resources/payments/index.d.ts +82 -10
- package/dist/types/resources/payments/paymentIntents.d.ts +10 -10
- package/dist/types/resources/payments/refunds.d.ts +56 -5
- package/dist/types/resources/payments/testHelpers.d.ts +1 -1
- package/dist/types/resources/tax/index.d.ts +1 -1
- package/dist/types/resources/tax/registrations.d.ts +2 -2
- package/dist/types/vocabulary/catalog.d.ts +0 -9
- package/dist/types/vocabulary/errors.d.ts +0 -13
- package/dist/types/vocabulary/events.d.ts +5 -2
- package/package.json +1 -1
- package/dist/cjs/resources/catalog/billing.js +0 -753
- package/dist/esm/resources/catalog/billing.js +0 -750
- package/dist/types/resources/catalog/billing.d.ts +0 -1723
|
@@ -42,19 +42,15 @@ export const ERROR_CODE_DESCRIPTIONS = {
|
|
|
42
42
|
account_invalid: 'The `Peable-Account` header names no connected account of this platform.',
|
|
43
43
|
account_missing: 'The merchant has no account object yet.',
|
|
44
44
|
amount_not_representable: 'The amount does not fit the currency or the rail.',
|
|
45
|
-
billing_not_enabled: 'Billing is not enabled for this merchant.',
|
|
46
|
-
billing_provider_unavailable: 'The billing provider could not be reached; retry.',
|
|
47
45
|
domain_taken: 'The domain is already registered by another merchant.',
|
|
48
46
|
file_too_large: 'The uploaded file is larger than its purpose allows.',
|
|
49
47
|
file_unavailable: 'The file exists but its contents cannot be served right now.',
|
|
50
48
|
idempotency_error: 'The `Idempotency-Key` was used with a different request, or its first request is still running.',
|
|
51
49
|
idempotency_key_invalid: 'The `Idempotency-Key` header is not a valid key.',
|
|
52
50
|
insufficient_scope: 'The credential is valid but was not granted the Oxy scope this route requires (`payments:read`, `payments:write`, …); `message` names it.',
|
|
53
|
-
invalid_billing_request: 'The billing request is not valid for this subscription or offer.',
|
|
54
51
|
keyless_recipient: 'The recipient has no receive key, so no address can be derived for them.',
|
|
55
52
|
link_not_found: 'The link does not exist or is no longer active.',
|
|
56
53
|
live_payments_gated: 'Live payments are not enabled for this application yet.',
|
|
57
|
-
local_test_request_required: 'This test helper only answers a local test request.',
|
|
58
54
|
parameter_invalid: 'A parameter is invalid; `param` names it.',
|
|
59
55
|
parameter_missing: 'A required parameter is missing; `param` names it.',
|
|
60
56
|
parameter_unknown: 'The request carries a parameter this route does not accept; `param` names it.',
|
|
@@ -83,10 +79,7 @@ export const ERROR_CODE_DESCRIPTIONS = {
|
|
|
83
79
|
customer_location_invalid: "The tax provider could not use the customer's location.",
|
|
84
80
|
dispute_already_submitted: 'Evidence for this dispute has already been submitted; it is one shot.',
|
|
85
81
|
dispute_not_answerable: 'The dispute is in a status that no longer accepts evidence.',
|
|
86
|
-
idempotency_conflict: 'The same operation key was used for a different billing request.',
|
|
87
|
-
identity_conflict: 'The billing identity already belongs to another customer or subscription.',
|
|
88
82
|
in_progress: 'The same operation is still running; retry with the same key.',
|
|
89
|
-
invalid_provider_response: 'The provider answered with something Peable cannot trust; the operation was not applied.',
|
|
90
83
|
invalid_registration: 'The tax registration is not valid.',
|
|
91
84
|
invalid_registration_declaration: 'The tax registration declaration is not valid.',
|
|
92
85
|
invalid_tax_code: 'The tax code does not exist.',
|
|
@@ -101,12 +94,9 @@ export const ERROR_CODE_DESCRIPTIONS = {
|
|
|
101
94
|
product_in_use: 'The product is referenced by a subscription or a link.',
|
|
102
95
|
promotion_code_invalid: 'The promotion code does not exist, is inactive or does not apply.',
|
|
103
96
|
promotion_code_taken: 'Another active promotion code already uses this `code`.',
|
|
104
|
-
provider_unavailable: 'The payment provider could not be reached; retry.',
|
|
105
97
|
rail_unavailable: 'The payment rail this request needs is not available.',
|
|
106
|
-
reconciliation_required: 'The billing operation has an unknown outcome at the provider and is being reconciled.',
|
|
107
98
|
registration_immutable: 'An approved or ended tax registration cannot be deleted or changed this way; end it instead.',
|
|
108
99
|
resource_already_exists: 'An object with this identity already exists.',
|
|
109
|
-
result_expired: 'The stored result of this operation has expired.',
|
|
110
100
|
review_item_not_open: 'The review item is already resolved or dismissed.',
|
|
111
101
|
rule_set_version_unavailable: 'The tax rule set version is not available.',
|
|
112
102
|
subscription_line_invalid: 'A subscription line item is not valid for Checkout.',
|
|
@@ -114,9 +104,6 @@ export const ERROR_CODE_DESCRIPTIONS = {
|
|
|
114
104
|
tax_calculation_unavailable: 'Tax could not be calculated; a covered sale fails closed.',
|
|
115
105
|
tax_provider_registration_mismatch: "The provider's registrations disagree with the ones Peable has approved.",
|
|
116
106
|
tax_settings_not_active: 'Tax settings are not active for this merchant.',
|
|
117
|
-
local_test_unavailable: 'The local test checkout is not available.',
|
|
118
|
-
local_test_configuration_unavailable: 'The local test checkout has no provider configuration.',
|
|
119
|
-
local_test_subscription_unavailable: 'The local test subscription cannot be read.',
|
|
120
107
|
rail_mismatch: 'The operation does not apply to the rail this payment uses.',
|
|
121
108
|
checkout_session_changed: 'The Checkout Session changed while this request ran (a price, a discount, its tax); read it again and retry.',
|
|
122
109
|
checkout_session_locked: 'The Checkout Session is being confirmed and cannot change.',
|
|
@@ -58,7 +58,6 @@ export const WEBHOOK_EVENT_OBJECTS = {
|
|
|
58
58
|
'setup_intent.succeeded': 'setup_intent',
|
|
59
59
|
'setup_intent.setup_failed': 'setup_intent',
|
|
60
60
|
'setup_intent.canceled': 'setup_intent',
|
|
61
|
-
'billing.observation.updated': 'billing_observation',
|
|
62
61
|
'connected_account.updated': 'connected_account',
|
|
63
62
|
'product.created': 'product',
|
|
64
63
|
'product.updated': 'product',
|
|
@@ -148,10 +147,15 @@ export const WEBHOOK_ENDPOINT_STATUSES = ['enabled', 'disabled'];
|
|
|
148
147
|
* - `delivery_failures` — every delivery to it failed for three days
|
|
149
148
|
* straight, so Peable stopped sending. Re-enabling it (`disabled: false`)
|
|
150
149
|
* starts the clock again.
|
|
150
|
+
* - `url_refused` — its stored `url` breaks the rules a URL is
|
|
151
|
+
* registered under (https in live mode, ports 80/443, no private, loopback
|
|
152
|
+
* or reserved address), judged again before every delivery, so Peable never
|
|
153
|
+
* sent to it. It is re-enabled only together with a `url` that passes.
|
|
151
154
|
*/
|
|
152
155
|
export const WEBHOOK_ENDPOINT_DISABLED_REASONS = [
|
|
153
156
|
'disabled_by_merchant',
|
|
154
157
|
'delivery_failures',
|
|
158
|
+
'url_refused',
|
|
155
159
|
];
|
|
156
160
|
/** At most this many endpoints per merchant (per mode). */
|
|
157
161
|
export const WEBHOOK_ENDPOINTS_MAX_PER_MERCHANT = 16;
|