UNPKG

@bounceapp/react-native-paypal

Version:

React Native wrapper to bridge PayPal iOS and Android SDK

29 lines (28 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.requestBillingAgreement = exports.default = void 0; var _reactNative = require("react-native"); const LINKING_ERROR = `[@bounceapp/react-native-paypal]: the package doesn't seem to be linked. Make sure: \n\n` + _reactNative.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 = !!_reactNative.NativeModules.Paypal; if (!isLinked) logger(LINKING_ERROR); const Paypal = isLinked ? _reactNative.NativeModules.Paypal : {}; const requestBillingAgreement = options => { const DEFAULT_OPTIONS = { billingAgreementDescription: "", shippingAddressRequired: false }; const composedOptions = { ...DEFAULT_OPTIONS, ...options }; return Paypal.requestBillingAgreement(composedOptions); }; exports.requestBillingAgreement = requestBillingAgreement; var _default = exports.default = Paypal; //# sourceMappingURL=Paypal.js.map