UNPKG

@olo/pay-capacitor

Version:
121 lines (111 loc) 5.32 kB
var capacitorOloPaySDK = (function (exports, core) { 'use strict'; var version = "3.0.0"; var buildType = "Public"; var sdkInfo = { version: version, buildType: buildType }; /** Digital wallet types */ exports.DigitalWalletType = void 0; (function (DigitalWalletType) { DigitalWalletType["applePay"] = "applePay"; DigitalWalletType["googlePay"] = "googlePay"; })(exports.DigitalWalletType || (exports.DigitalWalletType = {})); /** Specific kinds of Google Pay Errors */ exports.GooglePayErrorType = void 0; (function (GooglePayErrorType) { /** Google Pay didn't succeed due to a network error */ GooglePayErrorType["networkError"] = "NetworkError"; /** Google Pay didn't succeed due to developer error */ GooglePayErrorType["developerError"] = "DeveloperError"; /** Google Pay didn't succeed due to an internal error */ GooglePayErrorType["internalError"] = "InternalError"; })(exports.GooglePayErrorType || (exports.GooglePayErrorType = {})); //SEE DOCUMENTATION IN README.MD exports.PromiseRejectionCode = void 0; (function (PromiseRejectionCode) { PromiseRejectionCode["invalidParameter"] = "InvalidParameter"; PromiseRejectionCode["missingParameter"] = "MissingParameter"; PromiseRejectionCode["applePayUnsupported"] = "ApplePayUnsupported"; PromiseRejectionCode["sdkUninitialized"] = "SdkUninitialized"; PromiseRejectionCode["googlePayUninitialized"] = "GooglePayUninitialized"; PromiseRejectionCode["googlePayNotReady"] = "GooglePayNotReady"; PromiseRejectionCode["uninmplemented"] = "UNIMPLEMENTED"; PromiseRejectionCode["generalError"] = "generalError"; })(exports.PromiseRejectionCode || (exports.PromiseRejectionCode = {})); //SEE DOCUMENTATION IN README.MD const DigitalWalletReadyEvent = 'digitalWalletReadyEvent'; // Copyright © 2022 Olo Inc. All rights reserved. const OloPaySDK = core.registerPlugin('OloPaySDK', { web: () => Promise.resolve().then(function () { return web; }).then(m => new m.OloPaySDKWeb()), }); OloPaySDK.initializeInternal({ version: sdkInfo.version, buildType: sdkInfo.buildType }); // Copyright © 2022 Olo Inc. All rights reserved. // NOTE: This web interface is required by the Capacitor Plugin, but it will not do anything class OloPaySDKWeb extends core.WebPlugin { // eslint-disable-next-line @typescript-eslint/no-unused-vars async initializeGooglePay(_options) { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'initializeGooglePay() is not implemented for web' }); } // eslint-disable-next-line @typescript-eslint/no-unused-vars async changeGooglePayVendor(_options) { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'changeGooglePayVendor() is not implemented for web' }); } // eslint-disable-next-line @typescript-eslint/no-unused-vars async isDigitalWalletReady() { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'isDigitalWalletReady() is not implemented for web' }); } // eslint-disable-next-line @typescript-eslint/no-unused-vars async getDigitalWalletPaymentMethod(_options) { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'getDigitalWalletPaymentMethod() is not implemented for web' }); } // eslint-disable-next-line @typescript-eslint/no-unused-vars async initialize(_options) { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'initialize() is not implemented for web' }); } isInitialized() { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'isInitialized() is not implemented for web' }); } isDigitalWalletInitialized() { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'isDigitalWalletInitialized() is not implemented for web' }); } // eslint-disable-next-line @typescript-eslint/no-unused-vars initializeInternal(_options) { return Promise.reject({ code: exports.PromiseRejectionCode.uninmplemented.toString(), message: 'isDigitalWalletInitialized() is not implemented for web' }); } } var web = /*#__PURE__*/Object.freeze({ __proto__: null, OloPaySDKWeb: OloPaySDKWeb }); exports.DigitalWalletReadyEvent = DigitalWalletReadyEvent; exports.OloPaySDK = OloPaySDK; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, capacitorExports); //# sourceMappingURL=plugin.js.map