stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.27k stars 263 forks source link

No callback triggered when calling confirmSetupIntent with paypal (have to manually close it) #1443

Closed singhagam1 closed 1 year ago

singhagam1 commented 1 year ago

Describe the bug NOTE - I am very well aware that paypal is in Beta and that Paypal is enabled for the account that I am using. The code that I am going to mention is working fine in android but in iOS, when the inapp browser opens up for authorisation or deny, nothing happens unless I manually close the inapp browser. After the Inapp browser is manually closed, it then givens the callback. But in android, as soon as I press authorise or deny, the inappbrowser closes automatically and I get the results.

To Reproduce Steps to reproduce the behavior:

  1. Simply call the below function -
      const {error, setupIntent} = await confirmSetupIntent(
            {stripeClientSecret},
            {
                paymentMethodType: 'PayPal',
                paymentMethodData: {
                    billingDetails: {
                        email: 'someemail@gmail.com',
                    },
                    mandateData: {
                        customerAcceptance: {
                            online: {
                                ipAddress: '1.1.1.1',
                                userAgent: 'my-agent',
                            },
                        },
                    },
                },
            },
            {setupFutureUsage: 'OffSession'},
        );

        if (error) {
            console.log('Setup confirmation error', error.message);
          } else if (setupIntent) {
            console.log('Success from promise', setupIntent);
          }
  1. Open this in ios, an inapp browser will open up as soon as you call this function, after choosing authorise or deny, nothing will happen untill you manually close the inapp browser.

Expected behavior Similar to android, the ios inapp browser should close automatically if I am not missing something.

Screenshots Attaching Screenshot

Desktop (please complete the following information):

Smartphone (please complete the following information):

Simulator Screenshot - iPhone 14 Pro Max - 2023-07-04 at 15 22 19

singhagam1 commented 1 year ago

Closing because I had to handle it manually as given in the docs

https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-set-up-return-url

reidak97 commented 9 months ago

I am facing the same issue: how did you fix it manually?

Closing because I had to handle it manually as given in the docs

agam-colaburate commented 9 months ago
Screenshot 2024-01-02 at 12 26 54 AM

@reidak97 Check the link that I have pasted in my last comment, it has the exact snippet of code.

reidak97 commented 9 months ago

@reidak97 Check the link that I have pasted in my last comment, it has the exact snippet of code.

Yes I did, thanks. I am kinda new to App Development, so i could not figure it out yet to handle it manually. The payment would work but the inApp Browser would not close.