- Android setup
- iOS setup
- import Paypal from "react-native-paypal";
-
configure(<params object>)
Configure Paypal for single payment. Call this only once in your application.
<params object> Name Type Optional Description environment String Paypal.SANDBOX
Paypal.NO_NETWORK
Paypal.PRODUCTIONclientId String merchantName String acceptCreditCards boolean Yes Indicate whether credit card support should be enabled. Defaults to true defaultUserEmail String Yes defaultUserPhone String Yes defaultUserPhoneCountryCode String Yes rememberUser boolean Yes Defaults to true -
isProcessable(<params object>, <callback>)
Checks if the payment object can be processed. The callback returns false for cases such as negative amount, currency string not recognized etc.
<params object> Name Type Optional Description amount Number currency String description String bnCode String Yes Build Notation Code custom String Yes invoiceNumber String Yes softDescriptor String Yes shippingAddress Object Yes paymentDetails Object Yes <shippingAddress object> Name Type Optional Description recipientName String line1 String line2 String Yes postalCode String Yes city String state String Yes countryCode String Yes <paymentDetails object> Name Type Optional Description shipping Number subtotal Number tax Number -
singlePayment(<params object>, <success callback>, <failure callback>)
Process a single payment using the sdk. The success callback will return a confirmation object. Sample confirmation object and steps to verify payment can be found here. The failure callback can have one of 2 error codes, Paypal.ERROR_USER_CANCELED or Paypal.ERROR_INVALID_CONFIG (only for android).
<params object> is the same as defined for isProcessable.
-
logout()
Deletes all remembered user data (credit cards, paypal account, email, phone). This can be used while logging out a user in the app.