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

iOS: app crash on unrecognized network name

Open Uriah-Eisenstein-ATT opened this issue 2 years ago • 1 comments

Example:

const METHOD_DATA = [{
  supportedMethods: ['apple-pay'],
  data: {
    merchantIdentifier: 'merchant.com.your-app.namespace',
    supportedNetworks: ['visa', 'mastercard', 'amex', 'UNKNOWN-NETWORK'],
    countryCode: 'US',
    currencyCode: 'USD'
  }
}];
...
const paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS);

The last line crashes on iOS because of trying to add null to an array, in ReactNativePayments.getSupportedNetworksFromMethodData.

Uriah-Eisenstein-ATT avatar Apr 26 '22 12:04 Uriah-Eisenstein-ATT

PR #351 patches this crash.

Uriah-Eisenstein-ATT avatar Apr 26 '22 12:04 Uriah-Eisenstein-ATT