react-native-payments icon indicating copy to clipboard operation
react-native-payments copied to clipboard

iOS: undefined paymentToken on real device.

Open pasha-iwanov opened this issue 6 years ago • 2 comments

Hi! May be I am doing something wrong, but I am really confused. I am trying to test Apple Pay on real device in release iOS build (through XCode Run), but got undefined paymentToken.

We set up ApplePay as it described in the Apple docs, got merchantId.

Here is the code:

const METHOD_DATA = [{
  supportedMethods: ['apple-pay'],
  data: {
    merchantIdentifier: MERCHANT_ID, // (not .test, real),
    supportedNetworks: ['visa', 'mastercard'],
    countryCode: 'RU',
    currencyCode: 'RUB',
  },
}];
  request ({ amount }) {
    const paymentRequest = new PaymentRequest(METHOD_DATA, {
      total: {
        label: 'Магазинчик',
        amount: {
          currency: 'RUB',
          value: String(amount),
        },
      },
    });

    return paymentRequest.show()
      .then((paymentResponse) => {
        setTimeout(() => {
          paymentResponse.complete('success');
        });

        return paymentResponse.details.paymentToken;
      })
      .catch(() => {});
  },

Everything works fine: appears ApplePay confirmation dialog, but after confirming by touchId, paymentToken is undefined. Thanks!

pasha-iwanov avatar Jul 05 '18 11:07 pasha-iwanov

Facing the same problem. I will devote some time to trying to trace the ~~Swift~~ Obj-C code in the library.

jangerhofer avatar Jul 23 '18 17:07 jangerhofer

same issue here did you solve this problem ?

feraswfares avatar Dec 26 '22 09:12 feraswfares