UNPKG

@olo/pay-react-native

Version:
116 lines (114 loc) 4.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { OloPayEvents: true, OloPaySDK: true }; exports.OloPaySDK = exports.OloPayEvents = void 0; var _reactNative = require("react-native"); var _useOloPayNativeModule = _interopRequireDefault(require("./hooks/useOloPayNativeModule")); var _package = require("../package.json"); var _definitions = require("./definitions"); Object.keys(_definitions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _definitions[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _definitions[key]; } }); }); var _PaymentCardDetailsView = require("./components/PaymentCardDetailsView"); Object.keys(_PaymentCardDetailsView).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _PaymentCardDetailsView[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _PaymentCardDetailsView[key]; } }); }); var _PaymentCardDetailsForm = require("./components/PaymentCardDetailsForm"); Object.keys(_PaymentCardDetailsForm).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _PaymentCardDetailsForm[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _PaymentCardDetailsForm[key]; } }); }); var _PaymentCardCvvView = require("./components/PaymentCardCvvView"); Object.keys(_PaymentCardCvvView).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _PaymentCardCvvView[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _PaymentCardCvvView[key]; } }); }); var _DigitalWalletButton = require("./components/DigitalWalletButton"); Object.keys(_DigitalWalletButton).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _DigitalWalletButton[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _DigitalWalletButton[key]; } }); }); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } // Copyright © 2022 Olo Inc. All rights reserved. // This software is made available under the Olo Pay SDK License (See LICENSE.md file) const OlopaysdkReactNative = (0, _useOloPayNativeModule.default)(); const OloPayEvents = exports.OloPayEvents = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.OlopaysdkReactNativeEventEmitter); const OloPaySDK = exports.OloPaySDK = { initialize: async function (productionEnvironment, digitalWalletConfig) { await OlopaysdkReactNative.initializeMetadata({ version: _package.version, buildType: _package.buildType }); await OlopaysdkReactNative.initializeOloPay({ productionEnvironment }); if (_reactNative.Platform.OS === 'android' && digitalWalletConfig !== null && digitalWalletConfig !== void 0 && digitalWalletConfig.initializeGooglePay || _reactNative.Platform.OS === 'ios' && digitalWalletConfig !== null && digitalWalletConfig !== void 0 && digitalWalletConfig.initializeApplePay) { await OlopaysdkReactNative.updateDigitalWalletConfig({ digitalWalletConfig }); } return; }, updateDigitalWalletConfig: async function (digitalWalletConfig) { if (_reactNative.Platform.OS === 'android' && digitalWalletConfig !== null && digitalWalletConfig !== void 0 && digitalWalletConfig.initializeGooglePay || _reactNative.Platform.OS === 'ios' && digitalWalletConfig !== null && digitalWalletConfig !== void 0 && digitalWalletConfig.initializeApplePay) { await OlopaysdkReactNative.updateDigitalWalletConfig({ digitalWalletConfig }); } }, isDigitalWalletReady: async function () { return await OlopaysdkReactNative.isDigitalWalletReady(); }, createDigitalWalletPaymentMethod: async function (options) { return await OlopaysdkReactNative.getDigitalWalletPaymentMethod(options); }, isInitialized: async function () { return await OlopaysdkReactNative.isOloPayInitialized(); }, isDigitalWalletInitialized: async function () { return await OlopaysdkReactNative.isDigitalWalletInitialized(); } }; //# sourceMappingURL=index.js.map