@leaflow/sdk 0.127.0 → 0.127.1

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.
@@ -891,7 +891,7 @@ export interface AccountBalance {
891
891
  * spendable balance and may differ from the recorded credits total.
892
892
  */
893
893
  credit_groups: CreditGroup[];
894
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
894
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
895
895
  due: Money;
896
896
  pending_returns_amount: Money;
897
897
  }
@@ -21,7 +21,7 @@ export const AccountBalance = zod
21
21
  credit_groups: zod
22
22
  .array(CreditGroup)
23
23
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
24
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
24
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
25
25
  pending_returns_amount: Money,
26
26
  })
27
27
  .describe("Account balance, credits, and unpaid charges are reported separately.");
@@ -607,8 +607,12 @@ export declare const getPayInvoiceUrl: (invoiceId: string) => string;
607
607
  * `BILLING_CHANGE_NOT_INVOICED`.
608
608
  *
609
609
  * Returns a payment action when customer interaction is required. requires_action and processing
610
- * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved payment
611
- * attempt is reused, and retries do not apply credit grants or balance twice.
610
+ * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved online
611
+ * payment made with the same gateway, method and saved payment method is reused, and retries do not
612
+ * apply credit grants or balance twice. Paying any other way cancels that earlier online payment
613
+ * first; if the gateway had already collected it, the invoice is paid by it and nothing more is
614
+ * charged. One the gateway is still processing is refused with `BILLING_PAYMENT_PENDING` and
615
+ * `meta.transaction_id`; wait for its outcome.
612
616
  *
613
617
  * Calling this on an invoice that is already paid returns the existing payment result without
614
618
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
@@ -679,8 +683,9 @@ export declare const getPayTogetherUrl: () => string;
679
683
  * Either every invoice is paid or none is. When the credit grants and balance cannot cover
680
684
  * them all, the request fails with `BILLING_INSUFFICIENT_FUNDS` and nothing is charged.
681
685
  * A total different from expected_amount fails with `BILLING_AMOUNT_CHANGED` and nothing is charged.
682
- * Invoices that are already paid are not charged again. An invoice with an online payment
683
- * still in progress is refused with `BILLING_PAYMENT_PENDING`, a void invoice with
686
+ * Invoices that are already paid are not charged again. An online payment started earlier for one
687
+ * of the invoices is canceled first; one the gateway is still processing is refused with
688
+ * `BILLING_PAYMENT_PENDING` and `meta.transaction_id`, a void invoice with
684
689
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
685
690
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
686
691
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
@@ -1430,7 +1435,7 @@ export declare const getCancelOrderUrl: (orderId: string) => string;
1430
1435
  * Payment may be absent, partial or complete. Once the order's terms are fixed, the selected items
1431
1436
  * keep their agreed amounts and discounts; credit notes reduce issued invoices, and collected amounts
1432
1437
  * are returned to their original payment sources. While the terms of a deferred order are not fixed,
1433
- * the remaining items are priced again. External payment-method refunds can finish asynchronously.
1438
+ * the remaining items are priced again. External payment-method refunds can finish asynchronously. An online payment still waiting for the payer is canceled with the order; one the gateway is already processing is refused with `BILLING_PAYMENT_PENDING` and `meta.transaction_id`.
1434
1439
  * The order and financial history are retained; the same cancellation does not refund twice.
1435
1440
  *
1436
1441
  * Once the order is accepted, its owning service coordinates cancellation and confirms
@@ -638,8 +638,12 @@ export const getPayInvoiceUrl = (invoiceId) => {
638
638
  * `BILLING_CHANGE_NOT_INVOICED`.
639
639
  *
640
640
  * Returns a payment action when customer interaction is required. requires_action and processing
641
- * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved payment
642
- * attempt is reused, and retries do not apply credit grants or balance twice.
641
+ * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved online
642
+ * payment made with the same gateway, method and saved payment method is reused, and retries do not
643
+ * apply credit grants or balance twice. Paying any other way cancels that earlier online payment
644
+ * first; if the gateway had already collected it, the invoice is paid by it and nothing more is
645
+ * charged. One the gateway is still processing is refused with `BILLING_PAYMENT_PENDING` and
646
+ * `meta.transaction_id`; wait for its outcome.
643
647
  *
644
648
  * Calling this on an invoice that is already paid returns the existing payment result without
645
649
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
@@ -726,8 +730,9 @@ export const getPayTogetherUrl = () => {
726
730
  * Either every invoice is paid or none is. When the credit grants and balance cannot cover
727
731
  * them all, the request fails with `BILLING_INSUFFICIENT_FUNDS` and nothing is charged.
728
732
  * A total different from expected_amount fails with `BILLING_AMOUNT_CHANGED` and nothing is charged.
729
- * Invoices that are already paid are not charged again. An invoice with an online payment
730
- * still in progress is refused with `BILLING_PAYMENT_PENDING`, a void invoice with
733
+ * Invoices that are already paid are not charged again. An online payment started earlier for one
734
+ * of the invoices is canceled first; one the gateway is still processing is refused with
735
+ * `BILLING_PAYMENT_PENDING` and `meta.transaction_id`, a void invoice with
731
736
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
732
737
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
733
738
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
@@ -1578,7 +1583,7 @@ export const getCancelOrderUrl = (orderId) => {
1578
1583
  * Payment may be absent, partial or complete. Once the order's terms are fixed, the selected items
1579
1584
  * keep their agreed amounts and discounts; credit notes reduce issued invoices, and collected amounts
1580
1585
  * are returned to their original payment sources. While the terms of a deferred order are not fixed,
1581
- * the remaining items are priced again. External payment-method refunds can finish asynchronously.
1586
+ * the remaining items are priced again. External payment-method refunds can finish asynchronously. An online payment still waiting for the payer is canceled with the order; one the gateway is already processing is refused with `BILLING_PAYMENT_PENDING` and `meta.transaction_id`.
1582
1587
  * The order and financial history are retained; the same cancellation does not refund twice.
1583
1588
  *
1584
1589
  * Once the order is accepted, its owning service coordinates cancellation and confirms
@@ -712,7 +712,7 @@ export interface AccountBalance {
712
712
  * spendable balance and may differ from the recorded credits total.
713
713
  */
714
714
  credit_groups: CreditGroup[];
715
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
715
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
716
716
  due: Money;
717
717
  pending_returns_amount: Money;
718
718
  }
@@ -334,8 +334,12 @@ export declare const DeletePaymentMethodParams: zod.ZodObject<{
334
334
  * `BILLING_CHANGE_NOT_INVOICED`.
335
335
  *
336
336
  * Returns a payment action when customer interaction is required. requires_action and processing
337
- * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved payment
338
- * attempt is reused, and retries do not apply credit grants or balance twice.
337
+ * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved online
338
+ * payment made with the same gateway, method and saved payment method is reused, and retries do not
339
+ * apply credit grants or balance twice. Paying any other way cancels that earlier online payment
340
+ * first; if the gateway had already collected it, the invoice is paid by it and nothing more is
341
+ * charged. One the gateway is still processing is refused with `BILLING_PAYMENT_PENDING` and
342
+ * `meta.transaction_id`; wait for its outcome.
339
343
  *
340
344
  * Calling this on an invoice that is already paid returns the existing payment result without
341
345
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
@@ -396,8 +400,9 @@ export declare const PreviewInvoicePaymentQueryParams: zod.ZodObject<{
396
400
  * Either every invoice is paid or none is. When the credit grants and balance cannot cover
397
401
  * them all, the request fails with `BILLING_INSUFFICIENT_FUNDS` and nothing is charged.
398
402
  * A total different from expected_amount fails with `BILLING_AMOUNT_CHANGED` and nothing is charged.
399
- * Invoices that are already paid are not charged again. An invoice with an online payment
400
- * still in progress is refused with `BILLING_PAYMENT_PENDING`, a void invoice with
403
+ * Invoices that are already paid are not charged again. An online payment started earlier for one
404
+ * of the invoices is canceled first; one the gateway is still processing is refused with
405
+ * `BILLING_PAYMENT_PENDING` and `meta.transaction_id`, a void invoice with
401
406
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
402
407
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
403
408
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
@@ -996,7 +1001,7 @@ export declare const GetOrderParams: zod.ZodObject<{
996
1001
  * Payment may be absent, partial or complete. Once the order's terms are fixed, the selected items
997
1002
  * keep their agreed amounts and discounts; credit notes reduce issued invoices, and collected amounts
998
1003
  * are returned to their original payment sources. While the terms of a deferred order are not fixed,
999
- * the remaining items are priced again. External payment-method refunds can finish asynchronously.
1004
+ * the remaining items are priced again. External payment-method refunds can finish asynchronously. An online payment still waiting for the payer is canceled with the order; one the gateway is already processing is refused with `BILLING_PAYMENT_PENDING` and `meta.transaction_id`.
1000
1005
  * The order and financial history are retained; the same cancellation does not refund twice.
1001
1006
  *
1002
1007
  * Once the order is accepted, its owning service coordinates cancellation and confirms
@@ -389,8 +389,12 @@ export const DeletePaymentMethodParams = zod.strictObject({
389
389
  * `BILLING_CHANGE_NOT_INVOICED`.
390
390
  *
391
391
  * Returns a payment action when customer interaction is required. requires_action and processing
392
- * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved payment
393
- * attempt is reused, and retries do not apply credit grants or balance twice.
392
+ * do not mean paid; the invoice is marked paid after payment is confirmed. An unresolved online
393
+ * payment made with the same gateway, method and saved payment method is reused, and retries do not
394
+ * apply credit grants or balance twice. Paying any other way cancels that earlier online payment
395
+ * first; if the gateway had already collected it, the invoice is paid by it and nothing more is
396
+ * charged. One the gateway is still processing is refused with `BILLING_PAYMENT_PENDING` and
397
+ * `meta.transaction_id`; wait for its outcome.
394
398
  *
395
399
  * Calling this on an invoice that is already paid returns the existing payment result without
396
400
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
@@ -453,8 +457,9 @@ export const PreviewInvoicePaymentQueryParams = zod.strictObject({
453
457
  * Either every invoice is paid or none is. When the credit grants and balance cannot cover
454
458
  * them all, the request fails with `BILLING_INSUFFICIENT_FUNDS` and nothing is charged.
455
459
  * A total different from expected_amount fails with `BILLING_AMOUNT_CHANGED` and nothing is charged.
456
- * Invoices that are already paid are not charged again. An invoice with an online payment
457
- * still in progress is refused with `BILLING_PAYMENT_PENDING`, a void invoice with
460
+ * Invoices that are already paid are not charged again. An online payment started earlier for one
461
+ * of the invoices is canceled first; one the gateway is still processing is refused with
462
+ * `BILLING_PAYMENT_PENDING` and `meta.transaction_id`, a void invoice with
458
463
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
459
464
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
460
465
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
@@ -1135,7 +1140,7 @@ export const GetOrderParams = zod.strictObject({
1135
1140
  * Payment may be absent, partial or complete. Once the order's terms are fixed, the selected items
1136
1141
  * keep their agreed amounts and discounts; credit notes reduce issued invoices, and collected amounts
1137
1142
  * are returned to their original payment sources. While the terms of a deferred order are not fixed,
1138
- * the remaining items are priced again. External payment-method refunds can finish asynchronously.
1143
+ * the remaining items are priced again. External payment-method refunds can finish asynchronously. An online payment still waiting for the payer is canceled with the order; one the gateway is already processing is refused with `BILLING_PAYMENT_PENDING` and `meta.transaction_id`.
1139
1144
  * The order and financial history are retained; the same cancellation does not refund twice.
1140
1145
  *
1141
1146
  * Once the order is accepted, its owning service coordinates cancellation and confirms
@@ -21,7 +21,7 @@ export const AccountBalance = zod
21
21
  credit_groups: zod
22
22
  .array(CreditGroup)
23
23
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
24
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
24
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
25
25
  pending_returns_amount: Money,
26
26
  })
27
27
  .describe("Account balance, credits, and unpaid charges are reported separately.");
@@ -1359,7 +1359,7 @@ export interface AccountBalance {
1359
1359
  * spendable balance and may differ from the recorded credits total.
1360
1360
  */
1361
1361
  credit_groups: CreditGroup[];
1362
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1362
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1363
1363
  due: Money;
1364
1364
  pending_returns_amount: Money;
1365
1365
  }
@@ -44,7 +44,7 @@ export const AccountBalance = zod
44
44
  credit_groups: zod
45
45
  .array(CreditGroup)
46
46
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
47
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
47
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
48
48
  pending_returns_amount: Money,
49
49
  })
50
50
  .describe("Account balance, credits, and unpaid charges are reported separately.");
@@ -3305,7 +3305,7 @@ export interface AccountBalance {
3305
3305
  * spendable balance and may differ from the recorded credits total.
3306
3306
  */
3307
3307
  credit_groups: CreditGroup[];
3308
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
3308
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
3309
3309
  due: Money;
3310
3310
  pending_returns_amount: Money;
3311
3311
  }
@@ -37,7 +37,7 @@ export const AccountBalance = zod
37
37
  credit_groups: zod
38
38
  .array(CreditGroup)
39
39
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
40
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
40
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
41
41
  pending_returns_amount: Money,
42
42
  })
43
43
  .describe("Account balance, credits, and unpaid charges are reported separately.");
@@ -1180,7 +1180,7 @@ export interface AccountBalance {
1180
1180
  * spendable balance and may differ from the recorded credits total.
1181
1181
  */
1182
1182
  credit_groups: CreditGroup[];
1183
- /** Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1183
+ /** Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms. */
1184
1184
  due: Money;
1185
1185
  pending_returns_amount: Money;
1186
1186
  }
@@ -21,7 +21,7 @@ export const AccountBalance = zod
21
21
  credit_groups: zod
22
22
  .array(CreditGroup)
23
23
  .describe("Currently valid, unspent credit grouped by permitted use. Restrictions and\nvalidity dates determine which charges a group can cover, so these groups are not a general\nspendable balance and may differ from the recorded credits total."),
24
- due: Money.describe("Amount still payable on issued invoices. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
24
+ due: Money.describe("Amount still payable on issued invoices. The invoice of an order not yet accepted is a request to pay for that order rather than a debt, so it is excluded here and from available_credit. Unbilled usage is reported separately; arrears depend on actual eligible funding and grace terms."),
25
25
  pending_returns_amount: Money,
26
26
  })
27
27
  .describe("Account balance, credits, and unpaid charges are reported separately.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.127.0",
3
+ "version": "0.127.1",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {