naoufal / react-native-payments

Accept Payments with Apple Pay and Android Pay using the Payment Request API.
https://www.npmjs.com/package/react-native-payments
1.59k stars 412 forks source link

BTApplePayClient tokenization failed because BTAPIClient is nil #76

Open jariwalabhavesh opened 6 years ago

jariwalabhavesh commented 6 years ago

Hi,

I had implemented react-native-payment library and I had implemented Stripe and Braintree addon.

I am getting BTApplePayClient tokenization failed because BTAPIClient is nil error when i am using it with stripe addon in ios (i hadn't tested it with android yet).

Options

    this.METHOD_DATA = [{
      supportedMethods: ['apple-pay'],
      data: {
        merchantIdentifier: 'merchant.com.test.testApp',
        supportedNetworks: ['visa', 'mastercard', 'amex'],
        countryCode: 'US',
        currencyCode: 'USD',
        paymentMethodTokenizationParameters: {
          parameters: {
            gateway: 'stripe',
            'stripe:publishableKey': 'my_test_publishkey_from_stripe'
          }
        }
      }
    }];

    this.DETAILS = {
      id: 'basic-example',
      displayItems: [
        {
          label: 'Movie Ticket',
          amount: { currency: 'USD', value: '15.00' }
        }
      ],
      total: {
        label: 'Merchant Name',
        amount: { currency: 'USD', value: '15.00' }
      }
    };

Payment request code

    let paymentRequest = new PaymentRequest(this.METHOD_DATA, this.DETAILS);

    paymentRequest.show().then(paymentResponse => {
      console.log('paymentResponse', paymentResponse)
      paymentResponse.complete('success');
    }).catch(e => {
      paymentRequest.abort();
      console.log('e.message', e.message)
    });

I am not able to identify why i am getting error from braintree module thought i am using stripe you can see in my code. I had integrated both braintree and stripe add on but i am only using stripe.

I am able to receive call on stripe account, i had checked that in stripe event log it is showing 200 status. Any Idea???

Andreyco commented 6 years ago

looks like you are having and issue with linking Braintree SDK properly. Do you see braintree in NativeModules.ReactNativePayments.supportedGateways?

belal-mazlom commented 6 years ago

I have same issue, Stripe add on was working well before install Braintree. ReactNativePayments.supportedGateways give me ["stripe", "braintree"]