UNPKG

@bounceapp/react-native-paypal

Version:

React Native wrapper to bridge PayPal iOS and Android SDK

24 lines (23 loc) 954 B
"use strict"; import { NativeModules, Platform } from "react-native"; const LINKING_ERROR = `[@bounceapp/react-native-paypal]: the package doesn't seem to be linked. Make sure: \n\n` + Platform.select({ ios: "- You have run 'pod install'\n", default: "" }) + "- You rebuilt the app after installing the package\n" + "- You are not using Expo managed workflow\n"; const logger = (message, ...rest) => console.info(`[@bounceapp/react-native-paypal] ${message}`, ...rest); const isLinked = !!NativeModules.Paypal; if (!isLinked) logger(LINKING_ERROR); const Paypal = isLinked ? NativeModules.Paypal : {}; export const requestBillingAgreement = options => { const DEFAULT_OPTIONS = { billingAgreementDescription: "", shippingAddressRequired: false }; const composedOptions = { ...DEFAULT_OPTIONS, ...options }; return Paypal.requestBillingAgreement(composedOptions); }; export default Paypal; //# sourceMappingURL=Paypal.js.map