@tuwaio/nova-payments 0.3.0 → 0.4.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/README.md +1 -1
- package/dist/chunk-5KGDZSPE.js +1 -0
- package/dist/chunk-A52KWC4O.cjs +1 -0
- package/dist/de-5EFHX2IO.js +1 -0
- package/dist/de-CBZGMJRL.cjs +1 -0
- package/dist/es-3BS5SMKZ.js +1 -0
- package/dist/es-OIY4CIB2.cjs +1 -0
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.d.cts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +1 -1
- package/dist/it-RGYBW74Q.js +1 -0
- package/dist/it-YZLQZLZI.cjs +1 -0
- package/dist/{locales-dTcrLl9B.d.cts → locales-BLbRvz3z.d.cts} +32 -28
- package/dist/{locales-dTcrLl9B.d.ts → locales-BLbRvz3z.d.ts} +32 -28
- package/dist/uk-3KBDAAPC.cjs +1 -0
- package/dist/uk-TQG4B3QD.js +1 -0
- package/dist/zhCN-24WZ65H5.js +1 -0
- package/dist/zhCN-WVH73E5W.cjs +1 -0
- package/package.json +2 -2
- package/dist/chunk-4HBN6N7D.cjs +0 -1
- package/dist/chunk-A2WIFZQB.js +0 -1
- package/dist/de-5UOOKHHH.cjs +0 -1
- package/dist/de-U3SERR3Y.js +0 -1
- package/dist/es-J6MJIGEI.js +0 -1
- package/dist/es-WSJ36B6Y.cjs +0 -1
- package/dist/it-KX7WWME3.js +0 -1
- package/dist/it-QORQLELA.cjs +0 -1
- package/dist/uk-GMKBC44N.js +0 -1
- package/dist/uk-R2A3XIGT.cjs +0 -1
- package/dist/zhCN-5JP4MWXH.cjs +0 -1
- package/dist/zhCN-AX2E4I6A.js +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -33,7 +33,7 @@ declare function BuyerScreen(): react.JSX.Element | null;
|
|
|
33
33
|
* confirm (`unconfirmed`: it may still arrive, so the buyer checks the wallet before paying again), a payment that
|
|
34
34
|
* failed for good while the invoice still takes one (`failed`: the buyer may pay again) or its outcome.
|
|
35
35
|
*/
|
|
36
|
-
type CheckoutScreen = 'loading' | 'error' | 'buyer' | 'method' | 'confirmWallet' | 'pay' | 'qr' | 'confirm' | 'unconfirmed' | 'failed' | 'paid' | 'underpaid' | '
|
|
36
|
+
type CheckoutScreen = 'loading' | 'error' | 'buyer' | 'method' | 'confirmWallet' | 'pay' | 'qr' | 'confirm' | 'unconfirmed' | 'failed' | 'paid' | 'underpaid' | 'needs_review' | 'refunded' | 'expired' | 'cancelled' | 'replaced' | 'blocked';
|
|
37
37
|
/** Choices of the buyer that the checkout store does not hold. */
|
|
38
38
|
interface CheckoutScreenChoices {
|
|
39
39
|
/** Pay from a wallet in this browser (default) or scan a QR code with a phone. */
|
|
@@ -144,8 +144,8 @@ declare function groupMethodsByToken(methods: CheckoutMethod[], walletChainId?:
|
|
|
144
144
|
* the wallet signs, the payment is handed to Quasar and it confirms, and on a payer the wallet check refused
|
|
145
145
|
* (`blocked`, where the buyer can pay with another wallet); it ends with the paid outcome and with the outcomes in which
|
|
146
146
|
* a deadline means nothing. A payment sent before the deadline counts: Quasar keeps an `open` or `underpaid` invoice
|
|
147
|
-
* while a payment it learned of before the deadline confirms (for a limited time), and
|
|
148
|
-
* the invoice closed for the seller to accept or return.
|
|
147
|
+
* while a payment it learned of before the deadline confirms (for a limited time), and records a payment that lands
|
|
148
|
+
* after the invoice closed for the seller to accept or return.
|
|
149
149
|
*
|
|
150
150
|
* @param status - The invoice state (`checkout.invoice.status`).
|
|
151
151
|
* @param screen - The screen shown.
|
|
@@ -154,9 +154,8 @@ declare function groupMethodsByToken(methods: CheckoutMethod[], walletChainId?:
|
|
|
154
154
|
* `confirming` while the payment is on its way (the countdown shows; at zero the confirm step says that the payment
|
|
155
155
|
* sent in time is being confirmed) and while Quasar could not confirm it (`unconfirmed`: the buyer checks the wallet
|
|
156
156
|
* before paying again, so no minutes left to pay are announced), or `null` once the payment succeeded (`paid`), on the
|
|
157
|
-
* outcomes in
|
|
158
|
-
*
|
|
159
|
-
* no longer be paid. `closed` while part of an underpaid invoice arrived and its rest cannot be paid: the countdown still
|
|
157
|
+
* outcomes in which a deadline means nothing (`needs_review`, `refunded`, `expired`, `cancelled`, `replaced`) and for an
|
|
158
|
+
* invoice that can no longer be paid. `closed` while part of an underpaid invoice arrived and its rest cannot be paid: the countdown still
|
|
160
159
|
* shows, as the time after which the seller can refund, and no minutes left to pay are announced.
|
|
161
160
|
*/
|
|
162
161
|
declare function deadlineState(status: string, screen: CheckoutScreen, restPayable?: boolean): 'paying' | 'confirming' | 'closed' | null;
|
|
@@ -190,7 +189,7 @@ declare function lockedPriceOnWallet(params: {
|
|
|
190
189
|
}): 'keep' | 'lock' | 'release';
|
|
191
190
|
/**
|
|
192
191
|
* What the active wallet changing does on the step that confirms the wallet, where no new price is locked yet: the step
|
|
193
|
-
* asks the wallet connected to sign, never the one the store last
|
|
192
|
+
* asks the wallet connected to sign, never the one the store last had.
|
|
194
193
|
*
|
|
195
194
|
* @param params - What the change happens over.
|
|
196
195
|
* @param params.open - The step shows.
|
|
@@ -506,7 +505,7 @@ interface CheckoutStepperProps {
|
|
|
506
505
|
declare function CheckoutStepper({ steps, labels, className, stepClassName }: CheckoutStepperProps): react.JSX.Element;
|
|
507
506
|
|
|
508
507
|
/** The outcomes this screen shows. */
|
|
509
|
-
type OutcomeKind = Extract<CheckoutScreen, 'unconfirmed' | 'underpaid' | '
|
|
508
|
+
type OutcomeKind = Extract<CheckoutScreen, 'unconfirmed' | 'underpaid' | 'needs_review' | 'refunded' | 'expired' | 'cancelled' | 'replaced' | 'blocked'>;
|
|
510
509
|
/** "Contact <seller>": the seller's support email about the invoice, its site, or the app's handler. @internal */
|
|
511
510
|
declare function ContactLink(): react.JSX.Element | null;
|
|
512
511
|
/**
|
|
@@ -926,9 +925,9 @@ interface PaymentCheckoutHandlers {
|
|
|
926
925
|
/**
|
|
927
926
|
* The locked price ran out (`quote`), or the invoice expired (`invoice`). Either can happen while a payment is on its
|
|
928
927
|
* way: the invoice can still close while it confirms (Quasar waits for a payment it learned of
|
|
929
|
-
* before the deadline only for a limited time, and
|
|
928
|
+
* before the deadline only for a limited time, and records a payment that lands later for the seller to accept or
|
|
930
929
|
* return), so do not offer a new invoice at once when `paymentOnTheWay` is `true`; the checkout keeps following the
|
|
931
|
-
* invoice and shows a paid or
|
|
930
|
+
* invoice and shows a paid or review outcome if it changes.
|
|
932
931
|
*
|
|
933
932
|
* @param params - What expired.
|
|
934
933
|
* @param params.kind - `quote` or `invoice`.
|
|
@@ -1524,7 +1523,7 @@ interface RefundFlow {
|
|
|
1524
1523
|
/** The refund store's phase. */
|
|
1525
1524
|
phase: RefundPhase;
|
|
1526
1525
|
/**
|
|
1527
|
-
* What a refund would send, before it is asked for: a requested refund
|
|
1526
|
+
* What a refund would send, before it is asked for: a requested refund keeps its amount until it is sent.
|
|
1528
1527
|
*
|
|
1529
1528
|
* @param request - What to refund.
|
|
1530
1529
|
* @returns The preview; `null` when the store cannot show one; `refused` when Quasar would refuse it (`error` says why).
|
|
@@ -2768,11 +2767,12 @@ declare function failedPaymentTx(error: CheckoutError | null | undefined): strin
|
|
|
2768
2767
|
/**
|
|
2769
2768
|
* What the checkout says about a payment that left the wallet, or may have, from the store's error: a transaction that
|
|
2770
2769
|
* does not pay the invoice (`pay.mismatch`; `pay.mismatchTakenElsewhere` when Quasar credited it to another invoice;
|
|
2771
|
-
* `pay.
|
|
2772
|
-
* `pay.mismatchOtherWallet` for a transfer from a wallet that did not confirm the invoice,
|
|
2773
|
-
* when Quasar recorded it as
|
|
2774
|
-
* transfer without the invoice's reference
|
|
2775
|
-
*
|
|
2770
|
+
* `pay.mismatchUnmatchedElsewhere` when it is an unmatched transfer at another invoice, refunded only, `unmatched`;
|
|
2771
|
+
* `pay.mismatchOtherWallet` for a transfer from a wallet that did not confirm the invoice,
|
|
2772
|
+
* `pay.mismatchOtherWalletUnmatched` when Quasar recorded it as an unmatched transfer the seller returns, `unmatched`;
|
|
2773
|
+
* `pay.mismatchNoReferenceUnmatched` for a Solana Pay transfer without the invoice's reference recorded on this
|
|
2774
|
+
* invoice, `unmatched`; `pay.mismatchChargeUnmatched` for a payment sent under an earlier price of the invoice,
|
|
2775
|
+
* `quote_changed`), a payment Quasar closed after 24 hours without a result on chain
|
|
2776
2776
|
* (`outcome.unconfirmedClosed`), a transaction another invoice handed over first (`outcome.unconfirmedTakenElsewhere`)
|
|
2777
2777
|
* and a payment the network confirmed that Quasar has not recorded yet (`outcome.unconfirmedSettlementRetrying` while
|
|
2778
2778
|
* Quasar settles it again daily, for 30 days, else `outcome.unconfirmedSettlementFailed`). Never "it failed", "only the
|
|
@@ -2925,9 +2925,9 @@ declare function lockPrice(store: LockPriceStore, showConfirmWallet: (show: bool
|
|
|
2925
2925
|
*/
|
|
2926
2926
|
declare function isPayerProofError(error: CheckoutError | null | undefined): boolean;
|
|
2927
2927
|
/**
|
|
2928
|
-
* Whether an error belongs on the step that confirms the wallet. The store's error may be about something else:
|
|
2929
|
-
* transfer
|
|
2930
|
-
* before the wallet was asked anything.
|
|
2928
|
+
* Whether an error belongs on the step that confirms the wallet. The store's error may be about something else: an
|
|
2929
|
+
* unmatched transfer from another wallet, or a price refused to the last wallet, opened the step with "Something went
|
|
2930
|
+
* wrong" before the wallet was asked anything.
|
|
2931
2931
|
*
|
|
2932
2932
|
* @param error - The checkout store's error, if any.
|
|
2933
2933
|
* @returns `true` for a refusal of the confirmation or a failure of its requests.
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ declare function BuyerScreen(): react.JSX.Element | null;
|
|
|
33
33
|
* confirm (`unconfirmed`: it may still arrive, so the buyer checks the wallet before paying again), a payment that
|
|
34
34
|
* failed for good while the invoice still takes one (`failed`: the buyer may pay again) or its outcome.
|
|
35
35
|
*/
|
|
36
|
-
type CheckoutScreen = 'loading' | 'error' | 'buyer' | 'method' | 'confirmWallet' | 'pay' | 'qr' | 'confirm' | 'unconfirmed' | 'failed' | 'paid' | 'underpaid' | '
|
|
36
|
+
type CheckoutScreen = 'loading' | 'error' | 'buyer' | 'method' | 'confirmWallet' | 'pay' | 'qr' | 'confirm' | 'unconfirmed' | 'failed' | 'paid' | 'underpaid' | 'needs_review' | 'refunded' | 'expired' | 'cancelled' | 'replaced' | 'blocked';
|
|
37
37
|
/** Choices of the buyer that the checkout store does not hold. */
|
|
38
38
|
interface CheckoutScreenChoices {
|
|
39
39
|
/** Pay from a wallet in this browser (default) or scan a QR code with a phone. */
|
|
@@ -144,8 +144,8 @@ declare function groupMethodsByToken(methods: CheckoutMethod[], walletChainId?:
|
|
|
144
144
|
* the wallet signs, the payment is handed to Quasar and it confirms, and on a payer the wallet check refused
|
|
145
145
|
* (`blocked`, where the buyer can pay with another wallet); it ends with the paid outcome and with the outcomes in which
|
|
146
146
|
* a deadline means nothing. A payment sent before the deadline counts: Quasar keeps an `open` or `underpaid` invoice
|
|
147
|
-
* while a payment it learned of before the deadline confirms (for a limited time), and
|
|
148
|
-
* the invoice closed for the seller to accept or return.
|
|
147
|
+
* while a payment it learned of before the deadline confirms (for a limited time), and records a payment that lands
|
|
148
|
+
* after the invoice closed for the seller to accept or return.
|
|
149
149
|
*
|
|
150
150
|
* @param status - The invoice state (`checkout.invoice.status`).
|
|
151
151
|
* @param screen - The screen shown.
|
|
@@ -154,9 +154,8 @@ declare function groupMethodsByToken(methods: CheckoutMethod[], walletChainId?:
|
|
|
154
154
|
* `confirming` while the payment is on its way (the countdown shows; at zero the confirm step says that the payment
|
|
155
155
|
* sent in time is being confirmed) and while Quasar could not confirm it (`unconfirmed`: the buyer checks the wallet
|
|
156
156
|
* before paying again, so no minutes left to pay are announced), or `null` once the payment succeeded (`paid`), on the
|
|
157
|
-
* outcomes in
|
|
158
|
-
*
|
|
159
|
-
* no longer be paid. `closed` while part of an underpaid invoice arrived and its rest cannot be paid: the countdown still
|
|
157
|
+
* outcomes in which a deadline means nothing (`needs_review`, `refunded`, `expired`, `cancelled`, `replaced`) and for an
|
|
158
|
+
* invoice that can no longer be paid. `closed` while part of an underpaid invoice arrived and its rest cannot be paid: the countdown still
|
|
160
159
|
* shows, as the time after which the seller can refund, and no minutes left to pay are announced.
|
|
161
160
|
*/
|
|
162
161
|
declare function deadlineState(status: string, screen: CheckoutScreen, restPayable?: boolean): 'paying' | 'confirming' | 'closed' | null;
|
|
@@ -190,7 +189,7 @@ declare function lockedPriceOnWallet(params: {
|
|
|
190
189
|
}): 'keep' | 'lock' | 'release';
|
|
191
190
|
/**
|
|
192
191
|
* What the active wallet changing does on the step that confirms the wallet, where no new price is locked yet: the step
|
|
193
|
-
* asks the wallet connected to sign, never the one the store last
|
|
192
|
+
* asks the wallet connected to sign, never the one the store last had.
|
|
194
193
|
*
|
|
195
194
|
* @param params - What the change happens over.
|
|
196
195
|
* @param params.open - The step shows.
|
|
@@ -506,7 +505,7 @@ interface CheckoutStepperProps {
|
|
|
506
505
|
declare function CheckoutStepper({ steps, labels, className, stepClassName }: CheckoutStepperProps): react.JSX.Element;
|
|
507
506
|
|
|
508
507
|
/** The outcomes this screen shows. */
|
|
509
|
-
type OutcomeKind = Extract<CheckoutScreen, 'unconfirmed' | 'underpaid' | '
|
|
508
|
+
type OutcomeKind = Extract<CheckoutScreen, 'unconfirmed' | 'underpaid' | 'needs_review' | 'refunded' | 'expired' | 'cancelled' | 'replaced' | 'blocked'>;
|
|
510
509
|
/** "Contact <seller>": the seller's support email about the invoice, its site, or the app's handler. @internal */
|
|
511
510
|
declare function ContactLink(): react.JSX.Element | null;
|
|
512
511
|
/**
|
|
@@ -926,9 +925,9 @@ interface PaymentCheckoutHandlers {
|
|
|
926
925
|
/**
|
|
927
926
|
* The locked price ran out (`quote`), or the invoice expired (`invoice`). Either can happen while a payment is on its
|
|
928
927
|
* way: the invoice can still close while it confirms (Quasar waits for a payment it learned of
|
|
929
|
-
* before the deadline only for a limited time, and
|
|
928
|
+
* before the deadline only for a limited time, and records a payment that lands later for the seller to accept or
|
|
930
929
|
* return), so do not offer a new invoice at once when `paymentOnTheWay` is `true`; the checkout keeps following the
|
|
931
|
-
* invoice and shows a paid or
|
|
930
|
+
* invoice and shows a paid or review outcome if it changes.
|
|
932
931
|
*
|
|
933
932
|
* @param params - What expired.
|
|
934
933
|
* @param params.kind - `quote` or `invoice`.
|
|
@@ -1524,7 +1523,7 @@ interface RefundFlow {
|
|
|
1524
1523
|
/** The refund store's phase. */
|
|
1525
1524
|
phase: RefundPhase;
|
|
1526
1525
|
/**
|
|
1527
|
-
* What a refund would send, before it is asked for: a requested refund
|
|
1526
|
+
* What a refund would send, before it is asked for: a requested refund keeps its amount until it is sent.
|
|
1528
1527
|
*
|
|
1529
1528
|
* @param request - What to refund.
|
|
1530
1529
|
* @returns The preview; `null` when the store cannot show one; `refused` when Quasar would refuse it (`error` says why).
|
|
@@ -2768,11 +2767,12 @@ declare function failedPaymentTx(error: CheckoutError | null | undefined): strin
|
|
|
2768
2767
|
/**
|
|
2769
2768
|
* What the checkout says about a payment that left the wallet, or may have, from the store's error: a transaction that
|
|
2770
2769
|
* does not pay the invoice (`pay.mismatch`; `pay.mismatchTakenElsewhere` when Quasar credited it to another invoice;
|
|
2771
|
-
* `pay.
|
|
2772
|
-
* `pay.mismatchOtherWallet` for a transfer from a wallet that did not confirm the invoice,
|
|
2773
|
-
* when Quasar recorded it as
|
|
2774
|
-
* transfer without the invoice's reference
|
|
2775
|
-
*
|
|
2770
|
+
* `pay.mismatchUnmatchedElsewhere` when it is an unmatched transfer at another invoice, refunded only, `unmatched`;
|
|
2771
|
+
* `pay.mismatchOtherWallet` for a transfer from a wallet that did not confirm the invoice,
|
|
2772
|
+
* `pay.mismatchOtherWalletUnmatched` when Quasar recorded it as an unmatched transfer the seller returns, `unmatched`;
|
|
2773
|
+
* `pay.mismatchNoReferenceUnmatched` for a Solana Pay transfer without the invoice's reference recorded on this
|
|
2774
|
+
* invoice, `unmatched`; `pay.mismatchChargeUnmatched` for a payment sent under an earlier price of the invoice,
|
|
2775
|
+
* `quote_changed`), a payment Quasar closed after 24 hours without a result on chain
|
|
2776
2776
|
* (`outcome.unconfirmedClosed`), a transaction another invoice handed over first (`outcome.unconfirmedTakenElsewhere`)
|
|
2777
2777
|
* and a payment the network confirmed that Quasar has not recorded yet (`outcome.unconfirmedSettlementRetrying` while
|
|
2778
2778
|
* Quasar settles it again daily, for 30 days, else `outcome.unconfirmedSettlementFailed`). Never "it failed", "only the
|
|
@@ -2925,9 +2925,9 @@ declare function lockPrice(store: LockPriceStore, showConfirmWallet: (show: bool
|
|
|
2925
2925
|
*/
|
|
2926
2926
|
declare function isPayerProofError(error: CheckoutError | null | undefined): boolean;
|
|
2927
2927
|
/**
|
|
2928
|
-
* Whether an error belongs on the step that confirms the wallet. The store's error may be about something else:
|
|
2929
|
-
* transfer
|
|
2930
|
-
* before the wallet was asked anything.
|
|
2928
|
+
* Whether an error belongs on the step that confirms the wallet. The store's error may be about something else: an
|
|
2929
|
+
* unmatched transfer from another wallet, or a price refused to the last wallet, opened the step with "Something went
|
|
2930
|
+
* wrong" before the wallet was asked anything.
|
|
2931
2931
|
*
|
|
2932
2932
|
* @param error - The checkout store's error, if any.
|
|
2933
2933
|
* @returns `true` for a refusal of the confirmation or a failure of its requests.
|