react-native-payments
                                
                                
                                
                                    react-native-payments copied to clipboard
                            
                            
                            
                        iOS getting Cannot read property 'createPaymentRequest' of undefined
After installation of the library, an attempt to initiate payment request fails with
 WARN  Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'createPaymentRequest' of undefined
TypeError: Cannot read property 'createPaymentRequest' of undefined
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:151410:29
    at tryCallTwo (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3245:7)
    at doResolve (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3409:15)
    at new Promise (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3268:5)
    at Object.createPaymentRequest (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:151405:14)
    at new PaymentRequest (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:151070:31)
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:111655:30
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:30694:21
    at _callTimer (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:30611:9)
    at Object.callTimers (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:30818:9)
 WARN  Possible Unhandled Promise Rejection (id: 1):
TypeError: Cannot read property 'canMakePayments' of undefined
TypeError: Cannot read property 'canMakePayments' of undefined
The code is straightforward:
const METHOD_DATA = [{
        supportedMethods: ['apple-pay'],
        data: {
          merchantIdentifier: 'merchant.co.ynd.coffeeheroes.ios',
          supportedNetworks: ['visa', 'mastercard', 'amex'],
          countryCode: 'US',
          currencyCode: 'USD'
        }
      }]
      const DETAILS = {
        id: 'basic-example',
        displayItems: [
          {
            label: 'Movie Ticket',
            amount: { currency: 'USD', value: '15.00' }
          }
        ],
        total: {
          label: 'Merchant Name',
          amount: { currency: 'USD', value: '15.00' }
        }
      };
      const paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS);
      paymentRequest.canMakePayments().then((canMakePayment) => {
        if (canMakePayment) {
          Alert.alert(
            'Apple Pay',
            'Apple Pay is available in this device'
          );
        }
      })
                                    
                                    
                                    
                                
In the node_modules ios directory is missing, any ide why is that?

+1
Any solution here?
same here
same