@forgeroute/ui 0.5.1 → 0.5.2
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/fesm2022/forgeroute-ui-quickbooks.mjs +20 -3
- package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-square.mjs +20 -3
- package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +42 -16
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-ui-labels.es-C1Meg25h.mjs → forgeroute-ui-ui-labels.es-OIkNyhI5.mjs} +7 -1
- package/fesm2022/{forgeroute-ui-ui-labels.es-C1Meg25h.mjs.map → forgeroute-ui-ui-labels.es-OIkNyhI5.mjs.map} +1 -1
- package/fesm2022/forgeroute-ui.mjs +49 -4
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui.d.ts +26 -9
package/package.json
CHANGED
package/types/forgeroute-ui.d.ts
CHANGED
|
@@ -2720,6 +2720,12 @@ export declare const UI_DEFAULT_LABELS: {
|
|
|
2720
2720
|
readonly 'paymentAttempt.authRequired': "Your bank needs to verify this payment. Complete the verification window and do not close it.";
|
|
2721
2721
|
readonly 'paymentAttempt.authAbandoned': "The verification was not completed. We are checking whether the payment went through before you can try again.";
|
|
2722
2722
|
readonly 'paymentAttempt.verifyRetry': "The card could not be verified. You can try again: the total stays {{ amount }}.";
|
|
2723
|
+
readonly 'paymentAttempt.referenceChanged': "This payment can no longer be taken: the balance changed. Please ask for a new payment link.";
|
|
2724
|
+
readonly 'paymentAttempt.linkInUse': "A payment for this link is already in progress. Please wait a moment and check again before paying.";
|
|
2725
|
+
readonly 'paymentAttempt.linkAlreadyPaid': "This link has already been paid.";
|
|
2726
|
+
readonly 'paymentAttempt.linkExpired': "This payment link has expired. Please ask for a new link.";
|
|
2727
|
+
readonly 'paymentAttempt.linkCancelled': "This payment link was cancelled. Please ask for a new link.";
|
|
2728
|
+
readonly 'paymentAttempt.notSupported': "This business cannot take this kind of payment. Please contact the business.";
|
|
2723
2729
|
readonly 'paymentAttempt.duplicate': "We detected a possible duplicate payment. Please contact support before paying again.";
|
|
2724
2730
|
readonly 'paymentReadiness.offline': "You are offline. Reconnect to the internet to pay: nothing was sent.";
|
|
2725
2731
|
readonly 'paymentReadiness.slow_connection': "Your connection is too slow to pay safely. Please try again on a better connection.";
|
|
@@ -20469,22 +20475,33 @@ export interface PaymentAttemptResult<T> {
|
|
|
20469
20475
|
reason?: string;
|
|
20470
20476
|
}
|
|
20471
20477
|
/**
|
|
20472
|
-
* Every machine-readable code of the payments service's money endpoints, mapped explicitly. SOURCE: host-kit/contract/payment-errors.json of the forgeroute-payments service (the library
|
|
20473
|
-
*
|
|
20474
|
-
* - NO CHARGE was made (`not_sent`: release, the key is kept
|
|
20475
|
-
* `
|
|
20476
|
-
* - the attempt exists or runs (`unknown`: look it up by its key, never start another): `payment_in_flight`, `request_in_progress`, `duplicate_suspected` (an identical payment was made moments ago),
|
|
20477
|
-
* `idempotency_key_reused`, `idempotency_error`, `payment_intent_unexpected_state`;
|
|
20478
|
-
* - the
|
|
20478
|
+
* Every machine-readable code of the payments service's money endpoints, mapped explicitly (three groups below). SOURCE: host-kit/contract/payment-errors.json of the forgeroute-payments service (the library
|
|
20479
|
+
* cannot import it: these tables repeat its codes, and `payment-errors.contract.spec.ts` embeds a verbatim copy and fails when a code has no row; a new code there must be added here).
|
|
20480
|
+
* - NO CHARGE was made (`not_sent`: release, the key is kept): `events_backlog` (new payments are paused), `exceeds_amount_due`, `already_charged_today`, `merchant_not_ready`, `reconnect_required` and
|
|
20481
|
+
* `processor_account_changed` (the merchant's processor connection needs attention), `reference_changed` (the balance changed since the link was made), `link_in_use` and `link_already_paid` (payment links);
|
|
20482
|
+
* - the attempt exists or runs (`unknown`: look it up by its key, never start another): `payment_in_flight`, `request_in_progress`, `duplicate_suspected` (an identical payment was made moments ago),
|
|
20483
|
+
* `idempotency_in_progress`, `idempotency_key_reused`, `idempotency_error`, `payment_intent_unexpected_state`;
|
|
20484
|
+
* - the request FAILED for good (`failure`, see {@link PAYMENT_FAILURE_CODES}): `attempt_failed_use_new_key` (a replay of a FAILED attempt, the epoch moves), the capture codes, `link_expired`, `link_cancelled`,
|
|
20485
|
+
* `not_supported_by_processor`.
|
|
20479
20486
|
*/
|
|
20480
20487
|
export declare const PAYMENT_NO_CHARGE_CODES: readonly string[];
|
|
20488
|
+
/**
|
|
20489
|
+
* Codes that are a DEFINITIVE failure of the request, never unknown: the failed-attempt replay (the epoch moves), the capture codes of the staff API (`already_captured`, `exceeds_authorized`, `not_capturable`, 409) and the payment-link /
|
|
20490
|
+
* processor refusals (`link_expired`, `link_cancelled` = 410, `not_supported_by_processor` = 400). Source: host-kit/contract/payment-errors.json.
|
|
20491
|
+
*/
|
|
20492
|
+
export declare const PAYMENT_FAILURE_CODES: readonly string[];
|
|
20481
20493
|
/** Is this host error the payments service's "this attempt failed before, use a new attemptKey" answer (code `attempt_failed_use_new_key`)? */
|
|
20482
20494
|
export declare function isAttemptFailedReplay(error: unknown): boolean;
|
|
20495
|
+
/** The label key of the translated text for a host error that carries one of the payment-link / reference codes, else `null` (the service's own message is shown). */
|
|
20496
|
+
export declare function paymentErrorLabelKey(error: unknown): UiLabelKey | null;
|
|
20497
|
+
/** Is this host error one a retry cannot change (see {@link FINAL_HOST_CODES})? */
|
|
20498
|
+
export declare function isFinalPaymentRefusal(error: unknown): boolean;
|
|
20483
20499
|
/**
|
|
20484
20500
|
* Classifies a failed HOST call (the charge request) for `run()`:
|
|
20485
20501
|
* - `'not_sent'`: nothing was charged: the request never left (the offline layer refused it: `OfflineBlockedError` / `offlineBlocked: true`) or the payments service refused it with one of its NO-CHARGE codes
|
|
20486
|
-
* (`events_backlog`, `exceeds_amount_due`, `already_charged_today`, `merchant_not_ready`, `reconnect_required`, `processor_account_changed`, also as a `409`): release with the key kept, show the message;
|
|
20487
|
-
* - `'failure'` for the
|
|
20502
|
+
* (`events_backlog`, `exceeds_amount_due`, `already_charged_today`, `merchant_not_ready`, `reconnect_required`, `processor_account_changed`, `reference_changed`, `link_in_use`, `link_already_paid`, also as a `409`): release with the key kept, show the message;
|
|
20503
|
+
* - `'failure'` for the codes of {@link PAYMENT_FAILURE_CODES} (`attempt_failed_use_new_key`: a replay of a FAILED attempt, even as a `409`, the epoch moves so the next click derives a new key; the capture codes
|
|
20504
|
+
* `already_captured` / `exceeds_authorized` / `not_capturable`; `link_expired`, `link_cancelled`, `not_supported_by_processor`);
|
|
20488
20505
|
* - `'unknown'`: it may have reached the processor: no answer (status `0`, a network `TypeError`, an abort / timeout), `408`, `425`, `429`, `5xx`, **any other `409`** (a service that answers "already in flight / duplicate
|
|
20489
20506
|
* suspected / idempotency in progress" must never make the payer pay again), a body or error `code` naming an idempotency / in-flight conflict, an error flagged `unknown: true`, and **an error that carries NO numeric
|
|
20490
20507
|
* status** (a wrapped `Error`, an error object of a client library): nothing proves it was refused, so only a recognised definitive code decides it;
|