Payment Dialog Not Closing on Abort Method Call Before/After Payment Intent Creation
HelloooJoe opened this issue · 0 comments
Describe the bug
The payment dialog remains open even after calling the abort method on the StripePaymentRequestButtonComponent. This occurs when the payment process is meant to be aborted due to the absence of the payer's name. Despite calling ev.complete('fail') followed by this.paymentRequestButton.abort(), the dialog persists.
@ViewChild(StripePaymentRequestButtonComponent) paymentRequestButton: StripePaymentRequestButtonComponent;
onPaymentMethod(ev: PaymentRequestPaymentMethodEvent) {
const name = ev.payerName;
// If the name is not provided, then abort the payment process
if (!name) {
ev.complete('fail');
this.paymentRequestButton.abort();
this._changeDetectorRef.markForCheck();
return;
}
// ... Create Payment Intent logic
}
To Reproduce
Steps to reproduce the behavior:
- Click on a digital wallet payment option.
- Complete the payment information and click on "Pay".
- Observe the code invoke the abort method to cancel the payment.
- Notice that the payment dialog does not close as expected.
Expected behavior
When this.paymentRequestButton.abort() is called, the payment dialog should close, indicating the payment process has been halted due to missing payer information.
Desktop (please complete the following information):
- OS: Windows 11 Pro
- Browser: Chrome
- Version: 120.0.6099.130
Additional context
The issue occurs within an Angular application using the ngx-stripe library.
All dependencies are up to date with their latest versions. "ngx-stripe": "^17.0.1" & "@stripe/stripe-js": "^2.3.0"
No console errors are observed when the issue occurs.