@forgeroute/ui 0.5.12 → 0.5.13
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-map.mjs +1 -0
- package/fesm2022/forgeroute-ui-map.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-messaging.mjs +5 -0
- package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-offline.mjs +20 -0
- package/fesm2022/forgeroute-ui-offline.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-pdf.mjs +1 -0
- package/fesm2022/forgeroute-ui-pdf.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-quickbooks.mjs +55 -24
- package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-square.mjs +167 -9
- package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +336 -41
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-ui-labels.es-CsmSdouE.mjs → forgeroute-ui-ui-labels.es-Dzj_XJJM.mjs} +18 -11
- package/fesm2022/forgeroute-ui-ui-labels.es-Dzj_XJJM.mjs.map +1 -0
- package/fesm2022/forgeroute-ui.mjs +196 -40
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-offline.d.ts +4 -0
- package/types/forgeroute-ui-quickbooks.d.ts +15 -0
- package/types/forgeroute-ui-square.d.ts +73 -1
- package/types/forgeroute-ui-stripe.d.ts +123 -5
- package/types/forgeroute-ui.d.ts +83 -30
- package/fesm2022/forgeroute-ui-ui-labels.es-CsmSdouE.mjs.map +0 -1
|
@@ -138,11 +138,11 @@ const MSG_NOT_INITIALIZED = "Payment system not initialized";
|
|
|
138
138
|
const MSG_INTENT_FAILED = "Failed to create payment intent";
|
|
139
139
|
const MSG_NOT_COMPLETED = "Payment was not completed";
|
|
140
140
|
const MSG_REQUIRES_PAYMENT_METHOD = "Payment failed. Please try a different payment method.";
|
|
141
|
-
const MSG_NO_PAYMENT_METHOD = "No payment method returned
|
|
141
|
+
const MSG_NO_PAYMENT_METHOD = "No payment method was returned";
|
|
142
142
|
const MSG_AUTH_FAILED = "Payment authentication failed";
|
|
143
143
|
const MSG_AUTH_NOT_COMPLETED = "Payment authentication was not completed";
|
|
144
|
-
const MSG_KEY_MISSING = "
|
|
145
|
-
const MSG_LOAD_FAILED = "Failed to load
|
|
144
|
+
const MSG_KEY_MISSING = "The payment form is not set up yet";
|
|
145
|
+
const MSG_LOAD_FAILED = "Failed to load the payment service";
|
|
146
146
|
const MSG_TOKEN_FAILED = "The card details could not be checked. Please try again.";
|
|
147
147
|
function paymentMethodIdOf(intent) {
|
|
148
148
|
const pm = intent?.payment_method;
|
|
@@ -204,11 +204,11 @@ const KNOWN_MESSAGE_KEYS = {
|
|
|
204
204
|
"Failed to create payment intent": "stripePayment.msg.intentFailed",
|
|
205
205
|
"Payment was not completed": "stripePayment.msg.notCompleted",
|
|
206
206
|
"Payment failed. Please try a different payment method.": "stripePayment.msg.requiresPaymentMethod",
|
|
207
|
-
"No payment method returned
|
|
207
|
+
"No payment method was returned": "stripePayment.msg.noPaymentMethod",
|
|
208
208
|
"Payment authentication failed": "stripePayment.msg.authFailed",
|
|
209
209
|
"Payment authentication was not completed": "stripePayment.msg.authNotCompleted",
|
|
210
|
-
"
|
|
211
|
-
"Failed to load
|
|
210
|
+
"The payment form is not set up yet": "stripePayment.msg.keyMissing",
|
|
211
|
+
"Failed to load the payment service": "stripePayment.msg.loadFailed",
|
|
212
212
|
"Verification failed": "stripePayment.msg.verifyFailed",
|
|
213
213
|
"Verification failed. Please check the code and try again.": "stripePayment.msg.verifyThrown",
|
|
214
214
|
"We could not check the status of this payment. Please contact support before trying again.": "stripePayment.msg.returnFailed",
|
|
@@ -428,6 +428,36 @@ function readStripeAppearance(doc, element = doc.documentElement) {
|
|
|
428
428
|
...Object.keys(variables).length ? { variables } : {}
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
+
function stripeAppearanceFromTheme(tokens) {
|
|
432
|
+
const variables = {};
|
|
433
|
+
const set = (name, value) => {
|
|
434
|
+
if (value && value.trim()) variables[name] = value.trim();
|
|
435
|
+
};
|
|
436
|
+
set("colorPrimary", tokens.primary);
|
|
437
|
+
set("colorBackground", tokens.background);
|
|
438
|
+
set("colorText", tokens.text);
|
|
439
|
+
set("colorTextSecondary", tokens.textMuted);
|
|
440
|
+
set("colorDanger", tokens.danger);
|
|
441
|
+
set("fontFamily", tokens.fontFamily);
|
|
442
|
+
set("borderRadius", tokens.radius);
|
|
443
|
+
set("fontSizeBase", tokens.fontSize);
|
|
444
|
+
const rules = {};
|
|
445
|
+
const rule = (selector, props) => {
|
|
446
|
+
const filled = Object.fromEntries(Object.entries(props).filter(([, v]) => !!v && v.trim()));
|
|
447
|
+
if (Object.keys(filled).length) rules[selector] = filled;
|
|
448
|
+
};
|
|
449
|
+
if (tokens.border) {
|
|
450
|
+
rule(".Input", { border: `1px solid ${tokens.border.trim()}` });
|
|
451
|
+
rule(".Tab", { border: `1px solid ${tokens.border.trim()}` });
|
|
452
|
+
}
|
|
453
|
+
if (tokens.text) rule(".Label", { color: tokens.text });
|
|
454
|
+
return {
|
|
455
|
+
theme: tokens.dark ? "night" : "stripe",
|
|
456
|
+
labels: tokens.labels ?? "above",
|
|
457
|
+
...Object.keys(variables).length ? { variables } : {},
|
|
458
|
+
...Object.keys(rules).length ? { rules } : {}
|
|
459
|
+
};
|
|
460
|
+
}
|
|
431
461
|
const STRIPE_A11Y_MESSAGES = {
|
|
432
462
|
get loading() {
|
|
433
463
|
return uiText("stripePayment.a11y.loading");
|
|
@@ -475,7 +505,8 @@ const AMBIGUOUS_STRIPE_CODES = /* @__PURE__ */ new Set([
|
|
|
475
505
|
"lock_timeout"
|
|
476
506
|
]);
|
|
477
507
|
const MSG_SETUP_INCOMPLETE = "Payment method setup was incomplete. Please try again.";
|
|
478
|
-
|
|
508
|
+
const INSTANT_ONLY_CODE = "instant_only_unsupported";
|
|
509
|
+
let nextId$1 = 0;
|
|
479
510
|
const jsonEqual = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
480
511
|
var StripePaymentComponent = class StripePaymentComponent {
|
|
481
512
|
constructor() {
|
|
@@ -485,6 +516,7 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
485
516
|
this.doc = inject(DOCUMENT);
|
|
486
517
|
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
487
518
|
this.host = inject(ElementRef);
|
|
519
|
+
this.injector = inject(Injector);
|
|
488
520
|
this.mountOnly = input(false, ...ngDevMode ? [{ debugName: "mountOnly" }] : /* istanbul ignore next */ []);
|
|
489
521
|
this.mode = input("payment", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
|
|
490
522
|
this.publishableKey = input(null, ...ngDevMode ? [{ debugName: "publishableKey" }] : /* istanbul ignore next */ []);
|
|
@@ -506,6 +538,9 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
506
538
|
this.paymentElementOptions = input(null, ...ngDevMode ? [{ debugName: "paymentElementOptions" }] : /* istanbul ignore next */ []);
|
|
507
539
|
this.appearance = input(null, ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
|
|
508
540
|
this.appearanceFromTokens = input(false, ...ngDevMode ? [{ debugName: "appearanceFromTokens" }] : /* istanbul ignore next */ []);
|
|
541
|
+
this.instantOnly = input(false, ...ngDevMode ? [{ debugName: "instantOnly" }] : /* istanbul ignore next */ []);
|
|
542
|
+
this.linkOff = input(false, ...ngDevMode ? [{ debugName: "linkOff" }] : /* istanbul ignore next */ []);
|
|
543
|
+
this.showPaid = input(true, ...ngDevMode ? [{ debugName: "showPaid" }] : /* istanbul ignore next */ []);
|
|
509
544
|
this.returnUrl = input(void 0, ...ngDevMode ? [{ debugName: "returnUrl" }] : /* istanbul ignore next */ []);
|
|
510
545
|
this.billingDetails = input(null, ...ngDevMode ? [{ debugName: "billingDetails" }] : /* istanbul ignore next */ []);
|
|
511
546
|
this.confirmParams = input(null, ...ngDevMode ? [{ debugName: "confirmParams" }] : /* istanbul ignore next */ []);
|
|
@@ -587,10 +622,12 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
587
622
|
this.errorText = signal("", ...ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []);
|
|
588
623
|
this.loadErrorText = signal("", ...ngDevMode ? [{ debugName: "loadErrorText" }] : /* istanbul ignore next */ []);
|
|
589
624
|
this.announcement = signal("", ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
|
|
590
|
-
this.errorId = `ui-stripe-error-${nextId++}`;
|
|
625
|
+
this.errorId = `ui-stripe-error-${nextId$1++}`;
|
|
591
626
|
this.mountRef = viewChild("mount", ...ngDevMode ? [{ debugName: "mountRef" }] : /* istanbul ignore next */ []);
|
|
627
|
+
this.errorBox = viewChild("errorBox", ...ngDevMode ? [{ debugName: "errorBox" }] : /* istanbul ignore next */ []);
|
|
592
628
|
this.mountHidden = computed(() => !this.mountOnly() && (this.loading() || this.pending() || !!this.loadErrorText()), ...ngDevMode ? [{ debugName: "mountHidden" }] : /* istanbul ignore next */ []);
|
|
593
629
|
this.achNoticeVisible = computed(() => this.showAchNotice() && this.selectedType() === "us_bank_account", ...ngDevMode ? [{ debugName: "achNoticeVisible" }] : /* istanbul ignore next */ []);
|
|
630
|
+
this.achNoticeText = computed(() => this.achNoticeInput() ?? this.labels.t(this.instantOnly() ? "stripePayment.achNoticeInstant" : "stripePayment.achNotice"), ...ngDevMode ? [{ debugName: "achNoticeText" }] : /* istanbul ignore next */ []);
|
|
594
631
|
this.effectiveSubmitLabel = computed(() => this.submitLabel() || (this.mode() === "setup" ? this.labels.t("stripePayment.saveMethod") : this.labels.t("stripePayment.pay")), ...ngDevMode ? [{ debugName: "effectiveSubmitLabel" }] : /* istanbul ignore next */ []);
|
|
595
632
|
this.submitDisabled = computed(() => this.disabled() || this.loading() || this.pending() || !this.isReady() || !!this.loadErrorText() || this.protectionOn() && (this.attempt.unknown() || this.attempt.paidLocked() || !this.readiness.ready()), ...ngDevMode ? [{ debugName: "submitDisabled" }] : /* istanbul ignore next */ []);
|
|
596
633
|
this.messages = computed(() => {
|
|
@@ -625,7 +662,8 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
625
662
|
...deferred.setupFutureUsage ? { setup_future_usage: deferred.setupFutureUsage } : {},
|
|
626
663
|
...deferred.captureMethod ? { capture_method: deferred.captureMethod } : {},
|
|
627
664
|
...deferred.onBehalfOf ? { on_behalf_of: deferred.onBehalfOf } : {},
|
|
628
|
-
...this.
|
|
665
|
+
...this.deferredTypes() ? { payment_method_types: this.deferredTypes() } : {},
|
|
666
|
+
...this.instantOnly() ? { paymentMethodOptions: { us_bank_account: { verification_method: "instant" } } } : {}
|
|
629
667
|
};
|
|
630
668
|
else return null;
|
|
631
669
|
const appearance = this.appearance();
|
|
@@ -638,12 +676,23 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
638
676
|
...ngDevMode ? { debugName: "elementsConfig" } : /* istanbul ignore next */ {},
|
|
639
677
|
equal: jsonEqual
|
|
640
678
|
});
|
|
679
|
+
this.deferredTypes = computed(() => {
|
|
680
|
+
const own = this.paymentMethodTypes();
|
|
681
|
+
if (!this.linkOff()) return own;
|
|
682
|
+
return own ? own.filter((type) => type !== "link") : ["card", "us_bank_account"];
|
|
683
|
+
}, ...ngDevMode ? [{ debugName: "deferredTypes" }] : /* istanbul ignore next */ []);
|
|
641
684
|
this.elementConfig = computed(() => {
|
|
642
685
|
const options = {};
|
|
643
686
|
const layout = this.layout();
|
|
644
687
|
if (layout) options["layout"] = layout;
|
|
645
688
|
if (this.paymentMethodOrder()) options["paymentMethodOrder"] = this.paymentMethodOrder();
|
|
646
|
-
|
|
689
|
+
const wallets = this.linkOff() ? {
|
|
690
|
+
...this.wallets() ?? {},
|
|
691
|
+
applePay: "never",
|
|
692
|
+
googlePay: "never",
|
|
693
|
+
link: "never"
|
|
694
|
+
} : this.wallets();
|
|
695
|
+
if (wallets) options["wallets"] = wallets;
|
|
647
696
|
if (this.fields()) options["fields"] = this.fields();
|
|
648
697
|
if (this.business()) options["business"] = this.business();
|
|
649
698
|
if (this.terms()) options["terms"] = this.terms();
|
|
@@ -805,6 +854,13 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
805
854
|
kind: "unknown",
|
|
806
855
|
reason: "no_result"
|
|
807
856
|
};
|
|
857
|
+
if (f.code === "instant_only_unsupported") {
|
|
858
|
+
show(f);
|
|
859
|
+
return {
|
|
860
|
+
kind: "failure",
|
|
861
|
+
reason: f.code
|
|
862
|
+
};
|
|
863
|
+
}
|
|
808
864
|
if (f.code === "attempt_failed_use_new_key") {
|
|
809
865
|
show(f);
|
|
810
866
|
return {
|
|
@@ -1115,7 +1171,8 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1115
1171
|
this.attempt.fail("return");
|
|
1116
1172
|
break;
|
|
1117
1173
|
case "requires_verification":
|
|
1118
|
-
this.attempt.
|
|
1174
|
+
if (this.instantOnly()) this.attempt.fail("instant_only");
|
|
1175
|
+
else this.attempt.markUnknown("microdeposits");
|
|
1119
1176
|
break;
|
|
1120
1177
|
default: this.attempt.markUnknown("return_action");
|
|
1121
1178
|
}
|
|
@@ -1167,10 +1224,26 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1167
1224
|
}
|
|
1168
1225
|
publishFailure(f) {
|
|
1169
1226
|
if (this.destroyed) return;
|
|
1170
|
-
if (this.showErrors())
|
|
1227
|
+
if (this.showErrors()) {
|
|
1228
|
+
this.errorText.set(f.message);
|
|
1229
|
+
this.revealError(f);
|
|
1230
|
+
}
|
|
1171
1231
|
this.announcement.set("");
|
|
1172
1232
|
this.failed.emit(f);
|
|
1173
1233
|
}
|
|
1234
|
+
revealError(f) {
|
|
1235
|
+
if (this.mountOnly() || !this.isBrowser || f.stage === "load" || f.stage === "return") return;
|
|
1236
|
+
afterNextRender(() => {
|
|
1237
|
+
const box = this.errorBox()?.nativeElement;
|
|
1238
|
+
if (!box) return;
|
|
1239
|
+
const reduce = this.doc.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
1240
|
+
box.scrollIntoView?.({
|
|
1241
|
+
block: "center",
|
|
1242
|
+
behavior: reduce ? "auto" : "smooth"
|
|
1243
|
+
});
|
|
1244
|
+
box.focus({ preventScroll: true });
|
|
1245
|
+
}, { injector: this.injector });
|
|
1246
|
+
}
|
|
1174
1247
|
finish(event, fromReturn = false, trace) {
|
|
1175
1248
|
if (trace) trace.outcome = event.outcome;
|
|
1176
1249
|
const acted = {
|
|
@@ -1178,6 +1251,13 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1178
1251
|
status: event.status
|
|
1179
1252
|
};
|
|
1180
1253
|
const setupProtected = event.kind === "setup" && this.protectionOn();
|
|
1254
|
+
if (event.outcome === "requires_verification" && this.instantOnly()) {
|
|
1255
|
+
this.fail({
|
|
1256
|
+
...failure(INSTANT_ONLY_CODE, this.labels.t("stripePayment.msg.instantOnlyUnavailable"), fromReturn ? "return" : "result"),
|
|
1257
|
+
...acted
|
|
1258
|
+
}, trace);
|
|
1259
|
+
return null;
|
|
1260
|
+
}
|
|
1181
1261
|
if (event.outcome === "requires_payment_method") {
|
|
1182
1262
|
this.fail({
|
|
1183
1263
|
...failure("requires_payment_method", setupProtected ? this.labels.t("paymentSetup.requiresPaymentMethod") : MSG_REQUIRES_PAYMENT_METHOD, fromReturn ? "return" : "result"),
|
|
@@ -1353,7 +1433,7 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1353
1433
|
});
|
|
1354
1434
|
element.on("loaderror", (event) => {
|
|
1355
1435
|
if (generation !== this.generation) return;
|
|
1356
|
-
const message = event?.error?.message || localizeStripeMessage("Failed to load
|
|
1436
|
+
const message = event?.error?.message || localizeStripeMessage("Failed to load the payment service");
|
|
1357
1437
|
this.loadFailed(message, event?.error?.message ?? "");
|
|
1358
1438
|
});
|
|
1359
1439
|
element.mount(container);
|
|
@@ -1557,6 +1637,27 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1557
1637
|
isRequired: false,
|
|
1558
1638
|
transformFunction: null
|
|
1559
1639
|
},
|
|
1640
|
+
instantOnly: {
|
|
1641
|
+
classPropertyName: "instantOnly",
|
|
1642
|
+
publicName: "instantOnly",
|
|
1643
|
+
isSignal: true,
|
|
1644
|
+
isRequired: false,
|
|
1645
|
+
transformFunction: null
|
|
1646
|
+
},
|
|
1647
|
+
linkOff: {
|
|
1648
|
+
classPropertyName: "linkOff",
|
|
1649
|
+
publicName: "linkOff",
|
|
1650
|
+
isSignal: true,
|
|
1651
|
+
isRequired: false,
|
|
1652
|
+
transformFunction: null
|
|
1653
|
+
},
|
|
1654
|
+
showPaid: {
|
|
1655
|
+
classPropertyName: "showPaid",
|
|
1656
|
+
publicName: "showPaid",
|
|
1657
|
+
isSignal: true,
|
|
1658
|
+
isRequired: false,
|
|
1659
|
+
transformFunction: null
|
|
1660
|
+
},
|
|
1560
1661
|
returnUrl: {
|
|
1561
1662
|
classPropertyName: "returnUrl",
|
|
1562
1663
|
publicName: "returnUrl",
|
|
@@ -1922,6 +2023,12 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1922
2023
|
predicate: ["mount"],
|
|
1923
2024
|
descendants: true,
|
|
1924
2025
|
isSignal: true
|
|
2026
|
+
}, {
|
|
2027
|
+
propertyName: "errorBox",
|
|
2028
|
+
first: true,
|
|
2029
|
+
predicate: ["errorBox"],
|
|
2030
|
+
descendants: true,
|
|
2031
|
+
isSignal: true
|
|
1925
2032
|
}],
|
|
1926
2033
|
ngImport: i0,
|
|
1927
2034
|
template: `
|
|
@@ -1930,7 +2037,7 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1930
2037
|
<div class="sp-sr" role="status" aria-live="polite" data-testid="stripe-status">{{ statusText() }}</div>
|
|
1931
2038
|
}
|
|
1932
2039
|
@if (!mountOnly() && protectionOn()) {
|
|
1933
|
-
<ui-payment-attempt-status [attempt]="attempt" [readiness]="readiness" [kind]="mode()" [allowStartOver]="allowStartOver()" (retryLoad)="reload()" />
|
|
2040
|
+
<ui-payment-attempt-status [attempt]="attempt" [readiness]="readiness" [kind]="mode()" [allowStartOver]="allowStartOver()" [showPaid]="showPaid()" (retryLoad)="reload()" />
|
|
1934
2041
|
}
|
|
1935
2042
|
@if (!mountOnly() && (loading() || pending())) {
|
|
1936
2043
|
<div class="sp-skeleton" data-testid="stripe-skeleton" aria-hidden="true">
|
|
@@ -1948,10 +2055,10 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1948
2055
|
<div #mount class="sp-mount" [attr.id]="mountId() || null" [class]="mountClass()" [class.sp-mount--hidden]="mountHidden()" [attr.aria-hidden]="mountHidden() ? 'true' : null" [attr.inert]="mountHidden() ? '' : null"
|
|
1949
2056
|
[attr.role]="mountOnly() ? null : 'group'" [attr.aria-label]="mountOnly() ? null : label()" data-testid="stripe-mount"></div>
|
|
1950
2057
|
@if (!mountOnly() && achNoticeVisible()) {
|
|
1951
|
-
<div class="sp-block" [attr.data-testid]="achNoticeTestId()"><ui-alert variant="info">{{
|
|
2058
|
+
<div class="sp-block" [attr.data-testid]="achNoticeTestId()"><ui-alert variant="info">{{ achNoticeText() }}</ui-alert></div>
|
|
1952
2059
|
}
|
|
1953
2060
|
@if (!mountOnly() && errorText(); as text) {
|
|
1954
|
-
<div class="sp-block" [id]="errorId" data-testid="stripe-error"><ui-alert variant="danger">{{ text }}</ui-alert></div>
|
|
2061
|
+
<div #errorBox class="sp-block sp-error" [id]="errorId" tabindex="-1" data-testid="stripe-error"><ui-alert variant="danger">{{ text }}</ui-alert></div>
|
|
1955
2062
|
}
|
|
1956
2063
|
@if (!mountOnly() && showSubmit()) {
|
|
1957
2064
|
<div class="sp-actions">
|
|
@@ -1962,7 +2069,7 @@ var StripePaymentComponent = class StripePaymentComponent {
|
|
|
1962
2069
|
</div>
|
|
1963
2070
|
`,
|
|
1964
2071
|
isInline: true,
|
|
1965
|
-
styles: ["ui-stripe-payment{display:block;min-width:0}ui-stripe-payment .sp-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sp-block{margin-top:12px}.sp-label{font-size:.875rem;font-weight:500;color:#1e293b;margin-bottom:6px}.sp-required{color:#dc2626;margin-left:2px}.sp-actions{margin-top:16px;display:flex;justify-content:flex-end}ui-stripe-payment .sp{position:relative}.sp-mount--hidden{position:absolute;top:0;left:0;right:0;opacity:0;pointer-events:none}@media(max-width:480px){.sp-actions{display:block}.sp-actions ui-button{display:flex}ui-stripe-payment .sp-actions .btn{width:100%}}\n"],
|
|
2072
|
+
styles: ["ui-stripe-payment{display:block;min-width:0}ui-stripe-payment .sp-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sp-block{margin-top:12px}.sp-error{outline:none;scroll-margin-top:16px;scroll-margin-bottom:80px}.sp-label{font-size:.875rem;font-weight:500;color:#1e293b;margin-bottom:6px}.sp-required{color:#dc2626;margin-left:2px}.sp-actions{margin-top:16px;display:flex;justify-content:flex-end}ui-stripe-payment .sp{position:relative}.sp-mount--hidden{position:absolute;top:0;left:0;right:0;opacity:0;pointer-events:none}@media(max-width:480px){.sp-actions{display:block}.sp-actions ui-button{display:flex}ui-stripe-payment .sp-actions .btn{width:100%}}\n"],
|
|
1966
2073
|
dependencies: [
|
|
1967
2074
|
{
|
|
1968
2075
|
kind: "component",
|
|
@@ -2066,7 +2173,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2066
2173
|
<div class="sp-sr" role="status" aria-live="polite" data-testid="stripe-status">{{ statusText() }}</div>
|
|
2067
2174
|
}
|
|
2068
2175
|
@if (!mountOnly() && protectionOn()) {
|
|
2069
|
-
<ui-payment-attempt-status [attempt]="attempt" [readiness]="readiness" [kind]="mode()" [allowStartOver]="allowStartOver()" (retryLoad)="reload()" />
|
|
2176
|
+
<ui-payment-attempt-status [attempt]="attempt" [readiness]="readiness" [kind]="mode()" [allowStartOver]="allowStartOver()" [showPaid]="showPaid()" (retryLoad)="reload()" />
|
|
2070
2177
|
}
|
|
2071
2178
|
@if (!mountOnly() && (loading() || pending())) {
|
|
2072
2179
|
<div class="sp-skeleton" data-testid="stripe-skeleton" aria-hidden="true">
|
|
@@ -2084,10 +2191,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2084
2191
|
<div #mount class="sp-mount" [attr.id]="mountId() || null" [class]="mountClass()" [class.sp-mount--hidden]="mountHidden()" [attr.aria-hidden]="mountHidden() ? 'true' : null" [attr.inert]="mountHidden() ? '' : null"
|
|
2085
2192
|
[attr.role]="mountOnly() ? null : 'group'" [attr.aria-label]="mountOnly() ? null : label()" data-testid="stripe-mount"></div>
|
|
2086
2193
|
@if (!mountOnly() && achNoticeVisible()) {
|
|
2087
|
-
<div class="sp-block" [attr.data-testid]="achNoticeTestId()"><ui-alert variant="info">{{
|
|
2194
|
+
<div class="sp-block" [attr.data-testid]="achNoticeTestId()"><ui-alert variant="info">{{ achNoticeText() }}</ui-alert></div>
|
|
2088
2195
|
}
|
|
2089
2196
|
@if (!mountOnly() && errorText(); as text) {
|
|
2090
|
-
<div class="sp-block" [id]="errorId" data-testid="stripe-error"><ui-alert variant="danger">{{ text }}</ui-alert></div>
|
|
2197
|
+
<div #errorBox class="sp-block sp-error" [id]="errorId" tabindex="-1" data-testid="stripe-error"><ui-alert variant="danger">{{ text }}</ui-alert></div>
|
|
2091
2198
|
}
|
|
2092
2199
|
@if (!mountOnly() && showSubmit()) {
|
|
2093
2200
|
<div class="sp-actions">
|
|
@@ -2097,7 +2204,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2097
2204
|
}
|
|
2098
2205
|
</div>
|
|
2099
2206
|
`,
|
|
2100
|
-
styles: ["ui-stripe-payment{display:block;min-width:0}ui-stripe-payment .sp-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sp-block{margin-top:12px}.sp-label{font-size:.875rem;font-weight:500;color:#1e293b;margin-bottom:6px}.sp-required{color:#dc2626;margin-left:2px}.sp-actions{margin-top:16px;display:flex;justify-content:flex-end}ui-stripe-payment .sp{position:relative}.sp-mount--hidden{position:absolute;top:0;left:0;right:0;opacity:0;pointer-events:none}@media(max-width:480px){.sp-actions{display:block}.sp-actions ui-button{display:flex}ui-stripe-payment .sp-actions .btn{width:100%}}\n"]
|
|
2207
|
+
styles: ["ui-stripe-payment{display:block;min-width:0}ui-stripe-payment .sp-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sp-block{margin-top:12px}.sp-error{outline:none;scroll-margin-top:16px;scroll-margin-bottom:80px}.sp-label{font-size:.875rem;font-weight:500;color:#1e293b;margin-bottom:6px}.sp-required{color:#dc2626;margin-left:2px}.sp-actions{margin-top:16px;display:flex;justify-content:flex-end}ui-stripe-payment .sp{position:relative}.sp-mount--hidden{position:absolute;top:0;left:0;right:0;opacity:0;pointer-events:none}@media(max-width:480px){.sp-actions{display:block}.sp-actions ui-button{display:flex}ui-stripe-payment .sp-actions .btn{width:100%}}\n"]
|
|
2101
2208
|
}]
|
|
2102
2209
|
}],
|
|
2103
2210
|
ctorParameters: () => [],
|
|
@@ -2270,6 +2377,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2270
2377
|
required: false
|
|
2271
2378
|
}]
|
|
2272
2379
|
}],
|
|
2380
|
+
instantOnly: [{
|
|
2381
|
+
type: i0.Input,
|
|
2382
|
+
args: [{
|
|
2383
|
+
isSignal: true,
|
|
2384
|
+
alias: "instantOnly",
|
|
2385
|
+
required: false
|
|
2386
|
+
}]
|
|
2387
|
+
}],
|
|
2388
|
+
linkOff: [{
|
|
2389
|
+
type: i0.Input,
|
|
2390
|
+
args: [{
|
|
2391
|
+
isSignal: true,
|
|
2392
|
+
alias: "linkOff",
|
|
2393
|
+
required: false
|
|
2394
|
+
}]
|
|
2395
|
+
}],
|
|
2396
|
+
showPaid: [{
|
|
2397
|
+
type: i0.Input,
|
|
2398
|
+
args: [{
|
|
2399
|
+
isSignal: true,
|
|
2400
|
+
alias: "showPaid",
|
|
2401
|
+
required: false
|
|
2402
|
+
}]
|
|
2403
|
+
}],
|
|
2273
2404
|
returnUrl: [{
|
|
2274
2405
|
type: i0.Input,
|
|
2275
2406
|
args: [{
|
|
@@ -2713,6 +2844,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2713
2844
|
mountRef: [{
|
|
2714
2845
|
type: i0.ViewChild,
|
|
2715
2846
|
args: ["mount", { isSignal: true }]
|
|
2847
|
+
}],
|
|
2848
|
+
errorBox: [{
|
|
2849
|
+
type: i0.ViewChild,
|
|
2850
|
+
args: ["errorBox", { isSignal: true }]
|
|
2716
2851
|
}]
|
|
2717
2852
|
}
|
|
2718
2853
|
});
|
|
@@ -2815,6 +2950,7 @@ function microdepositCancelMessage(options = {}) {
|
|
|
2815
2950
|
if (partner) return `${MICRODEPOSIT_COPY.cancelBase} ${options.hasSavedMethod ? uiText("stripeMicrodepositVerify.cancelKeepsActivePartner", { partner }) : uiText("stripeMicrodepositVerify.cancelNoOtherPartner", { partner })}`;
|
|
2816
2951
|
return MICRODEPOSIT_COPY.cancelBase + (options.hasSavedMethod ? MICRODEPOSIT_COPY.cancelKeepsActive : MICRODEPOSIT_COPY.cancelNoOther);
|
|
2817
2952
|
}
|
|
2953
|
+
let nextId = 0;
|
|
2818
2954
|
var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
2819
2955
|
constructor() {
|
|
2820
2956
|
this.labels = inject(UiLabelsService);
|
|
@@ -2829,7 +2965,11 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
2829
2965
|
this.title = input("", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
2830
2966
|
this.stepsText = input("", ...ngDevMode ? [{ debugName: "stepsText" }] : /* istanbul ignore next */ []);
|
|
2831
2967
|
this.readOnlyText = input(MICRODEPOSIT_COPY.readOnly, ...ngDevMode ? [{ debugName: "readOnlyText" }] : /* istanbul ignore next */ []);
|
|
2968
|
+
this.showHostedLink = input(false, ...ngDevMode ? [{ debugName: "showHostedLink" }] : /* istanbul ignore next */ []);
|
|
2832
2969
|
this.hideHostedLink = input(false, ...ngDevMode ? [{ debugName: "hideHostedLink" }] : /* istanbul ignore next */ []);
|
|
2970
|
+
this.attemptsRemaining = input(null, ...ngDevMode ? [{ debugName: "attemptsRemaining" }] : /* istanbul ignore next */ []);
|
|
2971
|
+
this.attemptsRemainingText = input("", ...ngDevMode ? [{ debugName: "attemptsRemainingText" }] : /* istanbul ignore next */ []);
|
|
2972
|
+
this.hint = input("", ...ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []);
|
|
2833
2973
|
this.cancelLabel = input("", ...ngDevMode ? [{ debugName: "cancelLabel" }] : /* istanbul ignore next */ []);
|
|
2834
2974
|
this.verifyLabel = input("", ...ngDevMode ? [{ debugName: "verifyLabel" }] : /* istanbul ignore next */ []);
|
|
2835
2975
|
this.keepsActiveText = input("", ...ngDevMode ? [{ debugName: "keepsActiveText" }] : /* istanbul ignore next */ []);
|
|
@@ -2850,6 +2990,13 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
2850
2990
|
this.verified = output();
|
|
2851
2991
|
this.verifyFailed = output();
|
|
2852
2992
|
this.copy = MICRODEPOSIT_COPY;
|
|
2993
|
+
this.hintText = computed(() => this.hint().trim(), ...ngDevMode ? [{ debugName: "hintText" }] : /* istanbul ignore next */ []);
|
|
2994
|
+
this.errorId = `ui-mdv-error-${nextId}`;
|
|
2995
|
+
this.amountsHintId = `ui-mdv-hint-${nextId++}`;
|
|
2996
|
+
this.describedBy = computed(() => [this.shownError() ? this.errorId : "", this.amountsHintId].filter(Boolean).join(" "), ...ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []);
|
|
2997
|
+
this.codeField = viewChild("codeField", ...ngDevMode ? [{ debugName: "codeField" }] : /* istanbul ignore next */ []);
|
|
2998
|
+
this.firstField = viewChild("firstField", ...ngDevMode ? [{ debugName: "firstField" }] : /* istanbul ignore next */ []);
|
|
2999
|
+
this.secondField = viewChild("secondField", ...ngDevMode ? [{ debugName: "secondField" }] : /* istanbul ignore next */ []);
|
|
2853
3000
|
this.first = signal("", ...ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []);
|
|
2854
3001
|
this.second = signal("", ...ngDevMode ? [{ debugName: "second" }] : /* istanbul ignore next */ []);
|
|
2855
3002
|
this.code = signal("", ...ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []);
|
|
@@ -2869,6 +3016,13 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
2869
3016
|
}, ...ngDevMode ? [{ debugName: "bankLine" }] : /* istanbul ignore next */ []);
|
|
2870
3017
|
this.busy = computed(() => this.verifying() || this.stripeBusy(), ...ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []);
|
|
2871
3018
|
this.shownError = computed(() => this.stripeError() || this.errorText(), ...ngDevMode ? [{ debugName: "shownError" }] : /* istanbul ignore next */ []);
|
|
3019
|
+
this.attemptsText = computed(() => {
|
|
3020
|
+
const own = this.attemptsRemainingText().trim();
|
|
3021
|
+
if (own) return own;
|
|
3022
|
+
const left = this.attemptsRemaining();
|
|
3023
|
+
if (left === null || !Number.isFinite(left) || left < 0) return "";
|
|
3024
|
+
return this.labels.t(left === 1 ? "stripeMicrodepositVerify.attemptsLeft_one" : "stripeMicrodepositVerify.attemptsLeft_other", { count: left });
|
|
3025
|
+
}, ...ngDevMode ? [{ debugName: "attemptsText" }] : /* istanbul ignore next */ []);
|
|
2872
3026
|
this.isProcessing = computed(() => this.type() === "processing", ...ngDevMode ? [{ debugName: "isProcessing" }] : /* istanbul ignore next */ []);
|
|
2873
3027
|
this.safeUrl = computed(() => safeHostedUrl(this.hostedVerificationUrl()), ...ngDevMode ? [{ debugName: "safeUrl" }] : /* istanbul ignore next */ []);
|
|
2874
3028
|
this.defaultSteps = computed(() => microdepositStepsText({
|
|
@@ -2881,11 +3035,42 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
2881
3035
|
this.codeError = computed(() => this.code().trim() ? descriptorCodeError(this.code(), this.requireSmPrefix()) : this.copy.codeRequired, ...ngDevMode ? [{ debugName: "codeError" }] : /* istanbul ignore next */ []);
|
|
2882
3036
|
this.hasInvalid = computed(() => this.type() === "descriptor_code" ? !!this.codeError() : !!depositAmountError(this.first()) || !!depositAmountError(this.second()) || this.first() === "" || this.second() === "" || this.first() === null || this.second() === null, ...ngDevMode ? [{ debugName: "hasInvalid" }] : /* istanbul ignore next */ []);
|
|
2883
3037
|
this.cancelMessage = computed(() => this.cancelMessageText() || this.copy.cancelBase + (this.hasSavedMethod() ? this.copy.cancelKeepsActive : this.copy.cancelNoOther), ...ngDevMode ? [{ debugName: "cancelMessage" }] : /* istanbul ignore next */ []);
|
|
3038
|
+
effect(() => {
|
|
3039
|
+
this.clientSecret();
|
|
3040
|
+
this.type();
|
|
3041
|
+
untracked(() => {
|
|
3042
|
+
this.first.set("");
|
|
3043
|
+
this.second.set("");
|
|
3044
|
+
this.code.set("");
|
|
3045
|
+
this.touched.set(false);
|
|
3046
|
+
this.stripeError.set("");
|
|
3047
|
+
this.failedAttempts = 0;
|
|
3048
|
+
});
|
|
3049
|
+
});
|
|
3050
|
+
effect(() => {
|
|
3051
|
+
const text = this.errorText();
|
|
3052
|
+
untracked(() => {
|
|
3053
|
+
if (text && this.touched()) this.focusFirstField();
|
|
3054
|
+
});
|
|
3055
|
+
});
|
|
3056
|
+
}
|
|
3057
|
+
focusFirstField(invalidOnly = false) {
|
|
3058
|
+
if (this.type() === "descriptor_code") {
|
|
3059
|
+
this.codeField()?.focus();
|
|
3060
|
+
return;
|
|
3061
|
+
}
|
|
3062
|
+
const firstBad = !!depositAmountError(this.first()) || this.first() === "" || this.first() === null;
|
|
3063
|
+
const secondBad = !!depositAmountError(this.second()) || this.second() === "" || this.second() === null;
|
|
3064
|
+
if (invalidOnly && !firstBad && secondBad) this.secondField()?.focus();
|
|
3065
|
+
else this.firstField()?.focus();
|
|
2884
3066
|
}
|
|
2885
3067
|
async verify() {
|
|
2886
3068
|
if (this.busy()) return;
|
|
2887
3069
|
this.touched.set(true);
|
|
2888
|
-
if (this.hasInvalid())
|
|
3070
|
+
if (this.hasInvalid()) {
|
|
3071
|
+
this.focusFirstField(true);
|
|
3072
|
+
return;
|
|
3073
|
+
}
|
|
2889
3074
|
const secret = this.clientSecret();
|
|
2890
3075
|
if (!secret) {
|
|
2891
3076
|
this.verify$.emit(this.type() === "descriptor_code" ? { descriptorCode: normalizeDescriptorCode(this.code()) } : { amounts: [Number(this.first()), Number(this.second())] });
|
|
@@ -2894,6 +3079,7 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
2894
3079
|
const max = this.maxAttempts();
|
|
2895
3080
|
if (max > 0 && this.failedAttempts >= max) {
|
|
2896
3081
|
this.stripeError.set(this.copy.tooManyAttempts);
|
|
3082
|
+
this.focusFirstField();
|
|
2897
3083
|
return;
|
|
2898
3084
|
}
|
|
2899
3085
|
this.stripeBusy.set(true);
|
|
@@ -2917,6 +3103,7 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
2917
3103
|
count: remaining
|
|
2918
3104
|
}) : message);
|
|
2919
3105
|
this.verifyFailed.emit(result);
|
|
3106
|
+
this.focusFirstField();
|
|
2920
3107
|
}
|
|
2921
3108
|
confirmCancel() {
|
|
2922
3109
|
if (this.cancelling()) return;
|
|
@@ -3011,6 +3198,13 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
3011
3198
|
isRequired: false,
|
|
3012
3199
|
transformFunction: null
|
|
3013
3200
|
},
|
|
3201
|
+
showHostedLink: {
|
|
3202
|
+
classPropertyName: "showHostedLink",
|
|
3203
|
+
publicName: "showHostedLink",
|
|
3204
|
+
isSignal: true,
|
|
3205
|
+
isRequired: false,
|
|
3206
|
+
transformFunction: null
|
|
3207
|
+
},
|
|
3014
3208
|
hideHostedLink: {
|
|
3015
3209
|
classPropertyName: "hideHostedLink",
|
|
3016
3210
|
publicName: "hideHostedLink",
|
|
@@ -3018,6 +3212,27 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
3018
3212
|
isRequired: false,
|
|
3019
3213
|
transformFunction: null
|
|
3020
3214
|
},
|
|
3215
|
+
attemptsRemaining: {
|
|
3216
|
+
classPropertyName: "attemptsRemaining",
|
|
3217
|
+
publicName: "attemptsRemaining",
|
|
3218
|
+
isSignal: true,
|
|
3219
|
+
isRequired: false,
|
|
3220
|
+
transformFunction: null
|
|
3221
|
+
},
|
|
3222
|
+
attemptsRemainingText: {
|
|
3223
|
+
classPropertyName: "attemptsRemainingText",
|
|
3224
|
+
publicName: "attemptsRemainingText",
|
|
3225
|
+
isSignal: true,
|
|
3226
|
+
isRequired: false,
|
|
3227
|
+
transformFunction: null
|
|
3228
|
+
},
|
|
3229
|
+
hint: {
|
|
3230
|
+
classPropertyName: "hint",
|
|
3231
|
+
publicName: "hint",
|
|
3232
|
+
isSignal: true,
|
|
3233
|
+
isRequired: false,
|
|
3234
|
+
transformFunction: null
|
|
3235
|
+
},
|
|
3021
3236
|
cancelLabel: {
|
|
3022
3237
|
classPropertyName: "cancelLabel",
|
|
3023
3238
|
publicName: "cancelLabel",
|
|
@@ -3130,6 +3345,29 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
3130
3345
|
verified: "verified",
|
|
3131
3346
|
verifyFailed: "verifyFailed"
|
|
3132
3347
|
},
|
|
3348
|
+
viewQueries: [
|
|
3349
|
+
{
|
|
3350
|
+
propertyName: "codeField",
|
|
3351
|
+
first: true,
|
|
3352
|
+
predicate: ["codeField"],
|
|
3353
|
+
descendants: true,
|
|
3354
|
+
isSignal: true
|
|
3355
|
+
},
|
|
3356
|
+
{
|
|
3357
|
+
propertyName: "firstField",
|
|
3358
|
+
first: true,
|
|
3359
|
+
predicate: ["firstField"],
|
|
3360
|
+
descendants: true,
|
|
3361
|
+
isSignal: true
|
|
3362
|
+
},
|
|
3363
|
+
{
|
|
3364
|
+
propertyName: "secondField",
|
|
3365
|
+
first: true,
|
|
3366
|
+
predicate: ["secondField"],
|
|
3367
|
+
descendants: true,
|
|
3368
|
+
isSignal: true
|
|
3369
|
+
}
|
|
3370
|
+
],
|
|
3133
3371
|
ngImport: i0,
|
|
3134
3372
|
template: `
|
|
3135
3373
|
<div data-testid="bank-pending-card">
|
|
@@ -3152,26 +3390,30 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
3152
3390
|
@if (hasSavedMethod()) {
|
|
3153
3391
|
<ui-text size="sm" tone="muted" [text]="keepsActiveText() || copy.keepsActive" data-testid="bank-pending-keeps-active" />
|
|
3154
3392
|
}
|
|
3155
|
-
<!--
|
|
3156
|
-
@if (!formHidden() && !hideHostedLink() && safeUrl(); as url) {
|
|
3393
|
+
<!-- The hosted page is the processor's own UI: only with the explicit showHostedLink input (own-UI policy), and never to a read-only user (finishing it saves the payment method, a write) -->
|
|
3394
|
+
@if (!formHidden() && showHostedLink() && !hideHostedLink() && safeUrl(); as url) {
|
|
3157
3395
|
<div><ui-button variant="link" size="sm" [href]="url" target="_blank" data-testid="bank-hosted-link">{{ labels.t('stripeMicrodepositVerify.openStripeSVerificationPage') }}</ui-button></div>
|
|
3158
3396
|
}
|
|
3159
3397
|
</ui-alert>
|
|
3160
3398
|
|
|
3161
3399
|
@if (!formHidden() && !isProcessing()) {
|
|
3162
3400
|
@if (type() === 'descriptor_code') {
|
|
3163
|
-
<ui-text-input [label]="labels.t('stripeMicrodepositVerify.verificationCode')" [hint]="labels.t('stripeMicrodepositVerify.6LettersOrNumbersFrom')" [maxlength]="6" [required]="true" [showErrors]="touched()"
|
|
3164
|
-
[error]="touched() ? codeError() : ''" data-testid="bank-code-input" [ngModel]="code()" (ngModelChange)="code.set($event)" />
|
|
3401
|
+
<ui-text-input #codeField [label]="labels.t('stripeMicrodepositVerify.verificationCode')" [hint]="hintText() || labels.t('stripeMicrodepositVerify.6LettersOrNumbersFrom')" [maxlength]="6" [required]="true" [showErrors]="touched()"
|
|
3402
|
+
[error]="touched() ? codeError() : ''" [ariaInvalid]="!!shownError()" [ariaDescribedBy]="shownError() ? errorId : ''" data-testid="bank-code-input" [ngModel]="code()" (ngModelChange)="code.set($event)" />
|
|
3165
3403
|
} @else {
|
|
3166
3404
|
<ui-form-row data-testid="bank-amounts-row">
|
|
3167
|
-
<ui-text-input [label]="labels.t('stripeMicrodepositVerify.firstDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3168
|
-
[error]="touched() ? amountError(first()) : ''" data-testid="bank-amount-first" [ngModel]="first()" (ngModelChange)="first.set($event)" />
|
|
3169
|
-
<ui-text-input [label]="labels.t('stripeMicrodepositVerify.secondDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3170
|
-
[error]="touched() ? amountError(second()) : ''" data-testid="bank-amount-second" [ngModel]="second()" (ngModelChange)="second.set($event)" />
|
|
3405
|
+
<ui-text-input #firstField [label]="labels.t('stripeMicrodepositVerify.firstDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3406
|
+
[ariaInvalid]="!!shownError()" [ariaDescribedBy]="describedBy()" [error]="touched() ? amountError(first()) : ''" data-testid="bank-amount-first" [ngModel]="first()" (ngModelChange)="first.set($event)" />
|
|
3407
|
+
<ui-text-input #secondField [label]="labels.t('stripeMicrodepositVerify.secondDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3408
|
+
[ariaInvalid]="!!shownError()" [ariaDescribedBy]="describedBy()" [error]="touched() ? amountError(second()) : ''" data-testid="bank-amount-second" [ngModel]="second()" (ngModelChange)="second.set($event)" />
|
|
3171
3409
|
</ui-form-row>
|
|
3410
|
+
<ui-text size="sm" tone="muted" [id]="amountsHintId" data-testid="bank-amounts-hint" [text]="hintText() || labels.t('stripeMicrodepositVerify.amountsHint')" />
|
|
3172
3411
|
}
|
|
3173
3412
|
@if (shownError(); as text) {
|
|
3174
|
-
<ui-alert variant="danger" data-testid="bank-verify-error">{{ text }}</ui-alert>
|
|
3413
|
+
<ui-alert variant="danger" [id]="errorId" data-testid="bank-verify-error">{{ text }}</ui-alert>
|
|
3414
|
+
}
|
|
3415
|
+
@if (attemptsText(); as text) {
|
|
3416
|
+
<ui-text size="sm" tone="muted" role="status" data-testid="bank-attempts-remaining" [text]="text" />
|
|
3175
3417
|
}
|
|
3176
3418
|
<ui-button variant="primary" size="sm" data-testid="bank-verify-button" [loading]="busy()" [disabled]="busy() || cancelling()" (click)="verify()">{{ verifyLabel() || copy.verifyLabel }}</ui-button>
|
|
3177
3419
|
}
|
|
@@ -3350,6 +3592,7 @@ var MicrodepositVerifyComponent = class MicrodepositVerifyComponent {
|
|
|
3350
3592
|
"readonly",
|
|
3351
3593
|
"hint",
|
|
3352
3594
|
"ariaDescribedBy",
|
|
3595
|
+
"ariaInvalid",
|
|
3353
3596
|
"error",
|
|
3354
3597
|
"phoneFormat",
|
|
3355
3598
|
"min",
|
|
@@ -3417,26 +3660,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3417
3660
|
@if (hasSavedMethod()) {
|
|
3418
3661
|
<ui-text size="sm" tone="muted" [text]="keepsActiveText() || copy.keepsActive" data-testid="bank-pending-keeps-active" />
|
|
3419
3662
|
}
|
|
3420
|
-
<!--
|
|
3421
|
-
@if (!formHidden() && !hideHostedLink() && safeUrl(); as url) {
|
|
3663
|
+
<!-- The hosted page is the processor's own UI: only with the explicit showHostedLink input (own-UI policy), and never to a read-only user (finishing it saves the payment method, a write) -->
|
|
3664
|
+
@if (!formHidden() && showHostedLink() && !hideHostedLink() && safeUrl(); as url) {
|
|
3422
3665
|
<div><ui-button variant="link" size="sm" [href]="url" target="_blank" data-testid="bank-hosted-link">{{ labels.t('stripeMicrodepositVerify.openStripeSVerificationPage') }}</ui-button></div>
|
|
3423
3666
|
}
|
|
3424
3667
|
</ui-alert>
|
|
3425
3668
|
|
|
3426
3669
|
@if (!formHidden() && !isProcessing()) {
|
|
3427
3670
|
@if (type() === 'descriptor_code') {
|
|
3428
|
-
<ui-text-input [label]="labels.t('stripeMicrodepositVerify.verificationCode')" [hint]="labels.t('stripeMicrodepositVerify.6LettersOrNumbersFrom')" [maxlength]="6" [required]="true" [showErrors]="touched()"
|
|
3429
|
-
[error]="touched() ? codeError() : ''" data-testid="bank-code-input" [ngModel]="code()" (ngModelChange)="code.set($event)" />
|
|
3671
|
+
<ui-text-input #codeField [label]="labels.t('stripeMicrodepositVerify.verificationCode')" [hint]="hintText() || labels.t('stripeMicrodepositVerify.6LettersOrNumbersFrom')" [maxlength]="6" [required]="true" [showErrors]="touched()"
|
|
3672
|
+
[error]="touched() ? codeError() : ''" [ariaInvalid]="!!shownError()" [ariaDescribedBy]="shownError() ? errorId : ''" data-testid="bank-code-input" [ngModel]="code()" (ngModelChange)="code.set($event)" />
|
|
3430
3673
|
} @else {
|
|
3431
3674
|
<ui-form-row data-testid="bank-amounts-row">
|
|
3432
|
-
<ui-text-input [label]="labels.t('stripeMicrodepositVerify.firstDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3433
|
-
[error]="touched() ? amountError(first()) : ''" data-testid="bank-amount-first" [ngModel]="first()" (ngModelChange)="first.set($event)" />
|
|
3434
|
-
<ui-text-input [label]="labels.t('stripeMicrodepositVerify.secondDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3435
|
-
[error]="touched() ? amountError(second()) : ''" data-testid="bank-amount-second" [ngModel]="second()" (ngModelChange)="second.set($event)" />
|
|
3675
|
+
<ui-text-input #firstField [label]="labels.t('stripeMicrodepositVerify.firstDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3676
|
+
[ariaInvalid]="!!shownError()" [ariaDescribedBy]="describedBy()" [error]="touched() ? amountError(first()) : ''" data-testid="bank-amount-first" [ngModel]="first()" (ngModelChange)="first.set($event)" />
|
|
3677
|
+
<ui-text-input #secondField [label]="labels.t('stripeMicrodepositVerify.secondDepositCents')" type="number" [min]="1" [max]="99" [maxDecimals]="0" [required]="true" [showErrors]="touched()"
|
|
3678
|
+
[ariaInvalid]="!!shownError()" [ariaDescribedBy]="describedBy()" [error]="touched() ? amountError(second()) : ''" data-testid="bank-amount-second" [ngModel]="second()" (ngModelChange)="second.set($event)" />
|
|
3436
3679
|
</ui-form-row>
|
|
3680
|
+
<ui-text size="sm" tone="muted" [id]="amountsHintId" data-testid="bank-amounts-hint" [text]="hintText() || labels.t('stripeMicrodepositVerify.amountsHint')" />
|
|
3437
3681
|
}
|
|
3438
3682
|
@if (shownError(); as text) {
|
|
3439
|
-
<ui-alert variant="danger" data-testid="bank-verify-error">{{ text }}</ui-alert>
|
|
3683
|
+
<ui-alert variant="danger" [id]="errorId" data-testid="bank-verify-error">{{ text }}</ui-alert>
|
|
3684
|
+
}
|
|
3685
|
+
@if (attemptsText(); as text) {
|
|
3686
|
+
<ui-text size="sm" tone="muted" role="status" data-testid="bank-attempts-remaining" [text]="text" />
|
|
3440
3687
|
}
|
|
3441
3688
|
<ui-button variant="primary" size="sm" data-testid="bank-verify-button" [loading]="busy()" [disabled]="busy() || cancelling()" (click)="verify()">{{ verifyLabel() || copy.verifyLabel }}</ui-button>
|
|
3442
3689
|
}
|
|
@@ -3455,6 +3702,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3455
3702
|
`
|
|
3456
3703
|
}]
|
|
3457
3704
|
}],
|
|
3705
|
+
ctorParameters: () => [],
|
|
3458
3706
|
propDecorators: {
|
|
3459
3707
|
type: [{
|
|
3460
3708
|
type: i0.Input,
|
|
@@ -3536,6 +3784,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3536
3784
|
required: false
|
|
3537
3785
|
}]
|
|
3538
3786
|
}],
|
|
3787
|
+
showHostedLink: [{
|
|
3788
|
+
type: i0.Input,
|
|
3789
|
+
args: [{
|
|
3790
|
+
isSignal: true,
|
|
3791
|
+
alias: "showHostedLink",
|
|
3792
|
+
required: false
|
|
3793
|
+
}]
|
|
3794
|
+
}],
|
|
3539
3795
|
hideHostedLink: [{
|
|
3540
3796
|
type: i0.Input,
|
|
3541
3797
|
args: [{
|
|
@@ -3544,6 +3800,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3544
3800
|
required: false
|
|
3545
3801
|
}]
|
|
3546
3802
|
}],
|
|
3803
|
+
attemptsRemaining: [{
|
|
3804
|
+
type: i0.Input,
|
|
3805
|
+
args: [{
|
|
3806
|
+
isSignal: true,
|
|
3807
|
+
alias: "attemptsRemaining",
|
|
3808
|
+
required: false
|
|
3809
|
+
}]
|
|
3810
|
+
}],
|
|
3811
|
+
attemptsRemainingText: [{
|
|
3812
|
+
type: i0.Input,
|
|
3813
|
+
args: [{
|
|
3814
|
+
isSignal: true,
|
|
3815
|
+
alias: "attemptsRemainingText",
|
|
3816
|
+
required: false
|
|
3817
|
+
}]
|
|
3818
|
+
}],
|
|
3819
|
+
hint: [{
|
|
3820
|
+
type: i0.Input,
|
|
3821
|
+
args: [{
|
|
3822
|
+
isSignal: true,
|
|
3823
|
+
alias: "hint",
|
|
3824
|
+
required: false
|
|
3825
|
+
}]
|
|
3826
|
+
}],
|
|
3547
3827
|
cancelLabel: [{
|
|
3548
3828
|
type: i0.Input,
|
|
3549
3829
|
args: [{
|
|
@@ -3679,6 +3959,18 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3679
3959
|
verifyFailed: [{
|
|
3680
3960
|
type: i0.Output,
|
|
3681
3961
|
args: ["verifyFailed"]
|
|
3962
|
+
}],
|
|
3963
|
+
codeField: [{
|
|
3964
|
+
type: i0.ViewChild,
|
|
3965
|
+
args: ["codeField", { isSignal: true }]
|
|
3966
|
+
}],
|
|
3967
|
+
firstField: [{
|
|
3968
|
+
type: i0.ViewChild,
|
|
3969
|
+
args: ["firstField", { isSignal: true }]
|
|
3970
|
+
}],
|
|
3971
|
+
secondField: [{
|
|
3972
|
+
type: i0.ViewChild,
|
|
3973
|
+
args: ["secondField", { isSignal: true }]
|
|
3682
3974
|
}]
|
|
3683
3975
|
}
|
|
3684
3976
|
});
|
|
@@ -5214,6 +5506,9 @@ var PaymentStripeBodyComponent = class PaymentStripeBodyComponent {
|
|
|
5214
5506
|
"paymentElementOptions",
|
|
5215
5507
|
"appearance",
|
|
5216
5508
|
"appearanceFromTokens",
|
|
5509
|
+
"instantOnly",
|
|
5510
|
+
"linkOff",
|
|
5511
|
+
"showPaid",
|
|
5217
5512
|
"returnUrl",
|
|
5218
5513
|
"billingDetails",
|
|
5219
5514
|
"confirmParams",
|
|
@@ -5967,6 +6262,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5967
6262
|
}]
|
|
5968
6263
|
}
|
|
5969
6264
|
});
|
|
5970
|
-
export { MICRODEPOSIT_COPY, MicrodepositVerifyComponent, STRIPE_A11Y_MESSAGES, STRIPE_ACH_NOTICE, STRIPE_DEFAULT_ERROR_MESSAGE, STRIPE_ERROR_MESSAGES, STRIPE_LOADER, STRIPE_METHOD_TEXTS, STRIPE_PAYMENT_DEFAULTS, STRIPE_PAYMENT_METHODS, STRIPE_TECHNICAL_ERROR_MESSAGES, StripeConnectComponent, StripeConnectFlow, StripePaymentComponent, StripePaymentMethodComponent, StripePaymentService, buildLoadOptions, defaultStripeLoader, depositAmountError, descriptorCodeError, getStripeErrorMessage, isDarkPage, isStripeUrl, microdepositArrivalText, microdepositCancelMessage, microdepositKeepsActiveText, microdepositProcessingText, microdepositStepsText, normalizeDescriptorCode, normalizeIntent, outcomeOf, paymentMethodIdOf, provideStripePayment, readStripeAppearance, readStripeReturnParams, retrieveIntent, stripeConnectNotice, verificationOf, verifyMicrodeposits };
|
|
6265
|
+
export { INSTANT_ONLY_CODE, MICRODEPOSIT_COPY, MicrodepositVerifyComponent, STRIPE_A11Y_MESSAGES, STRIPE_ACH_NOTICE, STRIPE_DEFAULT_ERROR_MESSAGE, STRIPE_ERROR_MESSAGES, STRIPE_LOADER, STRIPE_METHOD_TEXTS, STRIPE_PAYMENT_DEFAULTS, STRIPE_PAYMENT_METHODS, STRIPE_TECHNICAL_ERROR_MESSAGES, StripeConnectComponent, StripeConnectFlow, StripePaymentComponent, StripePaymentMethodComponent, StripePaymentService, buildLoadOptions, defaultStripeLoader, depositAmountError, descriptorCodeError, getStripeErrorMessage, isDarkPage, isStripeUrl, microdepositArrivalText, microdepositCancelMessage, microdepositKeepsActiveText, microdepositProcessingText, microdepositStepsText, normalizeDescriptorCode, normalizeIntent, outcomeOf, paymentMethodIdOf, provideStripePayment, readStripeAppearance, readStripeReturnParams, retrieveIntent, stripeAppearanceFromTheme, stripeConnectNotice, verificationOf, verifyMicrodeposits };
|
|
5971
6266
|
|
|
5972
6267
|
//# sourceMappingURL=forgeroute-ui-stripe.mjs.map
|