@forgeroute/ui 0.5.0 → 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-offline.mjs +18 -2
- package/fesm2022/forgeroute-ui-offline.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-quickbooks.mjs +4970 -0
- package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -0
- package/fesm2022/forgeroute-ui-square.mjs +4332 -0
- package/fesm2022/forgeroute-ui-square.mjs.map +1 -0
- package/fesm2022/forgeroute-ui-stripe.mjs +1230 -72
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-ui-labels.es-Bdh64Ql6.mjs → forgeroute-ui-ui-labels.es-OIkNyhI5.mjs} +277 -2
- package/fesm2022/{forgeroute-ui-ui-labels.es-Bdh64Ql6.mjs.map → forgeroute-ui-ui-labels.es-OIkNyhI5.mjs.map} +1 -1
- package/fesm2022/forgeroute-ui.mjs +1885 -5
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +9 -1
- package/types/forgeroute-ui-offline.d.ts +20 -0
- package/types/forgeroute-ui-quickbooks.d.ts +1482 -0
- package/types/forgeroute-ui-square.d.ts +1376 -0
- package/types/forgeroute-ui-stripe.d.ts +421 -4
- package/types/forgeroute-ui.d.ts +883 -11
package/types/forgeroute-ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { AfterContentChecked, EnvironmentProviders, InjectionToken, OnDestroy, OnInit, Provider, Signal, TemplateRef, WritableSignal } from "@angular/core";
|
|
2
|
+
import { AfterContentChecked, DestroyRef, EnvironmentProviders, InjectionToken, OnDestroy, OnInit, Provider, Signal, TemplateRef, WritableSignal } from "@angular/core";
|
|
3
3
|
import { UrlTree } from "@angular/router";
|
|
4
4
|
import { Observable, Subject } from "rxjs";
|
|
5
5
|
import { AbstractControl, ControlValueAccessor, FormControl, ValidationErrors, Validator, ValidatorFn } from "@angular/forms";
|
|
@@ -2482,6 +2482,281 @@ export declare const UI_DEFAULT_LABELS: {
|
|
|
2482
2482
|
readonly 'rangeFilter.percent': "{{ value }}%";
|
|
2483
2483
|
readonly 'rangeFilter.withUnit': "{{ value }} {{ unit }}";
|
|
2484
2484
|
readonly 'rangeFilter.badNumber': "Please enter a valid number";
|
|
2485
|
+
readonly 'squarePayment.label': "Payment details";
|
|
2486
|
+
readonly 'squarePayment.loadErrorMessage': "Failed to load the payment form. Please try again.";
|
|
2487
|
+
readonly 'squarePayment.a11y.loading': "Loading payment form";
|
|
2488
|
+
readonly 'squarePayment.a11y.processing': "Processing payment";
|
|
2489
|
+
readonly 'squarePayment.a11y.tokenized': "Payment details accepted";
|
|
2490
|
+
readonly 'squarePayment.method.group': "Payment method";
|
|
2491
|
+
readonly 'squarePayment.method.card': "Card";
|
|
2492
|
+
readonly 'squarePayment.method.ach': "Bank account";
|
|
2493
|
+
readonly 'squarePayment.submit.pay': "Pay";
|
|
2494
|
+
readonly 'squarePayment.submit.payBank': "Pay with bank account";
|
|
2495
|
+
readonly 'squarePayment.submit.saveCard': "Save card";
|
|
2496
|
+
readonly 'squarePayment.submit.saveBank': "Save bank account";
|
|
2497
|
+
readonly 'squarePayment.holderLabel': "Account holder name";
|
|
2498
|
+
readonly 'squarePayment.holderPlaceholder': "Full name on the bank account";
|
|
2499
|
+
readonly 'squarePayment.holderRequired': "Enter the account holder name.";
|
|
2500
|
+
readonly 'squarePayment.achInfo': "Choose your bank in the secure window that opens next. Your bank login is never shared with us.";
|
|
2501
|
+
readonly 'squarePayment.achConsent': "By checking this box, I authorize the above business to initiate a one-time ACH debit entry to my bank account for the total shown (the payment amount plus any fees). I understand I may revoke this authorization at any time by contacting the business.";
|
|
2502
|
+
readonly 'squarePayment.achConsentSetup': "By checking this box, I authorize the above business to initiate ACH debit entries to my bank account for agreed-upon payments. I understand I may revoke this authorization at any time by contacting the business.";
|
|
2503
|
+
readonly 'squarePayment.consentRequired': "Accept the bank authorization to continue.";
|
|
2504
|
+
readonly 'squarePayment.msg.loadFailed': "Failed to load Square";
|
|
2505
|
+
readonly 'squarePayment.msg.configMissing': "The Square application and location are not set up.";
|
|
2506
|
+
readonly 'squarePayment.msg.notReady': "The payment form is not ready yet.";
|
|
2507
|
+
readonly 'squarePayment.msg.cardFormFailed': "Could not show the card form. Please refresh the page.";
|
|
2508
|
+
readonly 'squarePayment.msg.achInitFailed': "Could not start the bank account form. Please try again.";
|
|
2509
|
+
readonly 'squarePayment.msg.cancelled': "The bank authorization was cancelled.";
|
|
2510
|
+
readonly 'squarePayment.msg.tokenizeFailed': "We could not read your card details. Please check them and try again.";
|
|
2511
|
+
readonly 'squarePayment.msg.achFailed': "The bank account could not be authorized. Please try again.";
|
|
2512
|
+
readonly 'squarePayment.msg.verifyFailed': "We could not verify your identity with your bank. Please try again or use another card.";
|
|
2513
|
+
readonly 'squareErrors.defaultMessage': "Payment failed. Please try again.";
|
|
2514
|
+
readonly 'squareErrors.field.cardNumber': "The card number is not valid. Please check it and try again.";
|
|
2515
|
+
readonly 'squareErrors.field.expirationDate': "The expiration date is not valid. Please check it and try again.";
|
|
2516
|
+
readonly 'squareErrors.field.cvv': "The security code is not valid. Please check it and try again.";
|
|
2517
|
+
readonly 'squareErrors.field.postalCode': "The postal code is not valid. Please check it and try again.";
|
|
2518
|
+
readonly 'squareErrors.type.UNSUPPORTED_CARD_BRAND': "This card type is not accepted. Please use a different card.";
|
|
2519
|
+
readonly 'squareErrors.type.CONFIGURATION': "Card payments are not set up correctly. Please contact the business.";
|
|
2520
|
+
readonly 'squareErrors.type.PAYMENT_METHOD_NOT_SUPPORTED': "This payment method is not available in your browser. Please use a different one.";
|
|
2521
|
+
readonly 'squareErrors.code.GENERIC_DECLINE': "Your card was declined. Please contact your bank or try a different card.";
|
|
2522
|
+
readonly 'squareErrors.code.CARD_DECLINED': "Your card was declined. Please use a different card.";
|
|
2523
|
+
readonly 'squareErrors.code.CARD_DECLINED_CALL_ISSUER': "Your bank declined this payment. Please call your bank for more information.";
|
|
2524
|
+
readonly 'squareErrors.code.CARD_DECLINED_VERIFICATION_REQUIRED': "This card needs to be verified. Please try again and complete the verification step.";
|
|
2525
|
+
readonly 'squareErrors.code.INSUFFICIENT_FUNDS': "Your card has insufficient funds. Please use a different card.";
|
|
2526
|
+
readonly 'squareErrors.code.CVV_FAILURE': "The security code is incorrect. Please check it and try again.";
|
|
2527
|
+
readonly 'squareErrors.code.ADDRESS_VERIFICATION_FAILURE': "The postal code does not match the card. Please check it and try again.";
|
|
2528
|
+
readonly 'squareErrors.code.INVALID_EXPIRATION': "The expiration date is incorrect. Please check it and try again.";
|
|
2529
|
+
readonly 'squareErrors.code.CARD_EXPIRED': "Your card has expired. Please use a different card.";
|
|
2530
|
+
readonly 'squareErrors.code.INVALID_CARD': "The card number is incorrect. Please check it and try again.";
|
|
2531
|
+
readonly 'squareErrors.code.CARD_NOT_SUPPORTED': "This card does not support this type of payment. Please use a different card.";
|
|
2532
|
+
readonly 'squareErrors.code.INVALID_ACCOUNT': "This bank account could not be used. Please try a different account.";
|
|
2533
|
+
readonly 'squareErrors.code.PAYMENT_LIMIT_EXCEEDED': "This payment is over the allowed limit. Please contact the business.";
|
|
2534
|
+
readonly 'squareErrors.code.BUYER_REFUSED_PAYMENT': "The payment was not authorized. Please try again.";
|
|
2535
|
+
readonly 'squareErrors.code.CARDHOLDER_INSUFFICIENT_PERMISSIONS': "This card cannot be used for this payment. Please use a different card.";
|
|
2536
|
+
readonly 'squareErrors.code.IDEMPOTENCY_KEY_REUSED': "This payment was already submitted with different details. Please reload the page and try again.";
|
|
2537
|
+
readonly 'squareErrors.code.RATE_LIMITED': "Too many requests. Please wait a moment and try again.";
|
|
2538
|
+
readonly 'squareErrors.code.UNAUTHORIZED': "Card payments are not available right now. Please contact the business.";
|
|
2539
|
+
readonly 'squareConnect.title': "Square account";
|
|
2540
|
+
readonly 'squareConnect.startTitle': "Connect your Square account";
|
|
2541
|
+
readonly 'squareConnect.startText': "Collect your customers' payments online. You authorize access on Square, then come back here.";
|
|
2542
|
+
readonly 'squareConnect.startLabel': "Connect Square";
|
|
2543
|
+
readonly 'squareConnect.connected': "Square connected";
|
|
2544
|
+
readonly 'squareConnect.needsReconnect': "Reconnect needed";
|
|
2545
|
+
readonly 'squareConnect.reconnectText': "Square no longer accepts the saved authorization. Connect again to keep taking payments.";
|
|
2546
|
+
readonly 'squareConnect.reconnect': "Reconnect";
|
|
2547
|
+
readonly 'squareConnect.disconnect': "Disconnect";
|
|
2548
|
+
readonly 'squareConnect.disconnectTitle': "Disconnect Square";
|
|
2549
|
+
readonly 'squareConnect.disconnectMessage': "Customers can no longer pay with Square until you connect again.";
|
|
2550
|
+
readonly 'squareConnect.checkStatus': "Check Status";
|
|
2551
|
+
readonly 'squareConnect.checking': "Checking...";
|
|
2552
|
+
readonly 'squareConnect.connectedOn': "Connected {{ date }}";
|
|
2553
|
+
readonly 'squareConnect.opensInNewTabBusy': "{{ label }}, opens in a new tab, busy";
|
|
2554
|
+
readonly 'squareConnect.opensInNewTabSr': ", opens in a new tab";
|
|
2555
|
+
readonly 'squareConnect.live.none': "Square not connected.";
|
|
2556
|
+
readonly 'squareConnect.live.connected': "Square connected.";
|
|
2557
|
+
readonly 'squareConnect.live.reconnect': "Square needs to be reconnected.";
|
|
2558
|
+
readonly 'squareConnect.live.loading': "{{ text }} Loading.";
|
|
2559
|
+
readonly 'squareConnect.noticeConnected': "Square is connected.";
|
|
2560
|
+
readonly 'squareConnect.noticeReconnect': "Square needs to be reconnected. Please connect again.";
|
|
2561
|
+
readonly 'squareConnect.noticeNotConnected': "Square is not connected yet. Finish the authorization, then check again.";
|
|
2562
|
+
readonly 'squareConnect.noticeDisconnected': "Square disconnected.";
|
|
2563
|
+
readonly 'squareConnect.noticeLinkUnavailable': "Unable to open the Square authorization page. Please try again.";
|
|
2564
|
+
readonly 'squareConnect.failedStart': "Failed to start the Square connection";
|
|
2565
|
+
readonly 'squareConnect.failedCheck': "Failed to check the Square connection";
|
|
2566
|
+
readonly 'squareConnect.failedDisconnect': "Failed to disconnect Square";
|
|
2567
|
+
readonly 'squareConnect.merchantLine': "Merchant: {{ merchant }}";
|
|
2568
|
+
readonly 'squareConnect.locationLine': "Location: {{ location }}";
|
|
2569
|
+
readonly 'qboConnect.title': "QuickBooks Payments";
|
|
2570
|
+
readonly 'qboConnect.startTitle': "Connect your QuickBooks account";
|
|
2571
|
+
readonly 'qboConnect.startText': "Collect your customers' card and bank payments through QuickBooks Payments. You authorize access on Intuit, then come back here.";
|
|
2572
|
+
readonly 'qboConnect.startLabel': "Connect QuickBooks";
|
|
2573
|
+
readonly 'qboConnect.connected': "QuickBooks connected";
|
|
2574
|
+
readonly 'qboConnect.needsReconnect': "Reconnect needed";
|
|
2575
|
+
readonly 'qboConnect.reconnectText': "QuickBooks no longer accepts the saved authorization. Connect again to keep taking payments.";
|
|
2576
|
+
readonly 'qboConnect.reconnect': "Reconnect";
|
|
2577
|
+
readonly 'qboConnect.disconnect': "Disconnect";
|
|
2578
|
+
readonly 'qboConnect.disconnectTitle': "Disconnect QuickBooks";
|
|
2579
|
+
readonly 'qboConnect.disconnectMessage': "Customers can no longer pay with QuickBooks until you connect again.";
|
|
2580
|
+
readonly 'qboConnect.checkStatus': "Check Status";
|
|
2581
|
+
readonly 'qboConnect.checking': "Checking...";
|
|
2582
|
+
readonly 'qboConnect.connectedOn': "Connected {{ date }}";
|
|
2583
|
+
readonly 'qboConnect.opensInNewTabBusy': "{{ label }}, opens in a new tab, busy";
|
|
2584
|
+
readonly 'qboConnect.opensInNewTabSr': ", opens in a new tab";
|
|
2585
|
+
readonly 'qboConnect.live.none': "QuickBooks not connected.";
|
|
2586
|
+
readonly 'qboConnect.live.connected': "QuickBooks connected.";
|
|
2587
|
+
readonly 'qboConnect.live.reconnect': "QuickBooks needs to be reconnected.";
|
|
2588
|
+
readonly 'qboConnect.live.loading': "{{ text }} Loading.";
|
|
2589
|
+
readonly 'qboConnect.noticeConnected': "QuickBooks is connected.";
|
|
2590
|
+
readonly 'qboConnect.noticeReconnect': "QuickBooks needs to be reconnected. Please connect again.";
|
|
2591
|
+
readonly 'qboConnect.noticeNotConnected': "QuickBooks is not connected yet. Finish the authorization, then check again.";
|
|
2592
|
+
readonly 'qboConnect.noticeDisconnected': "QuickBooks disconnected.";
|
|
2593
|
+
readonly 'qboConnect.noticeLinkUnavailable': "Unable to open the QuickBooks authorization page. Please try again.";
|
|
2594
|
+
readonly 'qboConnect.failedStart': "Failed to start the QuickBooks connection";
|
|
2595
|
+
readonly 'qboConnect.failedCheck': "Failed to check the QuickBooks connection";
|
|
2596
|
+
readonly 'qboConnect.failedDisconnect': "Failed to disconnect QuickBooks";
|
|
2597
|
+
readonly 'qboConnect.companyLine': "Company: {{ company }}";
|
|
2598
|
+
readonly 'squarePaymentMethod.methodCard': "Card";
|
|
2599
|
+
readonly 'squarePaymentMethod.methodAch': "ACH / Bank Transfer";
|
|
2600
|
+
readonly 'squarePaymentMethod.amountNeeded': "Enter an amount to continue.";
|
|
2601
|
+
readonly 'squarePaymentMethod.notCompleted': "Payment was not completed. Please try again or choose another method.";
|
|
2602
|
+
readonly 'squarePaymentMethod.achTitle': "Bank Payment Submitted";
|
|
2603
|
+
readonly 'squarePaymentMethod.achMessage': "Your bank payment of {{ amount }} has been submitted for processing. ACH payments typically take 3–5 business days to complete.";
|
|
2604
|
+
readonly 'squarePaymentMethod.pendingTitle': "Payment Submitted";
|
|
2605
|
+
readonly 'squarePaymentMethod.pendingMessage': "Your payment of {{ amount }} has been submitted and is being processed.";
|
|
2606
|
+
readonly 'squarePaymentMethod.receiptNote': "A receipt is sent once the payment has been fully processed and settled.";
|
|
2607
|
+
readonly 'squarePaymentMethod.paymentDetails': "Payment details";
|
|
2608
|
+
readonly 'squarePaymentMethod.totalCharged': "Total charged";
|
|
2609
|
+
readonly 'squarePaymentMethod.amountPlusFees': "Payment amount plus fees";
|
|
2610
|
+
readonly 'squarePaymentMethod.paymentTotal': "Payment total";
|
|
2611
|
+
readonly 'squarePaymentMethod.paymentAmount': "Payment amount";
|
|
2612
|
+
readonly 'squarePaymentMethod.processingFee': "Processing fee";
|
|
2613
|
+
readonly 'squarePaymentMethod.platformFee': "Platform fee";
|
|
2614
|
+
readonly 'squarePaymentMethod.feesFailed': "Could not calculate the fees. Please try again.";
|
|
2615
|
+
readonly 'squarePaymentMethod.announceProcessing': "Processing payment";
|
|
2616
|
+
readonly 'squarePaymentMethod.pay': "Pay";
|
|
2617
|
+
readonly 'squarePaymentMethod.paymentFailed': "Payment failed. Please try again.";
|
|
2618
|
+
readonly 'squarePaymentMethod.unavailable': "Payments are not available right now.";
|
|
2619
|
+
readonly 'squarePaymentMethod.announceReady': "Payment form ready";
|
|
2620
|
+
readonly 'qboPaymentMethod.methodCard': "Card";
|
|
2621
|
+
readonly 'qboPaymentMethod.methodAch': "ACH / Bank Transfer";
|
|
2622
|
+
readonly 'qboPaymentMethod.amountNeeded': "Enter an amount to continue.";
|
|
2623
|
+
readonly 'qboPaymentMethod.notCompleted': "Payment was not completed. Please try again or choose another method.";
|
|
2624
|
+
readonly 'qboPaymentMethod.achTitle': "Bank Payment Submitted";
|
|
2625
|
+
readonly 'qboPaymentMethod.achMessage': "Your bank payment of {{ amount }} has been submitted for processing. ACH payments typically take 3–5 business days to complete.";
|
|
2626
|
+
readonly 'qboPaymentMethod.pendingTitle': "Payment Submitted";
|
|
2627
|
+
readonly 'qboPaymentMethod.pendingMessage': "Your payment of {{ amount }} has been submitted and is being processed.";
|
|
2628
|
+
readonly 'qboPaymentMethod.receiptNote': "A receipt is sent once the payment has been fully processed and settled.";
|
|
2629
|
+
readonly 'qboPaymentMethod.paymentDetails': "Payment details";
|
|
2630
|
+
readonly 'qboPaymentMethod.totalCharged': "Total charged";
|
|
2631
|
+
readonly 'qboPaymentMethod.amountPlusFees': "Payment amount plus fees";
|
|
2632
|
+
readonly 'qboPaymentMethod.paymentTotal': "Payment total";
|
|
2633
|
+
readonly 'qboPaymentMethod.paymentAmount': "Payment amount";
|
|
2634
|
+
readonly 'qboPaymentMethod.processingFee': "Processing fee";
|
|
2635
|
+
readonly 'qboPaymentMethod.platformFee': "Platform fee";
|
|
2636
|
+
readonly 'qboPaymentMethod.feesFailed': "Could not calculate the fees. Please try again.";
|
|
2637
|
+
readonly 'qboPaymentMethod.announceProcessing': "Processing payment";
|
|
2638
|
+
readonly 'qboPaymentMethod.pay': "Pay";
|
|
2639
|
+
readonly 'qboPaymentMethod.paymentFailed': "Payment failed. Please try again.";
|
|
2640
|
+
readonly 'qboPaymentMethod.unavailable': "Payments are not available right now.";
|
|
2641
|
+
readonly 'qboPayment.label': "Payment details";
|
|
2642
|
+
readonly 'qboPayment.a11y.processing': "Processing payment";
|
|
2643
|
+
readonly 'qboPayment.a11y.tokenized': "Payment details accepted";
|
|
2644
|
+
readonly 'qboPayment.method.group': "Payment method";
|
|
2645
|
+
readonly 'qboPayment.method.card': "Card";
|
|
2646
|
+
readonly 'qboPayment.method.ach': "Bank account";
|
|
2647
|
+
readonly 'qboPayment.submit.pay': "Pay";
|
|
2648
|
+
readonly 'qboPayment.submit.payBank': "Pay with bank account";
|
|
2649
|
+
readonly 'qboPayment.submit.saveCard': "Save card";
|
|
2650
|
+
readonly 'qboPayment.submit.saveBank': "Save bank account";
|
|
2651
|
+
readonly 'qboPayment.secureNote': "Your details are sent securely to QuickBooks Payments and are not stored on this page.";
|
|
2652
|
+
readonly 'qboPayment.card.number': "Card number";
|
|
2653
|
+
readonly 'qboPayment.card.name': "Name on card";
|
|
2654
|
+
readonly 'qboPayment.card.nameOptional': "Name on card (optional)";
|
|
2655
|
+
readonly 'qboPayment.card.expiry': "Expiration (MM/YY)";
|
|
2656
|
+
readonly 'qboPayment.card.expiryPlaceholder': "MM/YY";
|
|
2657
|
+
readonly 'qboPayment.card.cvc': "Security code";
|
|
2658
|
+
readonly 'qboPayment.card.postal': "Postal code";
|
|
2659
|
+
readonly 'qboPayment.card.postalOptional': "Postal code (optional)";
|
|
2660
|
+
readonly 'qboPayment.bank.info': "Enter the bank account details. The payment is sent as an ACH bank transfer.";
|
|
2661
|
+
readonly 'qboPayment.bank.holder': "Account holder name";
|
|
2662
|
+
readonly 'qboPayment.bank.routing': "Routing number";
|
|
2663
|
+
readonly 'qboPayment.bank.routingPlaceholder': "9 digits";
|
|
2664
|
+
readonly 'qboPayment.bank.account': "Account number";
|
|
2665
|
+
readonly 'qboPayment.bank.confirm': "Confirm account number";
|
|
2666
|
+
readonly 'qboPayment.bank.type': "Account type";
|
|
2667
|
+
readonly 'qboPayment.bank.type.PERSONAL_CHECKING': "Personal checking";
|
|
2668
|
+
readonly 'qboPayment.bank.type.PERSONAL_SAVINGS': "Personal savings";
|
|
2669
|
+
readonly 'qboPayment.bank.type.BUSINESS_CHECKING': "Business checking";
|
|
2670
|
+
readonly 'qboPayment.bank.type.BUSINESS_SAVINGS': "Business savings";
|
|
2671
|
+
readonly 'qboPayment.brand.visa': "Visa";
|
|
2672
|
+
readonly 'qboPayment.brand.mastercard': "Mastercard";
|
|
2673
|
+
readonly 'qboPayment.brand.amex': "American Express";
|
|
2674
|
+
readonly 'qboPayment.brand.discover': "Discover";
|
|
2675
|
+
readonly 'qboPayment.brand.diners': "Diners Club";
|
|
2676
|
+
readonly 'qboPayment.brand.jcb': "JCB";
|
|
2677
|
+
readonly 'qboPayment.achConsent': "By checking this box, I authorize the above business to initiate a one-time ACH debit entry to my bank account for the total shown (the payment amount plus any fees). I understand I may revoke this authorization at any time by contacting the business.";
|
|
2678
|
+
readonly 'qboPayment.achConsentSetup': "By checking this box, I authorize the above business to initiate ACH debit entries to my bank account for agreed-upon payments. I understand I may revoke this authorization at any time by contacting the business.";
|
|
2679
|
+
readonly 'qboPayment.consentRequired': "Accept the bank authorization to continue.";
|
|
2680
|
+
readonly 'qboPayment.err.required': "{{ field }} is required.";
|
|
2681
|
+
readonly 'qboPayment.err.numberLength': "Enter the full card number.";
|
|
2682
|
+
readonly 'qboPayment.err.numberLuhn': "This card number is not valid. Please check it.";
|
|
2683
|
+
readonly 'qboPayment.err.expiryFormat': "Use the format MM/YY.";
|
|
2684
|
+
readonly 'qboPayment.err.expiryMonth': "The month must be 01 to 12.";
|
|
2685
|
+
readonly 'qboPayment.err.expiryPast': "This card has expired.";
|
|
2686
|
+
readonly 'qboPayment.err.cvcLength': "The security code has {{ length }} digits.";
|
|
2687
|
+
readonly 'qboPayment.err.or': "or";
|
|
2688
|
+
readonly 'qboPayment.err.postalFormat': "Enter a ZIP code such as 94086 or 94086-1234.";
|
|
2689
|
+
readonly 'qboPayment.err.postalFormatCa': "Enter a valid postal code, such as A1A 1A1.";
|
|
2690
|
+
readonly 'qboPayment.err.routingLength': "The routing number has 9 digits.";
|
|
2691
|
+
readonly 'qboPayment.err.accountLength': "The account number has 4 to 17 digits.";
|
|
2692
|
+
readonly 'qboPayment.err.confirmMismatch': "The account numbers do not match.";
|
|
2693
|
+
readonly 'qboErrors.defaultMessage': "Payment failed. Please try again.";
|
|
2694
|
+
readonly 'qboErrors.field.cardNumber': "The card number was not accepted. Please check it and try again.";
|
|
2695
|
+
readonly 'qboErrors.field.expiry': "The expiration date was not accepted. Please check it and try again.";
|
|
2696
|
+
readonly 'qboErrors.field.cvc': "The security code was not accepted. Please check it and try again.";
|
|
2697
|
+
readonly 'qboErrors.field.postalCode': "The postal code was not accepted. Please check it and try again.";
|
|
2698
|
+
readonly 'qboErrors.field.routing': "The routing number was not accepted. Please check it and try again.";
|
|
2699
|
+
readonly 'qboErrors.field.account': "The account number was not accepted. Please check it and try again.";
|
|
2700
|
+
readonly 'qboErrors.field.accountType': "The account type was not accepted. Please check it and try again.";
|
|
2701
|
+
readonly 'qboErrors.field.holder': "The account holder name was not accepted. Please check it and try again.";
|
|
2702
|
+
readonly 'qboErrors.status.network': "We could not reach the payment service. Please check your connection and try again.";
|
|
2703
|
+
readonly 'qboErrors.status.invalid': "The payment details were not accepted. Please check them and try again.";
|
|
2704
|
+
readonly 'qboErrors.status.notAllowed': "This payment form cannot take payments right now. Please contact the business.";
|
|
2705
|
+
readonly 'qboErrors.status.rateLimited': "Too many requests. Please wait a moment and try again.";
|
|
2706
|
+
readonly 'qboErrors.status.unavailable': "The payment service is unavailable right now. Please try again in a few minutes.";
|
|
2707
|
+
readonly 'paymentAttempt.checking': "Checking your payment...";
|
|
2708
|
+
readonly 'paymentAttempt.checkingHelp': "Please wait and do not pay again. We are making sure your payment went through.";
|
|
2709
|
+
readonly 'paymentAttempt.stillUnknown': "We could not confirm your payment yet. Please check again in a moment and do not pay again.";
|
|
2710
|
+
readonly 'paymentAttempt.checkAgain': "Check again";
|
|
2711
|
+
readonly 'paymentAttempt.waiting': "Waiting for your payment to be confirmed...";
|
|
2712
|
+
readonly 'paymentAttempt.startOver': "Start over";
|
|
2713
|
+
readonly 'paymentAttempt.paid': "A payment for this was just received. If you need to make another payment, please wait a moment or contact support.";
|
|
2714
|
+
readonly 'paymentAttempt.queuedOffline': "You appear to be offline. Your payment was not confirmed. Please check your connection and try again.";
|
|
2715
|
+
readonly 'paymentAttempt.offline': "You are offline. Reconnect to the internet to pay: nothing was sent.";
|
|
2716
|
+
readonly 'paymentAttempt.timeout': "Your payment is taking longer than expected. We are checking whether it went through: do not pay again.";
|
|
2717
|
+
readonly 'paymentAttempt.offlineInFlight': "You went offline while your payment was being sent. We are checking whether it went through: do not pay again.";
|
|
2718
|
+
readonly 'paymentAttempt.succeededAfterCheck': "Your payment went through. Thank you.";
|
|
2719
|
+
readonly 'paymentAttempt.failedAfterCheck': "The earlier payment attempt did not go through. You can try again.";
|
|
2720
|
+
readonly 'paymentAttempt.authRequired': "Your bank needs to verify this payment. Complete the verification window and do not close it.";
|
|
2721
|
+
readonly 'paymentAttempt.authAbandoned': "The verification was not completed. We are checking whether the payment went through before you can try again.";
|
|
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.";
|
|
2729
|
+
readonly 'paymentAttempt.duplicate': "We detected a possible duplicate payment. Please contact support before paying again.";
|
|
2730
|
+
readonly 'paymentReadiness.offline': "You are offline. Reconnect to the internet to pay: nothing was sent.";
|
|
2731
|
+
readonly 'paymentReadiness.slow_connection': "Your connection is too slow to pay safely. Please try again on a better connection.";
|
|
2732
|
+
readonly 'paymentReadiness.sdk_blocked': "The secure payment form could not be loaded. It may be blocked by an extension, a network filter or a weak connection. Retry loading it, or try another browser.";
|
|
2733
|
+
readonly 'paymentReadiness.service_unavailable': "Payments are temporarily unavailable. Please try again in a few minutes.";
|
|
2734
|
+
readonly 'paymentReadiness.merchant_not_ready': "This business cannot accept this kind of payment right now. Please contact the business.";
|
|
2735
|
+
readonly 'paymentReadiness.events_backlog': "Payments are paused for a moment while we catch up. Please try again shortly.";
|
|
2736
|
+
readonly 'paymentReadiness.payable_changed': "The amount due changed. Reload the page to see the current balance before you pay.";
|
|
2737
|
+
readonly 'paymentReadiness.already_paid': "This has already been paid.";
|
|
2738
|
+
readonly 'paymentReadiness.payment_in_flight': "A payment for this is already being processed. Please wait and check again shortly.";
|
|
2739
|
+
readonly 'paymentReadiness.unsupported_browser': "This browser cannot make payments safely. Please use a current version of Chrome, Edge, Firefox or Safari over a secure (https) connection.";
|
|
2740
|
+
readonly 'paymentReadiness.unknown_payment': "We are still checking an earlier payment. Please wait and do not pay again.";
|
|
2741
|
+
readonly 'paymentReadiness.checking': "Checking that payments are available...";
|
|
2742
|
+
readonly 'paymentReadiness.generic': "Payments are not available right now. Please try again shortly.";
|
|
2743
|
+
readonly 'paymentReadiness.retryLoad': "Retry loading the payment form";
|
|
2744
|
+
readonly 'paymentReadiness.storageWarning': "Your browser limits storage, so a page reload or a second tab during a payment cannot be recovered automatically. Please do not reload or open this page twice while paying.";
|
|
2745
|
+
readonly 'qboHostedPay.title': "Pay {{ amount }}";
|
|
2746
|
+
readonly 'qboHostedPay.titleNoAmount': "Secure payment";
|
|
2747
|
+
readonly 'qboHostedPay.pay': "Pay {{ amount }}";
|
|
2748
|
+
readonly 'qboHostedPay.loading': "Loading payment details";
|
|
2749
|
+
readonly 'qboHostedPay.expiredTitle': "Link expired";
|
|
2750
|
+
readonly 'qboHostedPay.expired': "This payment link has expired. Please contact the business for a new one.";
|
|
2751
|
+
readonly 'qboHostedPay.usedTitle': "Already paid";
|
|
2752
|
+
readonly 'qboHostedPay.used': "This payment link has already been used.";
|
|
2753
|
+
readonly 'qboHostedPay.successTitle': "Payment received";
|
|
2754
|
+
readonly 'qboHostedPay.success': "Thank you. Your payment of {{ amount }} was received.";
|
|
2755
|
+
readonly 'qboHostedPay.submittedTitle': "Payment submitted";
|
|
2756
|
+
readonly 'qboHostedPay.submitted': "Thank you. Your bank payment of {{ amount }} was submitted. Bank transfers (ACH) usually take 3–5 business days to complete.";
|
|
2757
|
+
readonly 'qboHostedPay.errorTitle': "Something went wrong";
|
|
2758
|
+
readonly 'qboHostedPay.footer': "Payments are processed securely by QuickBooks Payments.";
|
|
2759
|
+
readonly 'stripePayment.msg.tokenFailed': "The card details could not be checked. Please try again.";
|
|
2485
2760
|
};
|
|
2486
2761
|
export type UiLabelKey = keyof typeof UI_DEFAULT_LABELS;
|
|
2487
2762
|
export type UiLabelDictionary = Partial<Record<UiLabelKey, string>>;
|
|
@@ -3277,7 +3552,7 @@ export declare class SelectComponent implements ControlValueAccessor, Validator,
|
|
|
3277
3552
|
readonly error: import("@angular/core").InputSignal<string>;
|
|
3278
3553
|
/** The host's "tried to submit" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */
|
|
3279
3554
|
readonly showErrors: import("@angular/core").InputSignal<boolean>;
|
|
3280
|
-
readonly size: import("@angular/core").InputSignal<"
|
|
3555
|
+
readonly size: import("@angular/core").InputSignal<"default" | "sm">;
|
|
3281
3556
|
readonly _disabledInput: import("@angular/core").InputSignal<boolean>;
|
|
3282
3557
|
private readonly _cvaDisabled;
|
|
3283
3558
|
protected readonly disabled: import("@angular/core").Signal<boolean>;
|
|
@@ -4706,7 +4981,7 @@ export declare class ModalComponent implements OnInit, OnDestroy {
|
|
|
4706
4981
|
*/
|
|
4707
4982
|
readonly describedBy: import("@angular/core").InputSignal<string | null>;
|
|
4708
4983
|
readonly maxWidth: import("@angular/core").InputSignal<string>;
|
|
4709
|
-
readonly bodyOverflow: import("@angular/core").InputSignal<"
|
|
4984
|
+
readonly bodyOverflow: import("@angular/core").InputSignal<"auto" | "hidden" | "visible">;
|
|
4710
4985
|
/** `data-testid` of the dialog element itself (the host `<ui-modal>` is always in the page, the dialog only while open). None when empty. */
|
|
4711
4986
|
readonly dialogTestId: import("@angular/core").InputSignal<string>;
|
|
4712
4987
|
/** Hides the header X button (e.g. while a request is running). Escape and a backdrop click still close unless `closable` is false. */
|
|
@@ -5485,7 +5760,7 @@ export declare class AudioPlayerComponent {
|
|
|
5485
5760
|
/** Accessible name of the player. */
|
|
5486
5761
|
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
5487
5762
|
/** How much to load before play: 'metadata' (default), 'auto' or 'none'. */
|
|
5488
|
-
readonly preload: import("@angular/core").InputSignal<"
|
|
5763
|
+
readonly preload: import("@angular/core").InputSignal<"auto" | "none" | "metadata">;
|
|
5489
5764
|
/** Fires when the browser can't load or decode the source. */
|
|
5490
5765
|
readonly playbackError: import("@angular/core").OutputEmitterRef<void>;
|
|
5491
5766
|
protected readonly failed: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -6039,7 +6314,7 @@ export declare class CheckboxComponent implements ControlValueAccessor, Validato
|
|
|
6039
6314
|
* clicking it still toggles the box - e.g. a product name that is both the heading of its card and the label of its checkbox.
|
|
6040
6315
|
* Default null: plain label text, exactly as before. Single mode only.
|
|
6041
6316
|
*/
|
|
6042
|
-
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 |
|
|
6317
|
+
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
|
|
6043
6318
|
readonly indeterminate: import("@angular/core").InputSignal<boolean>;
|
|
6044
6319
|
readonly checked: import("@angular/core").ModelSignal<boolean>;
|
|
6045
6320
|
/**
|
|
@@ -7136,7 +7411,7 @@ export declare class ButtonComponent {
|
|
|
7136
7411
|
* `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
|
|
7137
7412
|
* background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
|
|
7138
7413
|
*/
|
|
7139
|
-
readonly variant: import("@angular/core").InputSignal<"
|
|
7414
|
+
readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "danger" | "warning" | "link" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
|
|
7140
7415
|
/** Renders an anchor to this route instead of a button (use with `variant="link"` for an inline text link). `['/settings']` or `'/settings'`. While `disabled` or `loading` it renders a non-clickable `<span role="link" aria-disabled>` with no href (like `href`). */
|
|
7141
7416
|
readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
|
|
7142
7417
|
/** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
|
|
@@ -8325,7 +8600,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
|
|
|
8325
8600
|
* `search`, `text`, `none`). Empty (default) = the browser's default for the field, except `type="tel"`, which keeps `tel`.
|
|
8326
8601
|
* It only picks the keyboard; it does not restrict what can be typed or pasted.
|
|
8327
8602
|
*/
|
|
8328
|
-
readonly inputmode: import("@angular/core").InputSignal<"" | "
|
|
8603
|
+
readonly inputmode: import("@angular/core").InputSignal<"" | "numeric" | "decimal" | "email" | "text" | "none" | "search" | "tel" | "url">;
|
|
8329
8604
|
readonly readonly: import("@angular/core").InputSignal<boolean>;
|
|
8330
8605
|
readonly hint: import("@angular/core").InputSignal<string>;
|
|
8331
8606
|
/** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */
|
|
@@ -12274,7 +12549,7 @@ export declare class IconComponent {
|
|
|
12274
12549
|
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
12275
12550
|
/** Icon size in px. */
|
|
12276
12551
|
readonly size: import("@angular/core").InputSignal<number>;
|
|
12277
|
-
readonly variant: import("@angular/core").InputSignal<"
|
|
12552
|
+
readonly variant: import("@angular/core").InputSignal<"default" | "danger">;
|
|
12278
12553
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
12279
12554
|
/** The host is running the request this icon started: a spinner replaces the picture and the button is disabled (no click) until it is false again. */
|
|
12280
12555
|
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
@@ -12778,7 +13053,7 @@ export declare class AddressInputComponent implements ControlValueAccessor, Vali
|
|
|
12778
13053
|
* the object. `valueChange` always emits the object. A written string is read with `parseAddressValue` for display only: the control keeps
|
|
12779
13054
|
* the original text until the user edits a field (so a text the parser cannot split is not rewritten on load).
|
|
12780
13055
|
*/
|
|
12781
|
-
readonly valueFormat: import("@angular/core").InputSignal<"object" | "
|
|
13056
|
+
readonly valueFormat: import("@angular/core").InputSignal<"object" | "auto" | "text">;
|
|
12782
13057
|
/** ZIP rule; the default is the US 5 digits / 5+4 rule. `null` accepts any non-empty ZIP. The ZIP is validated and stored trimmed. */
|
|
12783
13058
|
readonly zipPattern: import("@angular/core").InputSignal<RegExp | null>;
|
|
12784
13059
|
/** Message shown when the ZIP breaks `zipPattern`. */
|
|
@@ -14822,7 +15097,7 @@ export declare class DetailCardComponent {
|
|
|
14822
15097
|
/** true (default) = the title is displayed in capitals (CSS only); false = shown as written. The text, aria-label and heading name are never changed. */
|
|
14823
15098
|
readonly uppercaseTitle: import("@angular/core").InputSignal<boolean>;
|
|
14824
15099
|
/** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */
|
|
14825
|
-
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 |
|
|
15100
|
+
readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
|
|
14826
15101
|
/** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */
|
|
14827
15102
|
readonly titleId: import("@angular/core").InputSignal<string>;
|
|
14828
15103
|
/** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */
|
|
@@ -19609,6 +19884,11 @@ interface RecordPaymentResult {
|
|
|
19609
19884
|
type: 'manual' | 'stripe' | 'split';
|
|
19610
19885
|
paymentMethod: string;
|
|
19611
19886
|
amount: number;
|
|
19887
|
+
/**
|
|
19888
|
+
* Which online processor took the payment, set by a payment plugin that is not Stripe (`'square'`, `'quickbooks'`): `type` stays `'stripe'` for every live card / bank
|
|
19889
|
+
* payment ("online", kept for existing hosts), `processor` says which one. Absent for a manual record and for the Stripe plugin.
|
|
19890
|
+
*/
|
|
19891
|
+
processor?: string;
|
|
19612
19892
|
}
|
|
19613
19893
|
/** What the panel reports for the host to word (toasts, analytics). It never toasts itself. */
|
|
19614
19894
|
type PaymentPanelOutcome = {
|
|
@@ -19626,6 +19906,11 @@ type PaymentPanelOutcome = {
|
|
|
19626
19906
|
code: string;
|
|
19627
19907
|
result?: RecordPaymentResult;
|
|
19628
19908
|
message?: string;
|
|
19909
|
+
attemptKey?: string;
|
|
19910
|
+
paid?: {
|
|
19911
|
+
amount: number | null;
|
|
19912
|
+
method: string;
|
|
19913
|
+
};
|
|
19629
19914
|
} | {
|
|
19630
19915
|
kind: 'failed';
|
|
19631
19916
|
stage: 'record' | 'readers' | 'terminal';
|
|
@@ -19729,10 +20014,15 @@ export interface PaymentMethodContext {
|
|
|
19729
20014
|
setExclusive(on: boolean): void;
|
|
19730
20015
|
/** Called when the body is about to go away unfinished: the panel closes, the method changes, or the plugin is removed. Not called after `complete()`. */
|
|
19731
20016
|
onCancel(fn: (() => void) | null): void;
|
|
19732
|
-
/** Tell the host something happened (`outcome` kind `'plugin'`) so it can word a toast. */
|
|
20017
|
+
/** Tell the host something happened (`outcome` kind `'plugin'`) so it can word a toast. `attemptKey` names the attempt a report is about (the second payment of a `duplicate_suspected`, the payment another tab made in `paid_elsewhere`); `paid` is the amount (major units) and method that payment was made with, for a host that reconciles it. */
|
|
19733
20018
|
report(code: string, extra?: {
|
|
19734
20019
|
result?: RecordPaymentResult;
|
|
19735
20020
|
message?: string;
|
|
20021
|
+
attemptKey?: string;
|
|
20022
|
+
paid?: {
|
|
20023
|
+
amount: number | null;
|
|
20024
|
+
method: string;
|
|
20025
|
+
};
|
|
19736
20026
|
}): void;
|
|
19737
20027
|
/** Text for the panel's screen-reader status region. */
|
|
19738
20028
|
announce(text: string): void;
|
|
@@ -20139,6 +20429,588 @@ export declare class PaymentSidePanelComponent {
|
|
|
20139
20429
|
"outcome": "outcome";
|
|
20140
20430
|
}, ["plugins"], never, true, never>;
|
|
20141
20431
|
}
|
|
20432
|
+
export declare function warnQueuedPayment(): void;
|
|
20433
|
+
/** Specs only: warn again. This file is NOT re-exported by the public entry (only `warnQueuedPayment` is). */
|
|
20434
|
+
declare function resetQueuedPaymentWarning(): void;
|
|
20435
|
+
/**
|
|
20436
|
+
* Duplicate-payment protection shared by every payment form of the library (Stripe, Square, QuickBooks forms and the payment-panel plugins).
|
|
20437
|
+
*
|
|
20438
|
+
* One `PaymentAttempt` per form instance holds, in signals: the SYNCHRONOUS in-flight lock, the ATTEMPT KEY (an opaque idempotency key the host sends to its backend with the charge),
|
|
20439
|
+
* the UNKNOWN state (timeouts, going offline mid-flight, host-reported ambiguity) with bounded status polling through the host's `checkStatus`, the OFFLINE state and the PAID lock.
|
|
20440
|
+
* It never charges and never retries by itself: it only decides whether the form may start an attempt and what the screen says.
|
|
20441
|
+
*/
|
|
20442
|
+
export type PaymentStatusAnswer = 'succeeded' | 'failed' | 'not_found' | 'unknown' | 'in_flight';
|
|
20443
|
+
/**
|
|
20444
|
+
* The host's status check: asks ITS backend for the state of the attempt with this key (`GET /payments/attempts/{key}`). A rejection or an answer slower than `statusCheckTimeoutMs` counts as
|
|
20445
|
+
* `'unknown'`. **A key whose request may still be running must answer `'unknown'` / `'in_flight'`, never `'failed'`**: a `'failed'` answer unlocks the form with a NEW key, so a late-landing original
|
|
20446
|
+
* request would become a second charge. `'not_found'` means "the backend has definitively never seen this key": the library only believes it once the attempt is older than the request timeout
|
|
20447
|
+
* plus the fail grace (a slow original request may still be on its way), then unlocks with a new key. While the attempt's own request is unsettled `'failed'` / `'not_found'` are ignored for a hard
|
|
20448
|
+
* maximum counted from the moment it became unknown; an attempt whose host charge may still be running (`host_silent`, `host`) is given the request timeout plus the grace counted from that
|
|
20449
|
+
* moment too, and an attempt adopted from a reload or another tab the request timeout plus the grace counted from the START of the attempt. The request timeout is the one of the form's own request.
|
|
20450
|
+
*/
|
|
20451
|
+
export type CheckPaymentStatusFn = (attemptKey: string) => HostResult<PaymentStatusAnswer>;
|
|
20452
|
+
/** Why a new attempt was not started: another one is running (`locked`), the payable is paid (`paid`), the outcome of an earlier attempt is unknown (`unknown`), no connection (`offline`). */
|
|
20453
|
+
export type PaymentAttemptRefusal = 'locked' | 'paid' | 'unknown' | 'offline';
|
|
20454
|
+
export type PaymentAttemptOutcomeKind = 'succeeded' | 'failed' | 'unknown' | 'refused' | 'pending';
|
|
20455
|
+
/**
|
|
20456
|
+
* The unified outcome event of a payment form: `reason` is `timeout`, `offline`, `host`, `host_error`, `host_silent`, `status_check`, `error`, `auth_abandoned`, `paid`, `reload`, `other_tab`, `token`,
|
|
20457
|
+
* `duplicate_suspected` (an attempt that started after an older one turned out paid ALSO produced a payment: the host must resolve the duplicate), ...
|
|
20458
|
+
*/
|
|
20459
|
+
export interface PaymentAttemptOutcome {
|
|
20460
|
+
kind: PaymentAttemptOutcomeKind;
|
|
20461
|
+
attemptKey: string;
|
|
20462
|
+
reason?: string;
|
|
20463
|
+
/**
|
|
20464
|
+
* Only on a `succeeded` outcome that the form did NOT see happen itself (`other_tab`: another tab / page load paid; a late success of an older attempt; a status check that found it paid after the
|
|
20465
|
+
* form had moved on): the amount (major units) and method the PAID attempt was started with, so a host that wants to reconcile it can read them. Absent otherwise.
|
|
20466
|
+
*/
|
|
20467
|
+
amount?: number | null;
|
|
20468
|
+
method?: string;
|
|
20469
|
+
}
|
|
20470
|
+
/** What a step of an attempt reports: `success` (money moved / payment exists), `failure` (a DEFINITIVE refusal: new key), `unknown` (ambiguous: key kept, locked), `pending` (a challenge / the host's charge is in progress: lock stays), `released` (failed BEFORE any charge request: unlock, key kept). */
|
|
20471
|
+
export type PaymentAttemptKind = 'success' | 'failure' | 'unknown' | 'pending' | 'released';
|
|
20472
|
+
export interface PaymentAttemptResult<T> {
|
|
20473
|
+
kind: PaymentAttemptKind;
|
|
20474
|
+
value?: T;
|
|
20475
|
+
reason?: string;
|
|
20476
|
+
}
|
|
20477
|
+
/**
|
|
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`.
|
|
20486
|
+
*/
|
|
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[];
|
|
20493
|
+
/** Is this host error the payments service's "this attempt failed before, use a new attemptKey" answer (code `attempt_failed_use_new_key`)? */
|
|
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;
|
|
20499
|
+
/**
|
|
20500
|
+
* Classifies a failed HOST call (the charge request) for `run()`:
|
|
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
|
|
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`);
|
|
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
|
|
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
|
|
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;
|
|
20508
|
+
* - `'failure'`: the host definitively refused (another `4xx`). The status is read from `status` or `response.status`.
|
|
20509
|
+
*/
|
|
20510
|
+
export declare function classifyHostError(error: unknown): 'failure' | 'unknown' | 'not_sent';
|
|
20511
|
+
/**
|
|
20512
|
+
* Did the offline layer answer a charge request with its synthetic "queued for later" response (`@forgeroute/ui/offline`: HTTP 202 whose body carries `_offline: true`) instead of sending it? Such an
|
|
20513
|
+
* answer is NOT a payment: nothing reached the processor, so the form must release (key kept) and say so. A genuine 202 from a backend ("accepted, still processing") has no `_offline` marker and is not
|
|
20514
|
+
* affected. Checks the result itself and, for a host that hands back the response object, its `body`.
|
|
20515
|
+
*/
|
|
20516
|
+
export declare function wasQueuedOffline(result: unknown): boolean;
|
|
20517
|
+
export type PaymentAttemptRun<T> = {
|
|
20518
|
+
refused: PaymentAttemptRefusal;
|
|
20519
|
+
} | (PaymentAttemptResult<T> & {
|
|
20520
|
+
refused?: undefined;
|
|
20521
|
+
late?: undefined;
|
|
20522
|
+
});
|
|
20523
|
+
/** Defaults (ms): the status poll interval, how long it polls before offering "Check again", how long one request may take before it counts as unknown, and the status check's own timeout / fail grace. */
|
|
20524
|
+
export declare const PAYMENT_STATUS_POLL_MS = 3000;
|
|
20525
|
+
export declare const PAYMENT_STATUS_POLL_MAX_MS = 90000;
|
|
20526
|
+
export declare const PAYMENT_REQUEST_TIMEOUT_MS = 60000;
|
|
20527
|
+
export declare const PAYMENT_STATUS_CHECK_TIMEOUT_MS = 10000;
|
|
20528
|
+
export declare const PAYMENT_STATUS_FAIL_GRACE_MS = 60000;
|
|
20529
|
+
/** While the attempt's own request is unsettled a status `failed` / `not_found` is ignored for this long after the attempt became unknown. */
|
|
20530
|
+
export declare const PAYMENT_STATUS_HARD_MAX_MS = 180000;
|
|
20531
|
+
/** One request may take this long while a 3-D Secure challenge or the Square bank window is open (the main request timeout is replaced, not added). */
|
|
20532
|
+
export declare const PAYMENT_AUTH_TIMEOUT_MS = 300000;
|
|
20533
|
+
/** A token-only form whose host never reports (markSucceeded / markFailed / markUnknown / markNotCharged) becomes unknown after this long. */
|
|
20534
|
+
export declare const PAYMENT_HOST_SILENCE_MS = 120000;
|
|
20535
|
+
/** An undecided attempt marker older than this is ignored (the page that wrote it is long gone). */
|
|
20536
|
+
export declare const PAYMENT_ATTEMPT_MARKER_TTL_MS: number;
|
|
20537
|
+
/** A tombstone (the attempt was decided: released / failed / succeeded) older than this is ignored. */
|
|
20538
|
+
export declare const PAYMENT_ATTEMPT_TOMBSTONE_TTL_MS: number;
|
|
20539
|
+
/** The record of a SUCCEEDED attempt (`ui-payment-attempt:<payable>#paid`) is kept this long and locks the payable as PAID in every form that loads meanwhile (the tombstone only covers the first 2 minutes). It is never consumed: a second payment of the same payable is `resetPaid()` or a NEW `payableRef`. */
|
|
20540
|
+
export declare const PAYMENT_ATTEMPT_PAID_RECORD_TTL_MS: number;
|
|
20541
|
+
/**
|
|
20542
|
+
* Where the opaque attempt marker lives (default `localStorage`, shared by every tab of the browser profile; falls back to `sessionStorage`, then `null`). Replace it in specs. It holds ONLY the
|
|
20543
|
+
* opaque marker `{ key, startedAt, state, owner, amount, method }` of an UNDECIDED attempt (replaced by a 2-minute tombstone `{ state, key, at, owner }` when it is decided) under
|
|
20544
|
+
* `ui-payment-attempt:<payableRef>`, plus one integer epoch under `ui-payment-attempt:<payableRef>#epoch`: never card data, never server data, never a cached response.
|
|
20545
|
+
*/
|
|
20546
|
+
export declare const PAYMENT_ATTEMPT_STORAGE: InjectionToken<() => Storage | null>;
|
|
20547
|
+
export declare const PAYMENT_ATTEMPT_STORAGE_PREFIX = "ui-payment-attempt:";
|
|
20548
|
+
/** The opaque marker of an attempt that has started and is not decided yet (shared across tabs and reloads while it lasts). */
|
|
20549
|
+
export interface PaymentAttemptMarker {
|
|
20550
|
+
key: string;
|
|
20551
|
+
startedAt: number;
|
|
20552
|
+
state: 'inflight' | 'unknown';
|
|
20553
|
+
/** Random id of the form instance that wrote it (a second instance / tab / reload is not the owner). */
|
|
20554
|
+
owner: string;
|
|
20555
|
+
amount: number | null;
|
|
20556
|
+
method: string;
|
|
20557
|
+
}
|
|
20558
|
+
/** What replaces the marker for 2 minutes when the attempt is decided, so other tabs learn HOW it ended (removing the marker alone says nothing). */
|
|
20559
|
+
export interface PaymentAttemptTombstone {
|
|
20560
|
+
state: 'released' | 'failed' | 'succeeded';
|
|
20561
|
+
key: string;
|
|
20562
|
+
at: number;
|
|
20563
|
+
owner: string;
|
|
20564
|
+
/** Only on a `succeeded` tombstone: what the paid attempt was started with, so another tab / page load can hand it to a host that reconciles. */
|
|
20565
|
+
amount?: number | null;
|
|
20566
|
+
method?: string;
|
|
20567
|
+
}
|
|
20568
|
+
/** The record of a succeeded attempt, kept 24 hours under `ui-payment-attempt:<payable>#paid` (local state that MIRRORS a server outcome: it never replaces the backend's own record). */
|
|
20569
|
+
export interface PaymentAttemptPaidRecord {
|
|
20570
|
+
key: string;
|
|
20571
|
+
amount: number | null;
|
|
20572
|
+
method: string;
|
|
20573
|
+
at: number;
|
|
20574
|
+
owner: string;
|
|
20575
|
+
}
|
|
20576
|
+
/** What a payment-panel plugin forwards to its body, so the HOST can resolve an undecided attempt without a status check (`<ui-square-payment-method #sq>` then `sq.markSucceeded()`). */
|
|
20577
|
+
export interface PaymentAttemptControls {
|
|
20578
|
+
markUnknown(): void;
|
|
20579
|
+
markSucceeded(): void;
|
|
20580
|
+
markFailed(): void;
|
|
20581
|
+
markNotCharged(): void;
|
|
20582
|
+
/** A deliberate second payment of the payable: forget the paid state, move the epoch (a NEW attempt key). */
|
|
20583
|
+
resetPaid(): void;
|
|
20584
|
+
}
|
|
20585
|
+
export interface PaymentAttemptOptions {
|
|
20586
|
+
destroyRef: DestroyRef;
|
|
20587
|
+
/** The payable this form pays (a unit balance, an invoice, a reservation): the marker of an undecided attempt is stored under it, and without a host `attemptKey` the key is DERIVED from it. `null` = memory only. */
|
|
20588
|
+
payableRef: () => string | null;
|
|
20589
|
+
amount: () => number | null;
|
|
20590
|
+
method: () => string;
|
|
20591
|
+
/** A key the host supplies: used as it is (never generated, never renewed). */
|
|
20592
|
+
attemptKey: () => string | null;
|
|
20593
|
+
checkStatus: () => CheckPaymentStatusFn | null;
|
|
20594
|
+
/** The payable is paid (host re-render, back navigation): every attempt is refused for good. */
|
|
20595
|
+
paid: () => boolean;
|
|
20596
|
+
/** The host reports an ambiguous result (its own timeout): the form goes to the unknown state while this is true. */
|
|
20597
|
+
hostPending?: () => boolean;
|
|
20598
|
+
/** A step that is in flight when the connection drops becomes UNKNOWN (default true). A form that only TOKENIZES (no charge yet) turns it off: the token call answers or fails by itself. */
|
|
20599
|
+
offlineMidFlight?: boolean;
|
|
20600
|
+
pollMs?: () => number;
|
|
20601
|
+
pollMaxMs?: () => number;
|
|
20602
|
+
/** A status check slower than this counts as `'unknown'` (default 10 s). */
|
|
20603
|
+
statusTimeoutMs?: () => number;
|
|
20604
|
+
/** An attempt adopted from a reload / another tab, and a `not_found`, is given the request timeout plus this long before a `failed` / `not_found` is believed (default 60 s). */
|
|
20605
|
+
failGraceMs?: () => number;
|
|
20606
|
+
/** While the attempt's own request is unsettled a `failed` / `not_found` is ignored for this long after the attempt became unknown (default 180 s). */
|
|
20607
|
+
statusHardMaxMs?: () => number;
|
|
20608
|
+
/** The request timeout is replaced by this while a 3-D Secure challenge / the bank window is open (default 300 s). */
|
|
20609
|
+
authTimeoutMs?: () => number;
|
|
20610
|
+
/** A token-only form whose host never reports becomes unknown after this long (default 120 s). */
|
|
20611
|
+
hostSilenceMs?: () => number;
|
|
20612
|
+
storage?: () => Storage | null;
|
|
20613
|
+
/** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a click because of it (default false). */
|
|
20614
|
+
offlineOverride?: () => boolean;
|
|
20615
|
+
/** The clock (specs). */
|
|
20616
|
+
now?: () => number;
|
|
20617
|
+
onOutcome?: (outcome: PaymentAttemptOutcome) => void;
|
|
20618
|
+
onInFlightChange?: (inFlight: boolean) => void;
|
|
20619
|
+
onKeyChange?: (key: string) => void;
|
|
20620
|
+
}
|
|
20621
|
+
export declare class PaymentAttempt {
|
|
20622
|
+
private readonly o;
|
|
20623
|
+
/** A step of an attempt is running (set in the SAME synchronous tick as the first click / Enter / programmatic call). */
|
|
20624
|
+
readonly inFlight: import("@angular/core").WritableSignal<boolean>;
|
|
20625
|
+
/** The outcome of an attempt is not known: Pay stays locked, the screen says "Checking your payment...". */
|
|
20626
|
+
readonly unknown: import("@angular/core").WritableSignal<boolean>;
|
|
20627
|
+
/** A status check is running. */
|
|
20628
|
+
readonly checking: import("@angular/core").WritableSignal<boolean>;
|
|
20629
|
+
/** The bounded polling gave up: "Check again" is offered. */
|
|
20630
|
+
readonly pollExpired: import("@angular/core").WritableSignal<boolean>;
|
|
20631
|
+
/** A payment of this form succeeded (locks the form until the host resets the payable). */
|
|
20632
|
+
readonly succeeded: import("@angular/core").WritableSignal<boolean>;
|
|
20633
|
+
/** The token was handed to the host, which is now charging: the screen says "Waiting for your payment to be confirmed" until the host reports (or stays silent too long). */
|
|
20634
|
+
readonly waitingForHost: import("@angular/core").WritableSignal<boolean>;
|
|
20635
|
+
/** The marker could not be written (storage blocked or full): reload / second-tab protection is not active. */
|
|
20636
|
+
readonly markerWriteFailed: import("@angular/core").WritableSignal<boolean>;
|
|
20637
|
+
readonly offline: import("@angular/core").WritableSignal<boolean>;
|
|
20638
|
+
/** The browser says offline AND the host did not turn `offlineOverride` on: the click is refused and the offline notice shows. */
|
|
20639
|
+
readonly blockedOffline: import("@angular/core").Signal<boolean>;
|
|
20640
|
+
readonly paidLocked: import("@angular/core").Signal<boolean>;
|
|
20641
|
+
/** No new attempt may start. */
|
|
20642
|
+
readonly locked: import("@angular/core").Signal<boolean>;
|
|
20643
|
+
/** The host gave a status check, so the unknown state can resolve by itself. */
|
|
20644
|
+
readonly canCheck: import("@angular/core").Signal<boolean>;
|
|
20645
|
+
/** The key, amount, method and payable the running / undecided attempt was STARTED with, `null` when no attempt is undecided. */
|
|
20646
|
+
private readonly pinned;
|
|
20647
|
+
readonly pinnedAmount: import("@angular/core").Signal<number | null>;
|
|
20648
|
+
readonly pinnedMethod: import("@angular/core").Signal<string | null>;
|
|
20649
|
+
readonly pinnedRef: import("@angular/core").Signal<string | null>;
|
|
20650
|
+
/** Bumped when an attempt of this payable is decided: the next DERIVED key differs from every finished one. */
|
|
20651
|
+
private readonly epoch;
|
|
20652
|
+
private readonly renewTick;
|
|
20653
|
+
/** The attempt key in effect: the PINNED key of a running / undecided attempt, else the host's, else (with a payableRef) the key derived from payable, amount, method and epoch, else a random one. */
|
|
20654
|
+
readonly key: import("@angular/core").Signal<string>;
|
|
20655
|
+
private readonly id;
|
|
20656
|
+
private readonly memKeys;
|
|
20657
|
+
private destroyed;
|
|
20658
|
+
private unknownReason;
|
|
20659
|
+
private unknownSince;
|
|
20660
|
+
private liveRun;
|
|
20661
|
+
private runSeq;
|
|
20662
|
+
/** Key of an attempt that started while an OLDER one turned out paid: its own result must not change the paid state and is reported as a suspected duplicate. */
|
|
20663
|
+
private watchKey;
|
|
20664
|
+
/** Key of the attempt that made the payable paid (a late success with ANOTHER key is a suspected duplicate). */
|
|
20665
|
+
private paidKey;
|
|
20666
|
+
/** Keys already reported as `duplicate_suspected` (reported once each). */
|
|
20667
|
+
private readonly duplicates;
|
|
20668
|
+
/** The request timeout of the newest `run()` (the status grace is measured against it, not against the default). */
|
|
20669
|
+
private requestMs;
|
|
20670
|
+
private pollTimer;
|
|
20671
|
+
private silenceTimer;
|
|
20672
|
+
private pollElapsed;
|
|
20673
|
+
private pollGen;
|
|
20674
|
+
private checkRun;
|
|
20675
|
+
private hostWasPending;
|
|
20676
|
+
private lastRef;
|
|
20677
|
+
private readonly win;
|
|
20678
|
+
private readonly onOffline;
|
|
20679
|
+
private readonly onOnline;
|
|
20680
|
+
private readonly onStorage;
|
|
20681
|
+
/** A frozen / back-forward-cached page missed its storage events: read the shared state again when it comes back. */
|
|
20682
|
+
private readonly onResync;
|
|
20683
|
+
private readonly onVisible;
|
|
20684
|
+
constructor(o: PaymentAttemptOptions);
|
|
20685
|
+
/** Which storage protects this payable: `shared` (every tab), `tab` (sessionStorage fallback: this tab only), `none` (blocked). */
|
|
20686
|
+
storageScope(): 'shared' | 'tab' | 'none';
|
|
20687
|
+
/**
|
|
20688
|
+
* Starts an attempt: SYNCHRONOUS, so a second click / Enter / programmatic call in the same tick (or any later one while it runs) is refused. Nothing is sent when it refuses.
|
|
20689
|
+
* `locked` (a double click) is silent; `paid`, `unknown` and `offline` also emit a `refused` outcome. The key, amount, method and payable are PINNED here: later input changes never move a running attempt.
|
|
20690
|
+
*/
|
|
20691
|
+
begin(): {
|
|
20692
|
+
ok: true;
|
|
20693
|
+
key: string;
|
|
20694
|
+
} | {
|
|
20695
|
+
ok: false;
|
|
20696
|
+
reason: PaymentAttemptRefusal;
|
|
20697
|
+
};
|
|
20698
|
+
/** The attempt ended BEFORE any charge request (validation, tokenization, buyer verification): unlock, the key is kept. */
|
|
20699
|
+
release(): void;
|
|
20700
|
+
/** Clears the marker of an attempt that never sent anything, even when the form is already destroyed (a destroyed form must not leave a 30-minute lock behind). */
|
|
20701
|
+
abandon(): void;
|
|
20702
|
+
/** The host says nothing was sent to the processor (it did not use the token, its call never left): unlock, the key is kept. Only valid for "NOT SENT": a retry must find any attempt state the backend holds for the key. */
|
|
20703
|
+
markNotCharged(): void;
|
|
20704
|
+
/** The payment succeeded (or exists and is settling): the form locks for this payable. Idempotent. */
|
|
20705
|
+
succeed(reason?: string): void;
|
|
20706
|
+
/**
|
|
20707
|
+
* The host starts a deliberate SECOND payment of this payable (an explicit "pay again" flow): forgets that this form instance saw a success, removes the succeeded record and tombstone and moves the epoch, so the next
|
|
20708
|
+
* attempt has a NEW key. Does nothing against the host's own `paid` input (the host clears that itself) and is IGNORED while an attempt is running or unknown (call it again once that attempt is decided).
|
|
20709
|
+
*/
|
|
20710
|
+
resetPaid(): void;
|
|
20711
|
+
/** A DEFINITIVE failure (declined, failed, status check says failed): unlock, with a NEW key. Never for a timeout or an offline loss. Ignored after a success. */
|
|
20712
|
+
fail(reason?: string, external?: boolean): void;
|
|
20713
|
+
/** The payer chose "Start over" after the polling window: unlock with a NEW key (only offered when the backend allows ONE open or succeeded attempt per payable, which is what makes it safe). */
|
|
20714
|
+
startOver(): void;
|
|
20715
|
+
/** The outcome is ambiguous (timeout, offline mid-flight, host-reported, reload, another tab): lock, KEEP (and pin) the key, check the status. Idempotent. */
|
|
20716
|
+
markUnknown(reason: string): void;
|
|
20717
|
+
/**
|
|
20718
|
+
* The step that needs the processor is in progress elsewhere: the lock STAYS ON until the host or a status check decides. `token` = the host is charging a token (the screen says "Waiting for your
|
|
20719
|
+
* payment to be confirmed", and a host that stays silent for `hostSilenceMs` makes the outcome unknown); `auth_required` / `bank_window` = a 3-D Secure challenge / the bank window is open (the request
|
|
20720
|
+
* timeout is replaced by `authTimeoutMs`).
|
|
20721
|
+
*/
|
|
20722
|
+
markPending(reason?: string): void;
|
|
20723
|
+
/** Asks the host's status check once (a newer call supersedes an older one). `succeeded` -> success state, `failed` / `not_found` -> unlocked with a new key (once believed), anything else -> stays locked. */
|
|
20724
|
+
checkNow(): Promise<void>;
|
|
20725
|
+
/** "Check again": polls for another bounded round. */
|
|
20726
|
+
checkAgain(): void;
|
|
20727
|
+
/**
|
|
20728
|
+
* Runs one attempt: `begin()` (synchronous), then `op(key)`, raced against `timeoutMs` (replaced by `authTimeoutMs` while `markPending('auth_required' | 'bank_window')` is on). The result decides the
|
|
20729
|
+
* lock: `success` locks for good, `failure` unlocks with a new key, `released` unlocks with the same key, `pending` keeps the lock, `unknown` and a timeout (or an exception) lock in the unknown state.
|
|
20730
|
+
* An answer that arrives AFTER the timeout still settles the attempt while it is still THE attempt (`onLate`); once the attempt moved on (a status check unlocked it, a newer attempt began) a late
|
|
20731
|
+
* failure / release / unknown is dropped and a late SUCCESS only marks the payable paid (and is reported once with its own, old key), never touching the newer attempt's lock, pin or marker.
|
|
20732
|
+
*/
|
|
20733
|
+
run<T>(op: (key: string) => Promise<PaymentAttemptResult<T>>, options?: {
|
|
20734
|
+
timeoutMs?: number;
|
|
20735
|
+
onLate?: (result: PaymentAttemptResult<T>) => void;
|
|
20736
|
+
}): Promise<PaymentAttemptRun<T>>;
|
|
20737
|
+
/**
|
|
20738
|
+
* Is the run that was given `key` still THE attempt in progress (not replaced by a newer attempt, not decided, the form not destroyed)? An op uses it to skip every screen side effect of a LATE answer
|
|
20739
|
+
* (a decline text, `setBusy(false)`, releasing an inner form) that would otherwise land on the NEWER attempt's screen. The result it returns is still applied by `run()` with the same rules.
|
|
20740
|
+
*/
|
|
20741
|
+
isLive(key: string): boolean;
|
|
20742
|
+
/** Applies the result of a step to THIS attempt (see {@link PaymentAttemptKind}). */
|
|
20743
|
+
apply<T>(result: PaymentAttemptResult<T>): void;
|
|
20744
|
+
private now;
|
|
20745
|
+
/** Newest run that is still THE attempt in progress (same pinned key, not replaced by a newer run). */
|
|
20746
|
+
private isCurrent;
|
|
20747
|
+
private applyRun;
|
|
20748
|
+
/**
|
|
20749
|
+
* The form was destroyed before this attempt's answer arrived (the panel closes when it records the payment). The host is not told (nobody listens any more); the records are written so the next form of the
|
|
20750
|
+
* payable starts paid (success), unlocked with a new key (failure) or unlocked (released), and a development warning says it happened.
|
|
20751
|
+
*/
|
|
20752
|
+
private settleDestroyed;
|
|
20753
|
+
/** The result of an attempt that belongs to ANOTHER payable than the one on screen: only that payable's records change; this form's lock, pin and paid state are for the payable on screen. */
|
|
20754
|
+
private settleOtherPayable;
|
|
20755
|
+
/**
|
|
20756
|
+
* An attempt other than the current one turned out paid (a late answer of an older attempt, a late status answer, or another tab's success): the payable IS paid. A newer attempt's lock, pin and marker are
|
|
20757
|
+
* left alone. When the payable was ALREADY paid by a different key, the second payment is a suspected duplicate: it is reported once (`unknown` / `duplicate_suspected`, with ITS key) for the host to resolve.
|
|
20758
|
+
*/
|
|
20759
|
+
private lateSuccess;
|
|
20760
|
+
/**
|
|
20761
|
+
* The result of the attempt that was running when the payable turned out paid: it only releases its own lock (and leaves its own marker as `succeeded`). If it was an attempt with ANOTHER key and it ALSO
|
|
20762
|
+
* succeeded it is reported as a suspected duplicate for the host to resolve; one with the SAME key is that very payment and settles silently.
|
|
20763
|
+
*/
|
|
20764
|
+
private settleWatched;
|
|
20765
|
+
private currentRunUnsettled;
|
|
20766
|
+
/**
|
|
20767
|
+
* Is a `failed` / `not_found` answer too early to believe? (see {@link CheckPaymentStatusFn})
|
|
20768
|
+
* - the attempt's own request is still unsettled: ignored for `statusHardMaxMs` after it became unknown (counted from there, so a long auth timeout does not use it up);
|
|
20769
|
+
* - the host's charge may still be running (`host_silent`, `host`): the request timeout plus the grace, counted from the moment it became unknown;
|
|
20770
|
+
* - adopted from a reload / another tab, or `not_found`: the request timeout plus the grace, counted from the START of the attempt.
|
|
20771
|
+
*/
|
|
20772
|
+
private mustWait;
|
|
20773
|
+
/** Replaces the request timeout of the running request; `false` when no request is running. */
|
|
20774
|
+
private extendRunTimeout;
|
|
20775
|
+
private clearSilence;
|
|
20776
|
+
private refuse;
|
|
20777
|
+
private emit;
|
|
20778
|
+
/** What a NEW attempt starts with (its key, amount, method and payable never follow later input changes). */
|
|
20779
|
+
private newPin;
|
|
20780
|
+
private setInFlight;
|
|
20781
|
+
private leaveUnknown;
|
|
20782
|
+
/** The host says its own ambiguity is over: leave the unknown state without deciding (the host reports the result itself). */
|
|
20783
|
+
private endUnknown;
|
|
20784
|
+
private startPolling;
|
|
20785
|
+
/** One round: the check now, then (while still unknown and inside the bounded window) the next one after `pollMs`. */
|
|
20786
|
+
private pollOnce;
|
|
20787
|
+
private stopPolling;
|
|
20788
|
+
private amountPart;
|
|
20789
|
+
private tupleId;
|
|
20790
|
+
/**
|
|
20791
|
+
* The key of a NEW attempt: the host's; else, with a payableRef, a DERIVED readable one (`pa_<payable>_<cents>_<method>_e<epoch>`) so every tab and every reload of the same payable, amount and
|
|
20792
|
+
* method hold the SAME key without talking to each other (the epoch only grows when an attempt of the payable is decided); else a random one held in memory per (amount, method).
|
|
20793
|
+
*/
|
|
20794
|
+
private resolveKey;
|
|
20795
|
+
/** The attempt with `finished` ended definitively: no key may be resolved again for it. With `bumpRef` (a definitive FAILURE of this payable) the epoch grows too, so the next attempt gets a new derived key. */
|
|
20796
|
+
private renew;
|
|
20797
|
+
private store;
|
|
20798
|
+
private markerKey;
|
|
20799
|
+
private epochName;
|
|
20800
|
+
private storedEpoch;
|
|
20801
|
+
/** The shared epoch of `ref` (cleared storage reads as 0: a replayed key then returns the ORIGINAL payment, which the host must record idempotently). */
|
|
20802
|
+
private readEpoch;
|
|
20803
|
+
/** Never goes backwards: the next epoch is one above the larger of this page's and the stored one. */
|
|
20804
|
+
private bumpEpoch;
|
|
20805
|
+
private parseStored;
|
|
20806
|
+
private readStored;
|
|
20807
|
+
/** A pending marker of this payable that another form instance (tab, page load) wrote and that is not expired. */
|
|
20808
|
+
private foreignMarker;
|
|
20809
|
+
/**
|
|
20810
|
+
* COMPARE-AND-WRITE: the stored record belongs to ANOTHER attempt (a different key) and must not be replaced or removed by this instance. A marker is only blocked by an undecided marker of another key
|
|
20811
|
+
* (a tombstone of a finished attempt is simply replaced by the next attempt's marker); a tombstone / removal is blocked by ANY stored record of another key (this instance's decision is stale).
|
|
20812
|
+
*/
|
|
20813
|
+
private storedOfOther;
|
|
20814
|
+
private writeMarker;
|
|
20815
|
+
private writeTombstone;
|
|
20816
|
+
/** The attempt was decided: replace its marker by a short tombstone so other tabs learn HOW it ended (a removed marker says nothing). */
|
|
20817
|
+
private endMarker;
|
|
20818
|
+
private removeMarker;
|
|
20819
|
+
private paidName;
|
|
20820
|
+
/** The succeeded record of a payable (24 hours), or null. */
|
|
20821
|
+
private readPaidRecord;
|
|
20822
|
+
private writePaidRecord;
|
|
20823
|
+
private removePaidRecord;
|
|
20824
|
+
/**
|
|
20825
|
+
* The 24-hour record of a payment that succeeded for this payable: the payable is PAID here too for the WHOLE 24 hours (whenever the record exists and the host's `paid` input is false), however long ago it was written.
|
|
20826
|
+
* The record is never consumed by a form that loads later: a deliberate second payment is `resetPaid()` or a NEW `payableRef` (the host contract), never a silent new key. Returns true when the payable was marked paid.
|
|
20827
|
+
*/
|
|
20828
|
+
private checkPaidRecord;
|
|
20829
|
+
/** Best effort, at most one pass per `begin()`: drops this library's own expired markers and tombstones (never the epochs: removing one would let a finished key be derived again). */
|
|
20830
|
+
private sweepStale;
|
|
20831
|
+
/** What another tab (or a re-read of the storage) says about this payable. */
|
|
20832
|
+
private react;
|
|
20833
|
+
/**
|
|
20834
|
+
* Another tab decided an attempt of this payable. `succeeded`: the payable is PAID (same key as the undecided attempt: it is that payment; another key while paid / running: it is recorded with its own key and a
|
|
20835
|
+
* second payment is reported as a suspected duplicate). `failed` / `released`: only an attempt this instance ADOPTED from that tab is unlocked by it.
|
|
20836
|
+
*/
|
|
20837
|
+
private onTombstone;
|
|
20838
|
+
/** Takes over an attempt another instance started: pin ITS key, lock in the unknown state and ask the status check. */
|
|
20839
|
+
private adopt;
|
|
20840
|
+
private onPayableChange;
|
|
20841
|
+
}
|
|
20842
|
+
/**
|
|
20843
|
+
* Readiness gate of the payment forms: Pay is blocked, with a specific reason, while we can already tell a payment cannot complete AND be recorded (offline, a connection too slow to pay
|
|
20844
|
+
* safely, a blocked payment SDK, a browser that cannot pay safely, the host's backend not ready, an earlier payment of unknown outcome). It is evaluated when the form opens, every
|
|
20845
|
+
* `everyMs` (default 10 s) while it is open, on online / offline / visibility events, and AGAIN synchronously right before every submit (`passSync()`): a gate that turned false after
|
|
20846
|
+
* the last render blocks the click and sends nothing.
|
|
20847
|
+
*/
|
|
20848
|
+
export interface PaymentReadinessResult {
|
|
20849
|
+
ready: boolean;
|
|
20850
|
+
reasons: string[];
|
|
20851
|
+
}
|
|
20852
|
+
/** The host's check (`GET /api/payments/ready?payable=...`): `{ ready, reasons }`. A slow answer (> `readinessTimeoutMs`) counts as `slow_connection`, a rejection as `offline` / `slow_connection`. */
|
|
20853
|
+
export type ReadinessCheckFn = () => HostResult<PaymentReadinessResult>;
|
|
20854
|
+
/** The machine reasons the library knows (a host may send others: they block with a generic text). */
|
|
20855
|
+
export declare const PAYMENT_READINESS_REASONS: readonly ["offline", "slow_connection", "sdk_blocked", "service_unavailable", "merchant_not_ready", "events_backlog", "payable_changed", "already_paid", "payment_in_flight", "unsupported_browser", "unknown_payment", "checking"];
|
|
20856
|
+
export declare const PAYMENT_READINESS_TIMEOUT_MS = 4000;
|
|
20857
|
+
export declare const PAYMENT_READINESS_EVERY_MS = 10000;
|
|
20858
|
+
/** A measured round trip above this (ms) from `navigator.connection.rtt` counts as a slow connection. */
|
|
20859
|
+
export declare const PAYMENT_READINESS_SLOW_RTT_MS = 2000;
|
|
20860
|
+
export type PaymentSdkState = 'ok' | 'loading' | 'blocked';
|
|
20861
|
+
export interface PaymentReadinessOptions {
|
|
20862
|
+
destroyRef: DestroyRef;
|
|
20863
|
+
/** The host's check; `null` = only the built-in checks. */
|
|
20864
|
+
check: () => ReadinessCheckFn | null;
|
|
20865
|
+
timeoutMs: () => number;
|
|
20866
|
+
everyMs?: () => number;
|
|
20867
|
+
/** The processor SDK / tokenizer state of the form: `'blocked'` (the script or the form could not be loaded) blocks with `sdk_blocked`. */
|
|
20868
|
+
sdk: () => PaymentSdkState;
|
|
20869
|
+
/** An earlier payment of unknown outcome is pending (blocks with `unknown_payment`). */
|
|
20870
|
+
unknownPending: () => boolean;
|
|
20871
|
+
/** The gate applies (the Stripe form turns it off unless duplicate protection is on). */
|
|
20872
|
+
enabled?: () => boolean;
|
|
20873
|
+
/** Is the attempt-marker storage usable? (warning only: without it a reload or a second tab cannot be recognised as an undecided attempt.) */
|
|
20874
|
+
storageAvailable?: () => boolean;
|
|
20875
|
+
/** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): the browser's offline flag does not block (default false). */
|
|
20876
|
+
offlineOverride?: () => boolean;
|
|
20877
|
+
onChange?: (state: PaymentReadinessResult) => void;
|
|
20878
|
+
}
|
|
20879
|
+
/** The label key that words a refusal reason (a readiness reason, `paid`, `unknown`, `offline`): one mapping for every form and plugin. */
|
|
20880
|
+
export declare function refusalLabelKey(reason: string): UiLabelKey;
|
|
20881
|
+
/** What the browser itself tells about the environment (pure: easy to fake). */
|
|
20882
|
+
export declare function builtInReadinessReasons(ignoreOffline?: boolean): string[];
|
|
20883
|
+
export declare class PaymentReadiness {
|
|
20884
|
+
private readonly o;
|
|
20885
|
+
/** The host's last answer's reasons (empty until it answered). */
|
|
20886
|
+
private readonly hostReasons;
|
|
20887
|
+
/** The check the host's last answer belongs to (a host check added or replaced later keeps the gate closed, reason `checking`, until it has answered). */
|
|
20888
|
+
private readonly answeredFor;
|
|
20889
|
+
/** The first evaluation finished: no host check to wait for, or the current one has answered. */
|
|
20890
|
+
readonly evaluated: import("@angular/core").Signal<boolean>;
|
|
20891
|
+
private readonly builtIns;
|
|
20892
|
+
/** Why Pay is blocked, most important first; empty = ready. */
|
|
20893
|
+
readonly reasons: import("@angular/core").Signal<string[]>;
|
|
20894
|
+
readonly ready: import("@angular/core").Signal<boolean>;
|
|
20895
|
+
/** Not blocking: the browser blocks storage, so a reload during a payment cannot reuse the attempt key automatically. */
|
|
20896
|
+
readonly storageWarning: import("@angular/core").Signal<boolean>;
|
|
20897
|
+
private destroyed;
|
|
20898
|
+
private timer;
|
|
20899
|
+
private readonly win;
|
|
20900
|
+
private readonly doc;
|
|
20901
|
+
private run;
|
|
20902
|
+
private loop;
|
|
20903
|
+
private readonly onEvent;
|
|
20904
|
+
private builtIn;
|
|
20905
|
+
constructor(o: PaymentReadinessOptions);
|
|
20906
|
+
/**
|
|
20907
|
+
* The gate right now, SYNCHRONOUSLY (called by every submit before anything is sent): the built-in checks are read afresh, the host's last answer and the SDK / unknown state are
|
|
20908
|
+
* current. A host check that has not answered yet keeps the gate closed. A fresh host check starts in the background for the NEXT click (a click must stay synchronous: a bank window
|
|
20909
|
+
* is only allowed inside the user gesture).
|
|
20910
|
+
*/
|
|
20911
|
+
passSync(): boolean;
|
|
20912
|
+
/** Runs the checks: the built-ins now, then the host's check (raced against the timeout). */
|
|
20913
|
+
evaluate(): Promise<void>;
|
|
20914
|
+
/** Starts (or restarts) the periodic loop: any callback of an earlier schedule is invalidated, so two loops can never run side by side. */
|
|
20915
|
+
private schedule;
|
|
20916
|
+
}
|
|
20917
|
+
/** The inputs every protected payment form declares (the same names and defaults everywhere). */
|
|
20918
|
+
export interface PaymentProtectionInputs {
|
|
20919
|
+
payableRef: Signal<string | null>;
|
|
20920
|
+
attemptKey: Signal<string | null>;
|
|
20921
|
+
checkStatus: Signal<CheckPaymentStatusFn | null>;
|
|
20922
|
+
paid: Signal<boolean>;
|
|
20923
|
+
hostPending: Signal<boolean>;
|
|
20924
|
+
statusPollMs: Signal<number>;
|
|
20925
|
+
statusPollMaxMs: Signal<number>;
|
|
20926
|
+
/** A status check slower than this counts as unknown. */
|
|
20927
|
+
statusCheckTimeoutMs: Signal<number>;
|
|
20928
|
+
/** A status answer `failed` is ignored this long while the attempt's own request is unsettled. */
|
|
20929
|
+
statusFailGraceMs: Signal<number>;
|
|
20930
|
+
/** The request timeout is replaced by this while a 3-D Secure challenge / the bank window is open (optional: default 300 s). */
|
|
20931
|
+
authTimeoutMs?: Signal<number>;
|
|
20932
|
+
/** A token-only form whose host never reports becomes unknown after this long (optional: default 120 s). */
|
|
20933
|
+
hostSilenceMs?: Signal<number>;
|
|
20934
|
+
/** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of it (optional: default false). */
|
|
20935
|
+
offlineOverride?: Signal<boolean>;
|
|
20936
|
+
readinessCheck: Signal<ReadinessCheckFn | null>;
|
|
20937
|
+
readinessTimeoutMs: Signal<number>;
|
|
20938
|
+
readinessEveryMs: Signal<number>;
|
|
20939
|
+
}
|
|
20940
|
+
export interface PaymentProtectionOptions {
|
|
20941
|
+
amount: () => number | null;
|
|
20942
|
+
method: () => string;
|
|
20943
|
+
/** The processor SDK / tokenizer / form of this component. */
|
|
20944
|
+
sdk?: () => PaymentSdkState;
|
|
20945
|
+
/** The Stripe form turns everything off unless its duplicate-protection flag is on (existing behaviour stays exactly as it was). */
|
|
20946
|
+
enabled?: () => boolean;
|
|
20947
|
+
/** A form that only TOKENIZES keeps its lock to the token call: going offline then does not make the outcome unknown. */
|
|
20948
|
+
offlineMidFlight?: boolean;
|
|
20949
|
+
onOutcome?: (outcome: PaymentAttemptOutcome) => void;
|
|
20950
|
+
onInFlightChange?: (inFlight: boolean) => void;
|
|
20951
|
+
onKeyChange?: (key: string) => void;
|
|
20952
|
+
onReadinessChange?: (state: PaymentReadinessResult) => void;
|
|
20953
|
+
}
|
|
20954
|
+
/**
|
|
20955
|
+
* Builds the attempt (lock, key, unknown state) and the readiness gate of one payment form from its inputs. Call it in the component's constructor / field initializers (injection
|
|
20956
|
+
* context): it injects the destroy hook and the attempt-marker storage seam.
|
|
20957
|
+
*/
|
|
20958
|
+
export declare function createPaymentProtection(inputs: PaymentProtectionInputs, options: PaymentProtectionOptions): {
|
|
20959
|
+
attempt: PaymentAttempt;
|
|
20960
|
+
readiness: PaymentReadiness;
|
|
20961
|
+
};
|
|
20962
|
+
/**
|
|
20963
|
+
* What the payer reads while a payment attempt is not a plain "form" any more: "Checking your payment..." (the outcome is unknown: Pay stays locked, never "failed, try again"), the
|
|
20964
|
+
* offline notice, and the paid state. A polite live region announces each state. Used by every payment form of the library; hosts normally never place it themselves.
|
|
20965
|
+
*/
|
|
20966
|
+
export declare class PaymentAttemptStatusComponent {
|
|
20967
|
+
protected readonly labels: UiLabelsService;
|
|
20968
|
+
/** The attempt of the form this status belongs to. */
|
|
20969
|
+
readonly attempt: import("@angular/core").InputSignal<PaymentAttempt>;
|
|
20970
|
+
/** Show the paid state (a form that has its own success notice sets it off while that notice is up). */
|
|
20971
|
+
readonly showPaid: import("@angular/core").InputSignal<boolean>;
|
|
20972
|
+
/** Offer "Start over" after the polling window (only for a backend that allows ONE open or succeeded attempt per payable: that rule is what makes it safe). */
|
|
20973
|
+
readonly allowStartOver: import("@angular/core").InputSignal<boolean>;
|
|
20974
|
+
/** The readiness gate of the form (its reasons are shown while Pay is blocked). */
|
|
20975
|
+
readonly readiness: import("@angular/core").InputSignal<PaymentReadiness | null>;
|
|
20976
|
+
/** "Retry loading the payment form" was pressed (shown for `sdk_blocked`). */
|
|
20977
|
+
readonly retryLoad: import("@angular/core").OutputEmitterRef<void>;
|
|
20978
|
+
protected readonly firstReason: import("@angular/core").Signal<string>;
|
|
20979
|
+
/** The translated text of the first blocking reason; a reason the library does not know blocks with the generic text. */
|
|
20980
|
+
protected readonly readinessText: import("@angular/core").Signal<string>;
|
|
20981
|
+
/** The text the live region reads: the current state, never empty while a state is on screen. */
|
|
20982
|
+
protected readonly announcement: import("@angular/core").Signal<string>;
|
|
20983
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaymentAttemptStatusComponent, never>;
|
|
20984
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PaymentAttemptStatusComponent, "ui-payment-attempt-status", never, {
|
|
20985
|
+
"attempt": {
|
|
20986
|
+
"alias": "attempt";
|
|
20987
|
+
"required": true;
|
|
20988
|
+
"isSignal": true;
|
|
20989
|
+
};
|
|
20990
|
+
"showPaid": {
|
|
20991
|
+
"alias": "showPaid";
|
|
20992
|
+
"required": false;
|
|
20993
|
+
"isSignal": true;
|
|
20994
|
+
};
|
|
20995
|
+
"allowStartOver": {
|
|
20996
|
+
"alias": "allowStartOver";
|
|
20997
|
+
"required": false;
|
|
20998
|
+
"isSignal": true;
|
|
20999
|
+
};
|
|
21000
|
+
"readiness": {
|
|
21001
|
+
"alias": "readiness";
|
|
21002
|
+
"required": false;
|
|
21003
|
+
"isSignal": true;
|
|
21004
|
+
};
|
|
21005
|
+
}, {
|
|
21006
|
+
"retryLoad": "retryLoad";
|
|
21007
|
+
}, never, never, true, never>;
|
|
21008
|
+
}
|
|
21009
|
+
/**
|
|
21010
|
+
* True when the page is in dark mode: `data-theme="dark"` on the root, or the system prefers dark and the root is not forced to `light`.
|
|
21011
|
+
* Shared by the payment entry points (`@forgeroute/ui/stripe` and `@forgeroute/ui/square` build their theme from it); a missing `matchMedia` counts as light.
|
|
21012
|
+
*/
|
|
21013
|
+
export declare function isDarkPage(doc: Document): boolean;
|
|
20142
21014
|
/**
|
|
20143
21015
|
* Locale-aware date, time and number formatting for the library. English (`en-US`, the default) goes through Angular's own formatter and
|
|
20144
21016
|
* `toLocaleString('en-US')`, so every text an English app shows is exactly what it always was. Any other locale goes through `Intl`, which
|