kraffslol / react-native-braintree-xplat

Cross-platform Braintree module for React Native
MIT License
81 stars 121 forks source link

How to integrate with apple pay? #60

Open Radiet opened 7 years ago

Radiet commented 7 years ago

Is this library support apple pay?

markrickert commented 7 years ago

Check out my fork and branch here that supports applepay. Note: not documented and doesn't support androidpay.

Maybe my implementation here will help you with yours. Unfortunately, i can't really contribute this back because I'm not going to be doing AndroidPay support.

https://github.com/kraffslol/react-native-braintree-xplat/compare/master...markrickert:return-more-data

You use my applepay implementation like this:

const cardDetails = yield BTClient.showApplePayViewController({
  merchantIdentifier: merchantId,
  currencyCode: currencyCode,
  countryCode: countryCode,
  displayItems: cart.displayItems, // This is an array of items in the form of [{label: 'Item 1', amount: '12.99'},{label: 'Item 2', amount: '5.00'}]
  shipping: {
    label: 'Shipping',
    amount: '4.99',
  },
  total: {
    label: 'Total:',
    amount: '22.98',
  },
})