@zinn-digital/sdk 0.1.1946 → 0.1.1948
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/generated/schema.d.ts +199 -0
- package/package.json +1 -1
|
@@ -41878,6 +41878,60 @@ export interface paths {
|
|
|
41878
41878
|
patch?: never;
|
|
41879
41879
|
trace?: never;
|
|
41880
41880
|
};
|
|
41881
|
+
"/v1/orders/{orderId}/card-payment": {
|
|
41882
|
+
parameters: {
|
|
41883
|
+
query?: never;
|
|
41884
|
+
header?: never;
|
|
41885
|
+
path: {
|
|
41886
|
+
/** @description The order's id. */
|
|
41887
|
+
orderId: components["parameters"]["OrderId"];
|
|
41888
|
+
};
|
|
41889
|
+
cookie?: never;
|
|
41890
|
+
};
|
|
41891
|
+
get?: never;
|
|
41892
|
+
put?: never;
|
|
41893
|
+
/**
|
|
41894
|
+
* Open a card payment the customer's browser confirms.
|
|
41895
|
+
* @description CARDAUTH (DAY-0434). Opens ONE card payment per order at the processor, for the browser to confirm with the processor's library, so a 3-D Secure challenge opens in the page. Calling it again while that payment is open returns the same one. The amount is computed here from the order, never from the request.
|
|
41896
|
+
*
|
|
41897
|
+
* Account credit pays first, exactly as on `payOrder`: the card is asked only for the remainder, and the credit is drawn only when the card part is confirmed captured, so an abandoned or failed challenge costs no credit. When credit pays the whole order no card payment is opened and `status` is `covered_by_credit`: settle with `payOrder`.
|
|
41898
|
+
*
|
|
41899
|
+
* Pay once is the default: the card is kept for renewals only when `save_card` is true.
|
|
41900
|
+
*
|
|
41901
|
+
* Opens are limited per organisation and per order (each one reads the processor); over the limit the answer is `429` with `Retry-After`. A repeated call for the same order within the limit returns the same open payment.
|
|
41902
|
+
*/
|
|
41903
|
+
post: operations["startOrderCardPayment"];
|
|
41904
|
+
delete?: never;
|
|
41905
|
+
options?: never;
|
|
41906
|
+
head?: never;
|
|
41907
|
+
patch?: never;
|
|
41908
|
+
trace?: never;
|
|
41909
|
+
};
|
|
41910
|
+
"/v1/orders/{orderId}/card-payment/confirm": {
|
|
41911
|
+
parameters: {
|
|
41912
|
+
query?: never;
|
|
41913
|
+
header?: never;
|
|
41914
|
+
path: {
|
|
41915
|
+
/** @description The order's id. */
|
|
41916
|
+
orderId: components["parameters"]["OrderId"];
|
|
41917
|
+
};
|
|
41918
|
+
cookie?: never;
|
|
41919
|
+
};
|
|
41920
|
+
get?: never;
|
|
41921
|
+
put?: never;
|
|
41922
|
+
/**
|
|
41923
|
+
* Settle the order from the card payment the browser confirmed.
|
|
41924
|
+
* @description ⛔ **The browser is not believed.** The engine re-reads the payment from the processor and settles only when it succeeded, for this order's remainder, in its currency, with this order and organisation in its metadata. The processor's webhook is the second path to the same single settlement, so a closed tab still pays the order.
|
|
41925
|
+
*
|
|
41926
|
+
* A declined card or a failed 3-D Secure challenge answers 200 with `payment_failed`, the class of failure and the other rails; nothing was taken and the order is payable again.
|
|
41927
|
+
*/
|
|
41928
|
+
post: operations["confirmOrderCardPayment"];
|
|
41929
|
+
delete?: never;
|
|
41930
|
+
options?: never;
|
|
41931
|
+
head?: never;
|
|
41932
|
+
patch?: never;
|
|
41933
|
+
trace?: never;
|
|
41934
|
+
};
|
|
41881
41935
|
"/v1/orders/{orderId}/customer-action": {
|
|
41882
41936
|
parameters: {
|
|
41883
41937
|
query?: never;
|
|
@@ -98019,6 +98073,44 @@ export interface components {
|
|
|
98019
98073
|
/** @description Elapsed-time SLA for an automated service; `null` where there is no committed one. A database optimisation does not care that it is Sunday. */
|
|
98020
98074
|
sla_hours: number | null;
|
|
98021
98075
|
};
|
|
98076
|
+
/** @description The order after the engine re-read the card payment from the processor. `paid`: settled. `requires_action`: the browser still has a step to finish (3-D Secure). `processing`: the processor has not decided; the webhook settles it. `held`: money was captured but cannot settle this order as recorded (another payment paid it, or the amount changed); staff were told and nothing is refunded automatically. `payment_failed`: nothing was taken; read `failure_class` and offer `other_rails`. */
|
|
98077
|
+
OrderCardPaymentResult: {
|
|
98078
|
+
failure_class?: components["schemas"]["PaymentDeclineClass"];
|
|
98079
|
+
order_status?: string;
|
|
98080
|
+
/** @description The other gateways this order may be paid on (`getOrderPaymentOptions`). */
|
|
98081
|
+
other_rails?: string[];
|
|
98082
|
+
settled: boolean;
|
|
98083
|
+
/** @enum {string} */
|
|
98084
|
+
status: "paid" | "requires_action" | "processing" | "held" | "payment_failed";
|
|
98085
|
+
};
|
|
98086
|
+
/** @description A card payment the customer's browser confirms (CARDAUTH, DAY-0434), so a 3-D Secure challenge opens in the page. `covered_by_credit`: account credit pays the whole order, no card payment was opened, and the client settles with `payOrder`. */
|
|
98087
|
+
OrderCardPaymentStart: {
|
|
98088
|
+
/**
|
|
98089
|
+
* Format: int64
|
|
98090
|
+
* @description What the card is asked for, in minor units (the order total less credit).
|
|
98091
|
+
*/
|
|
98092
|
+
amount_minor: number;
|
|
98093
|
+
/** @description True only when the customer ticked "save this card": the processor keeps the card for off-session renewals. False (the default) is pay once; nothing is kept. */
|
|
98094
|
+
card_reuse_applied?: boolean;
|
|
98095
|
+
/** @description The processor's client secret, for `confirmPayment` in the browser only. Never stored or logged by the client. Absent when `status` is `covered_by_credit`. */
|
|
98096
|
+
client_token?: string;
|
|
98097
|
+
/**
|
|
98098
|
+
* Format: int64
|
|
98099
|
+
* @description The account credit that pays the rest, drawn only once the card part is captured.
|
|
98100
|
+
*/
|
|
98101
|
+
credit_minor: number;
|
|
98102
|
+
currency: string;
|
|
98103
|
+
/** @enum {string} */
|
|
98104
|
+
intent_kind?: "payment";
|
|
98105
|
+
/** @description The processor's payment id, posted back to `confirmOrderCardPayment`. */
|
|
98106
|
+
payment_intent_id?: string;
|
|
98107
|
+
/** @description The processor's publishable key for the browser library. */
|
|
98108
|
+
publishable_key?: string;
|
|
98109
|
+
/** @enum {string} */
|
|
98110
|
+
rail: "card";
|
|
98111
|
+
/** @enum {string} */
|
|
98112
|
+
status: "requires_payment" | "covered_by_credit";
|
|
98113
|
+
};
|
|
98022
98114
|
/** @description ⛔ Shape only. Everything that decides whether the provider would accept the order — the provider, the zone, the size, the disk/bandwidth pair — is validated in the engine, because those rules must hold for a workflow activity and a management command too, and the sentence a customer reads must be the same whichever door they came through. */
|
|
98023
98115
|
OrderComputeServerRequest: {
|
|
98024
98116
|
/** @description An explicit transfer allocation, for a provider whose `supports_disk_and_bandwidth` is true. */
|
|
@@ -193305,6 +193397,113 @@ export interface operations {
|
|
|
193305
193397
|
429: components["responses"]["TooManyRequests"];
|
|
193306
193398
|
};
|
|
193307
193399
|
};
|
|
193400
|
+
startOrderCardPayment: {
|
|
193401
|
+
parameters: {
|
|
193402
|
+
query?: never;
|
|
193403
|
+
header?: never;
|
|
193404
|
+
path: {
|
|
193405
|
+
/** @description The order's id. */
|
|
193406
|
+
orderId: components["parameters"]["OrderId"];
|
|
193407
|
+
};
|
|
193408
|
+
cookie?: never;
|
|
193409
|
+
};
|
|
193410
|
+
requestBody?: {
|
|
193411
|
+
content: {
|
|
193412
|
+
"application/json": {
|
|
193413
|
+
/**
|
|
193414
|
+
* @description The customer ticked "save this card" for automatic renewals.
|
|
193415
|
+
* @default false
|
|
193416
|
+
*/
|
|
193417
|
+
save_card?: boolean;
|
|
193418
|
+
};
|
|
193419
|
+
};
|
|
193420
|
+
};
|
|
193421
|
+
responses: {
|
|
193422
|
+
/** @description The card payment to confirm in the browser, or `covered_by_credit`. */
|
|
193423
|
+
200: {
|
|
193424
|
+
headers: {
|
|
193425
|
+
[name: string]: unknown;
|
|
193426
|
+
};
|
|
193427
|
+
content: {
|
|
193428
|
+
"application/json": components["schemas"]["OrderCardPaymentStart"];
|
|
193429
|
+
};
|
|
193430
|
+
};
|
|
193431
|
+
401: components["responses"]["Unauthorized"];
|
|
193432
|
+
403: components["responses"]["Forbidden"];
|
|
193433
|
+
404: components["responses"]["NotFound"];
|
|
193434
|
+
/** @description Another payment for this order is already being processed (`refusal.commerce.paymentInFlight`), or an included domain is no longer available. */
|
|
193435
|
+
409: {
|
|
193436
|
+
headers: {
|
|
193437
|
+
[name: string]: unknown;
|
|
193438
|
+
};
|
|
193439
|
+
content: {
|
|
193440
|
+
"application/json": components["schemas"]["Error"];
|
|
193441
|
+
};
|
|
193442
|
+
};
|
|
193443
|
+
/** @description The order is already paid, cannot be paid, or cannot be paid by card in the browser. */
|
|
193444
|
+
422: {
|
|
193445
|
+
headers: {
|
|
193446
|
+
[name: string]: unknown;
|
|
193447
|
+
};
|
|
193448
|
+
content: {
|
|
193449
|
+
"application/json": components["schemas"]["Error"];
|
|
193450
|
+
};
|
|
193451
|
+
};
|
|
193452
|
+
429: components["responses"]["TooManyRequests"];
|
|
193453
|
+
};
|
|
193454
|
+
};
|
|
193455
|
+
confirmOrderCardPayment: {
|
|
193456
|
+
parameters: {
|
|
193457
|
+
query?: never;
|
|
193458
|
+
header?: never;
|
|
193459
|
+
path: {
|
|
193460
|
+
/** @description The order's id. */
|
|
193461
|
+
orderId: components["parameters"]["OrderId"];
|
|
193462
|
+
};
|
|
193463
|
+
cookie?: never;
|
|
193464
|
+
};
|
|
193465
|
+
requestBody: {
|
|
193466
|
+
content: {
|
|
193467
|
+
"application/json": {
|
|
193468
|
+
/** @description The id returned by `startOrderCardPayment`. */
|
|
193469
|
+
payment_intent_id: string;
|
|
193470
|
+
};
|
|
193471
|
+
};
|
|
193472
|
+
};
|
|
193473
|
+
responses: {
|
|
193474
|
+
/** @description The result of the re-read. Read `status`. */
|
|
193475
|
+
200: {
|
|
193476
|
+
headers: {
|
|
193477
|
+
[name: string]: unknown;
|
|
193478
|
+
};
|
|
193479
|
+
content: {
|
|
193480
|
+
"application/json": components["schemas"]["OrderCardPaymentResult"];
|
|
193481
|
+
};
|
|
193482
|
+
};
|
|
193483
|
+
401: components["responses"]["Unauthorized"];
|
|
193484
|
+
403: components["responses"]["Forbidden"];
|
|
193485
|
+
404: components["responses"]["NotFound"];
|
|
193486
|
+
/** @description Nothing was settled: the payment named is not this order's, or the processor holds another amount or currency (`refusal.commerce.cardPaymentMismatch`, audited), or another payment for this order is being processed (`refusal.commerce.paymentInFlight`). */
|
|
193487
|
+
409: {
|
|
193488
|
+
headers: {
|
|
193489
|
+
[name: string]: unknown;
|
|
193490
|
+
};
|
|
193491
|
+
content: {
|
|
193492
|
+
"application/json": components["schemas"]["Error"];
|
|
193493
|
+
};
|
|
193494
|
+
};
|
|
193495
|
+
/** @description No `payment_intent_id`, or the order cannot be paid. */
|
|
193496
|
+
422: {
|
|
193497
|
+
headers: {
|
|
193498
|
+
[name: string]: unknown;
|
|
193499
|
+
};
|
|
193500
|
+
content: {
|
|
193501
|
+
"application/json": components["schemas"]["Error"];
|
|
193502
|
+
};
|
|
193503
|
+
};
|
|
193504
|
+
429: components["responses"]["TooManyRequests"];
|
|
193505
|
+
};
|
|
193506
|
+
};
|
|
193308
193507
|
openOrderCustomerAction: {
|
|
193309
193508
|
parameters: {
|
|
193310
193509
|
query?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zinn-digital/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1948",
|
|
4
4
|
"description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",
|