@leaflow/sdk 0.0.0-dev.200.g306375c → 0.0.0-dev.202.gfb7bf64
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.
|
@@ -43,6 +43,8 @@ export type UpdateBillingAccountResult = operations["update-billing-account"]["r
|
|
|
43
43
|
export type UpdateBillingAccountBody = NonNullable<operations["update-billing-account"]["requestBody"]>["content"]["application/json"];
|
|
44
44
|
/** The success response body of `GET /account/v1/billing-accounts/{accountId}/balance`. */
|
|
45
45
|
export type GetAccountBalanceResult = operations["get-account-balance"]["responses"][200]["content"]["application/json"];
|
|
46
|
+
/** The success response body of `GET /account/v1/billing-accounts/{accountId}/payment-options`. */
|
|
47
|
+
export type ListPaymentOptionsResult = operations["list-payment-options"]["responses"][200]["content"]["application/json"];
|
|
46
48
|
/** The success response body of `GET /account/v1/projects`. */
|
|
47
49
|
export type ListBillingAccountProjectsResult = operations["list-billing-account-projects"]["responses"][200]["content"]["application/json"];
|
|
48
50
|
/** The query parameters of `GET /account/v1/projects`. */
|
|
@@ -61,6 +63,8 @@ export type CreateTopUpResult = operations["create-top-up"]["responses"][201]["c
|
|
|
61
63
|
export type CreateTopUpBody = NonNullable<operations["create-top-up"]["requestBody"]>["content"]["application/json"];
|
|
62
64
|
/** The success response body of `GET /account/v1/top-ups/{topUpId}`. */
|
|
63
65
|
export type GetTopUpResult = operations["get-top-up"]["responses"][200]["content"]["application/json"];
|
|
66
|
+
/** The success response body of `POST /account/v1/top-ups/{topUpId}/cancel`. */
|
|
67
|
+
export type CancelTopUpResult = operations["cancel-top-up"]["responses"][200]["content"]["application/json"];
|
|
64
68
|
/** The success response body of `GET /account/v1/payment-methods`. */
|
|
65
69
|
export type ListPaymentMethodsResult = operations["list-payment-methods"]["responses"][200]["content"]["application/json"];
|
|
66
70
|
/** The success response body of `POST /account/v1/payment-methods/setup`. */
|
|
@@ -296,6 +296,31 @@ export interface paths {
|
|
|
296
296
|
patch?: never;
|
|
297
297
|
trace?: never;
|
|
298
298
|
};
|
|
299
|
+
"/account/v1/billing-accounts/{accountId}/payment-options": {
|
|
300
|
+
parameters: {
|
|
301
|
+
query?: never;
|
|
302
|
+
header?: never;
|
|
303
|
+
path: {
|
|
304
|
+
accountId: components["parameters"]["AccountId"];
|
|
305
|
+
};
|
|
306
|
+
cookie?: never;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* List payment options
|
|
310
|
+
* @description Lists the payment gateways and methods that currently accept payment in this account's currency, the
|
|
311
|
+
* preferred gateway first. Top-ups and invoice payments must name a gateway and method listed here;
|
|
312
|
+
* others are refused. An empty list means no online payment is available for this account. Not paged: the
|
|
313
|
+
* set is a few rows.
|
|
314
|
+
*/
|
|
315
|
+
get: operations["list-payment-options"];
|
|
316
|
+
put?: never;
|
|
317
|
+
post?: never;
|
|
318
|
+
delete?: never;
|
|
319
|
+
options?: never;
|
|
320
|
+
head?: never;
|
|
321
|
+
patch?: never;
|
|
322
|
+
trace?: never;
|
|
323
|
+
};
|
|
299
324
|
"/account/v1/projects": {
|
|
300
325
|
parameters: {
|
|
301
326
|
query?: never;
|
|
@@ -370,7 +395,8 @@ export interface paths {
|
|
|
370
395
|
};
|
|
371
396
|
/**
|
|
372
397
|
* List top ups
|
|
373
|
-
* @description Lists only the authenticated user's top-ups. Includes pending and
|
|
398
|
+
* @description Lists only the authenticated user's top-ups. Includes pending, failed and canceled attempts; no invoice is
|
|
399
|
+
* created for a top-up. Items carry no `action`; read a pending top-up with get-top-up to continue its payment.
|
|
374
400
|
*/
|
|
375
401
|
get: operations["list-top-ups"];
|
|
376
402
|
put?: never;
|
|
@@ -398,7 +424,12 @@ export interface paths {
|
|
|
398
424
|
};
|
|
399
425
|
/**
|
|
400
426
|
* Get top up
|
|
401
|
-
* @description Reads a top-up owned by the authenticated user, including its outcome and the part of it not yet spent.
|
|
427
|
+
* @description Reads a top-up owned by the authenticated user, including its outcome and the part of it not yet spent.
|
|
428
|
+
* It is not an invoice.
|
|
429
|
+
*
|
|
430
|
+
* While the top-up is pending, the answer includes the customer's next step as the payment gateway
|
|
431
|
+
* currently reports it, so that a payment interrupted by a closed page can be continued. When the gateway
|
|
432
|
+
* cannot be reached, the top-up is returned without `action`; read it again later.
|
|
402
433
|
*/
|
|
403
434
|
get: operations["get-top-up"];
|
|
404
435
|
put?: never;
|
|
@@ -409,6 +440,38 @@ export interface paths {
|
|
|
409
440
|
patch?: never;
|
|
410
441
|
trace?: never;
|
|
411
442
|
};
|
|
443
|
+
"/account/v1/top-ups/{topUpId}/cancel": {
|
|
444
|
+
parameters: {
|
|
445
|
+
query?: never;
|
|
446
|
+
header?: never;
|
|
447
|
+
path: {
|
|
448
|
+
topUpId: string;
|
|
449
|
+
};
|
|
450
|
+
cookie?: never;
|
|
451
|
+
};
|
|
452
|
+
get?: never;
|
|
453
|
+
put?: never;
|
|
454
|
+
/**
|
|
455
|
+
* Cancel top up
|
|
456
|
+
* @description Withdraws a pending top-up owned by the authenticated user at the payment gateway. It becomes
|
|
457
|
+
* `canceled` with `cancellation_reason` `requested_by_customer`, and no money is collected for it. Canceling a
|
|
458
|
+
* top-up that is already canceled returns it unchanged.
|
|
459
|
+
*
|
|
460
|
+
* If the gateway has already collected the payment, nothing is withdrawn and the top-up is returned
|
|
461
|
+
* as `succeeded` with the balance increased. Check `status` in the answer rather than assuming the
|
|
462
|
+
* cancellation took effect.
|
|
463
|
+
*
|
|
464
|
+
* Fails with 409 and BILLING_TOPUP_NOT_CANCELABLE when the top-up has already succeeded or failed,
|
|
465
|
+
* with `status` naming that outcome, and while the gateway is processing the payment and can no
|
|
466
|
+
* longer withdraw it, with `status` set to `pending`; read the top-up again later in that case.
|
|
467
|
+
*/
|
|
468
|
+
post: operations["cancel-top-up"];
|
|
469
|
+
delete?: never;
|
|
470
|
+
options?: never;
|
|
471
|
+
head?: never;
|
|
472
|
+
patch?: never;
|
|
473
|
+
trace?: never;
|
|
474
|
+
};
|
|
412
475
|
"/account/v1/payment-methods": {
|
|
413
476
|
parameters: {
|
|
414
477
|
query?: never;
|
|
@@ -1451,13 +1514,19 @@ export interface components {
|
|
|
1451
1514
|
*/
|
|
1452
1515
|
remaining_amount?: components["schemas"]["Money"];
|
|
1453
1516
|
/**
|
|
1454
|
-
* @description `pending` until the payment gateway
|
|
1517
|
+
* @description `pending` until the payment gateway reaches a result. The balance increases on `succeeded`.
|
|
1518
|
+
*
|
|
1519
|
+
* `failed` means the gateway declined the payment. `canceled` means the attempt was withdrawn
|
|
1520
|
+
* without collecting money; `cancellation_reason` says why. Unknown gateway outcomes remain
|
|
1521
|
+
* `pending`, and a browser redirect is not proof of payment.
|
|
1455
1522
|
*
|
|
1456
|
-
*
|
|
1457
|
-
*
|
|
1523
|
+
* `failed` and `canceled` are final. If the gateway nevertheless collects payment for such an
|
|
1524
|
+
* attempt, the amount is credited as a separate `succeeded` top-up.
|
|
1458
1525
|
* @enum {string}
|
|
1459
1526
|
*/
|
|
1460
|
-
status: "pending" | "succeeded" | "failed";
|
|
1527
|
+
status: "pending" | "succeeded" | "failed" | "canceled";
|
|
1528
|
+
/** @description Why the top-up was withdrawn. Present with `canceled`. */
|
|
1529
|
+
cancellation_reason?: components["schemas"]["PaymentCancellationReason"];
|
|
1461
1530
|
/** @description Which payment gateway collected it. */
|
|
1462
1531
|
payment_gateway?: string;
|
|
1463
1532
|
/** @description The selected payment method, such as card, wechat_pay or alipay. */
|
|
@@ -1472,9 +1541,13 @@ export interface components {
|
|
|
1472
1541
|
* the figure that appears on the customer's card or wallet statement.
|
|
1473
1542
|
*/
|
|
1474
1543
|
presentment_amount?: components["schemas"]["Money"];
|
|
1475
|
-
/** @description Why
|
|
1544
|
+
/** @description Why the gateway declined it. Present with `failed`. */
|
|
1476
1545
|
failure_reason?: string;
|
|
1477
|
-
/**
|
|
1546
|
+
/**
|
|
1547
|
+
* @description The customer's next step while the top-up is `pending` and the gateway still awaits them. Returned
|
|
1548
|
+
* by create-top-up and get-top-up as the gateway currently reports it; absent from list-top-ups and
|
|
1549
|
+
* once the top-up has a result. Completing it does not replace confirmation of receipt.
|
|
1550
|
+
*/
|
|
1478
1551
|
action?: components["schemas"]["PaymentAction"];
|
|
1479
1552
|
/** Format: date-time */
|
|
1480
1553
|
created_at: string;
|
|
@@ -1528,6 +1601,30 @@ export interface components {
|
|
|
1528
1601
|
/** Format: int64 */
|
|
1529
1602
|
total_count?: number;
|
|
1530
1603
|
};
|
|
1604
|
+
/**
|
|
1605
|
+
* @description Why a gateway payment was withdrawn. `abandoned` means the customer did not complete it within the time
|
|
1606
|
+
* allowed for payment. `requested_by_customer` means the customer canceled it.
|
|
1607
|
+
* @enum {string}
|
|
1608
|
+
*/
|
|
1609
|
+
PaymentCancellationReason: "abandoned" | "requested_by_customer";
|
|
1610
|
+
/** @description A payment gateway that accepts payment in the account's currency, with the methods it accepts. */
|
|
1611
|
+
PaymentOption: {
|
|
1612
|
+
/** @description The value to send as `payment_gateway`. */
|
|
1613
|
+
payment_gateway: string;
|
|
1614
|
+
methods: components["schemas"]["PaymentOptionMethod"][];
|
|
1615
|
+
};
|
|
1616
|
+
PaymentOptionMethod: {
|
|
1617
|
+
/** @description The value to send as `method_type`, such as card, wechat_pay or alipay. */
|
|
1618
|
+
method_type: string;
|
|
1619
|
+
/**
|
|
1620
|
+
* @description Whether a method of this type can be saved with create-payment-method-setup and charged later
|
|
1621
|
+
* without the customer present. Methods that are not reusable are paid anew each time.
|
|
1622
|
+
*/
|
|
1623
|
+
reusable: boolean;
|
|
1624
|
+
};
|
|
1625
|
+
PaymentOptionList: {
|
|
1626
|
+
items: components["schemas"]["PaymentOption"][];
|
|
1627
|
+
};
|
|
1531
1628
|
PaymentMethod: {
|
|
1532
1629
|
/** Format: uuid */
|
|
1533
1630
|
id: string;
|
|
@@ -1797,10 +1894,18 @@ export interface components {
|
|
|
1797
1894
|
credit_grant?: components["schemas"]["ObjectIdentity"];
|
|
1798
1895
|
/** Format: uuid */
|
|
1799
1896
|
refund_id?: string;
|
|
1800
|
-
/**
|
|
1801
|
-
|
|
1897
|
+
/**
|
|
1898
|
+
* @description `failed` means the operation did not succeed; for a gateway payment, that the gateway declined it.
|
|
1899
|
+
* `canceled` means a gateway payment was withdrawn without collecting money; an invoice it was meant
|
|
1900
|
+
* to pay remains open for another payment.
|
|
1901
|
+
* @enum {string}
|
|
1902
|
+
*/
|
|
1903
|
+
status?: "pending" | "succeeded" | "failed" | "canceled";
|
|
1904
|
+
/** @description Why the payment was withdrawn. Present with `canceled`. */
|
|
1905
|
+
cancellation_reason?: components["schemas"]["PaymentCancellationReason"];
|
|
1802
1906
|
payment_gateway?: string;
|
|
1803
1907
|
method_type?: string;
|
|
1908
|
+
/** @description Why it failed. Present with `failed`. */
|
|
1804
1909
|
failure_reason?: string;
|
|
1805
1910
|
/** Format: date-time */
|
|
1806
1911
|
settled_at?: string;
|
|
@@ -3084,6 +3189,29 @@ export interface operations {
|
|
|
3084
3189
|
default: components["responses"]["Error"];
|
|
3085
3190
|
};
|
|
3086
3191
|
};
|
|
3192
|
+
"list-payment-options": {
|
|
3193
|
+
parameters: {
|
|
3194
|
+
query?: never;
|
|
3195
|
+
header?: never;
|
|
3196
|
+
path: {
|
|
3197
|
+
accountId: components["parameters"]["AccountId"];
|
|
3198
|
+
};
|
|
3199
|
+
cookie?: never;
|
|
3200
|
+
};
|
|
3201
|
+
requestBody?: never;
|
|
3202
|
+
responses: {
|
|
3203
|
+
/** @description OK */
|
|
3204
|
+
200: {
|
|
3205
|
+
headers: {
|
|
3206
|
+
[name: string]: unknown;
|
|
3207
|
+
};
|
|
3208
|
+
content: {
|
|
3209
|
+
"application/json": components["schemas"]["PaymentOptionList"];
|
|
3210
|
+
};
|
|
3211
|
+
};
|
|
3212
|
+
default: components["responses"]["Error"];
|
|
3213
|
+
};
|
|
3214
|
+
};
|
|
3087
3215
|
"list-billing-account-projects": {
|
|
3088
3216
|
parameters: {
|
|
3089
3217
|
query?: {
|
|
@@ -3258,6 +3386,38 @@ export interface operations {
|
|
|
3258
3386
|
default: components["responses"]["Error"];
|
|
3259
3387
|
};
|
|
3260
3388
|
};
|
|
3389
|
+
"cancel-top-up": {
|
|
3390
|
+
parameters: {
|
|
3391
|
+
query?: never;
|
|
3392
|
+
header?: never;
|
|
3393
|
+
path: {
|
|
3394
|
+
topUpId: string;
|
|
3395
|
+
};
|
|
3396
|
+
cookie?: never;
|
|
3397
|
+
};
|
|
3398
|
+
requestBody?: never;
|
|
3399
|
+
responses: {
|
|
3400
|
+
/** @description The top-up after the request, canceled or succeeded. */
|
|
3401
|
+
200: {
|
|
3402
|
+
headers: {
|
|
3403
|
+
[name: string]: unknown;
|
|
3404
|
+
};
|
|
3405
|
+
content: {
|
|
3406
|
+
"application/json": components["schemas"]["TopUp"];
|
|
3407
|
+
};
|
|
3408
|
+
};
|
|
3409
|
+
/** @description The top-up already has another outcome or can no longer be withdrawn. */
|
|
3410
|
+
409: {
|
|
3411
|
+
headers: {
|
|
3412
|
+
[name: string]: unknown;
|
|
3413
|
+
};
|
|
3414
|
+
content: {
|
|
3415
|
+
"application/json": components["schemas"]["Error"];
|
|
3416
|
+
};
|
|
3417
|
+
};
|
|
3418
|
+
default: components["responses"]["Error"];
|
|
3419
|
+
};
|
|
3420
|
+
};
|
|
3261
3421
|
"list-payment-methods": {
|
|
3262
3422
|
parameters: {
|
|
3263
3423
|
query?: {
|