kraffslol / react-native-braintree-xplat

Cross-platform Braintree module for React Native
MIT License
81 stars 121 forks source link

showApplePayViewController not dismiss or not catch when request close dialog #132

Open pckz opened 2 years ago

pckz commented 2 years ago

Hello! I am looking for help, recommendations, comments, etc as I need to fix this issue. Any comment would be helpful.

I'm using a fork of this library (https://github.com/wkoutre/react-native-braintree-xplat) because I need the Apple Pay payment method. That fork doesn't have "Issues" tab, so thats the reason why I'm writing here, maybe the problem is common in other payment methods, and the developer community is much more active here

The library works well with the methods showPaymentViewController and showPayPalViewController (availables in this lib) and when I request close the popup to make the payment (click on x) the bottom dialog close and works and the function pass to the catch section, so I can hide a global loading spinner. Everything is ok!

The problem is with the function showApplePayViewController, the bottom dialog is shown correctly. but when I press the x button to close, not pass to the catch, it got stucked, and I can't figourte out how to insert a callback

I'm using redux-saga, so the methods I written as following:

    paymentNonce = yield call(
            [BTClient, BTClient.showApplePayViewController],
            {
              merchantIdentifier: 'merchant.FirstDerm',
              paymentSummaryItems: [
                {label: paymentLabel, amount: price.amount},
              ]
            },
            () =>{
              // this callback not work
              console.log('applepay callback ')
            }
          );

With the other methods that work well, this is the code:

        paymentNonce = yield call(
            [BTClient, BTClient.showPaymentViewController],
            {},
          );

so when you touch the x to close, go directlys to the catch. But not pass the same with showApplePayViewController

I tried with the

            () =>{
              // this callback not work
              console.log('applepay callback ')
            }

and without, empty, and nor specifying the latest argument

Thanks for any help!

Captura de Pantalla 2022-03-10 a la(s) 10 39 52