ekreative / react-native-paypal

A react native interface for integrating payments using PayPal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-paypal

Getting started

Installation

npm install @ekreative/react-native-paypal

Android Specific

Add this to your build.gradle

maven {
  url  "https://cardinalcommerceprod.jfrog.io/artifactory/android"
  credentials {
    username 'paypal_sgerritz'
    password 'AKCp8jQ8tAahqpT5JjZ4FRP2mW7GMoFZ674kGqHmupTesKeAY2G8NcmPKLuTxTGkKjDLRzDUQ'
  }
}

If you already use @ekreative/react-native-braintree package in your app you should to remove this lines from your build.gradle

maven {
  url  "https://cardinalcommerce.bintray.com/android"
  credentials {
    username 'braintree-team-sdk@cardinalcommerce'
    password '220cc9476025679c4e5c843666c27d97cfb0f951'
  }
}

iOS Specific

TODO

Usage

import Paypal from " @ekreative/react-native-paypal";

// ...

Paypal.startWithOrderId({
  clientId: 'YOUR_CLIENT_ID',
  useSandbox: true, // you should use 'false' for live environment
  orderId: 'YOUR_ODRED_ID', //should be fetched from your backend
  returnUrl: 'YOUR_RETURN_URL',
  cancelErrorCode: 'ON_CANCEL', //optional, default value - PAYPAL_CANCELLED
})
  .then(approvalData => console.log(approvalData))
  .catch(error => console.log(error));

License

MIT

About

A react native interface for integrating payments using PayPal

License:MIT License


Languages

Language:Kotlin 52.5%Language:Swift 29.1%Language:Ruby 10.4%Language:Objective-C 6.5%Language:JavaScript 1.5%