react-native-payments
react-native-payments copied to clipboard
iOS: app crash on unrecognized network name
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
.
PR #351 patches this crash.