Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment Dialog Not Closing on Abort Method Call Before/After Payment Intent Creation #240

Open
HelloooJoe opened this issue Jan 11, 2024 · 0 comments
Assignees
Labels
triage Pending triage

Comments

@HelloooJoe
Copy link

HelloooJoe commented Jan 11, 2024

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:

  1. Click on a digital wallet payment option.
  2. Complete the payment information and click on "Pay".
  3. Observe the code invoke the abort method to cancel the payment.
  4. Notice that the payment dialog does not close as expected.

image

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.

@HelloooJoe HelloooJoe added the triage Pending triage label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Pending triage
Projects
None yet
Development

No branches or pull requests

2 participants