@olo/pay-capacitor
Version:
Olo Pay SDK Capacitor Plugin
158 lines (150 loc) • 7.8 kB
JavaScript
;
var core = require('@capacitor/core');
var version = "5.0.0";
var buildType = "Public";
var sdkInfo = {
version: version,
buildType: buildType
};
exports.GooglePayCheckoutStatus = void 0;
(function (GooglePayCheckoutStatus) {
/** Represents an estimated price (meaning it's not final and could change) and the default checkout option. The confirmation button will display "Pay". */
GooglePayCheckoutStatus["estimatedDefault"] = "EstimatedDefault";
/** Represents the final price of the transaction and the default checkout option. The confirmation button will display "Pay". */
GooglePayCheckoutStatus["finalDefault"] = "FinalDefault";
/** Represents the final price of the transaction and the immediate checkout option. The confirmation button will display "Pay now". */
GooglePayCheckoutStatus["finalImmediatePurchase"] = "FinalImmediatePurchase";
})(exports.GooglePayCheckoutStatus || (exports.GooglePayCheckoutStatus = {}));
exports.LineItemType = void 0;
(function (LineItemType) {
/** Represents a subtotal line item in a digital wallet transaction */
LineItemType["subtotal"] = "Subtotal";
/** Represents a line item in a digital wallet transaction */
LineItemType["lineItem"] = "LineItem";
/** Represents a tax line item in a digital wallet transaction */
LineItemType["tax"] = "Tax";
})(exports.LineItemType || (exports.LineItemType = {}));
exports.LineItemStatus = void 0;
(function (LineItemStatus) {
/** Indicates that the price is final and has no variance */
LineItemStatus["final"] = "Final";
/** Indicates that the price is pending and may change. On iOS this will cause the amount to appear as an elipsis ("...") */
LineItemStatus["pending"] = "Pending";
})(exports.LineItemStatus || (exports.LineItemStatus = {}));
exports.CardType = void 0;
(function (CardType) {
/** Visa credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
CardType["visa"] = "Visa";
/** American Express credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
CardType["amex"] = "Amex";
/** Mastercard credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
CardType["mastercard"] = "Mastercard";
/** Discover credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
CardType["discover"] = "Discover";
/** Unsupported credit card type. Passing this to the Olo Ordering API will result in an error */
CardType["unsupported"] = "Unsupported";
/** Unknown credit card type. Passing this to the Olo Ordering API will result in an error */
CardType["unknown"] = "Unknown";
})(exports.CardType || (exports.CardType = {}));
/** 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["applePayError"] = "ApplePayError";
PromiseRejectionCode["applePayTimeoutError"] = "ApplePayTimeoutError";
PromiseRejectionCode["googlePayNetworkError"] = "GooglePayNetworkError";
PromiseRejectionCode["googlePayDeveloperError"] = "GooglePayDeveloperError";
PromiseRejectionCode["googlePayInternalError"] = "GooglePayInternalError";
PromiseRejectionCode["googlePayInvalidSetup"] = "GooglePayInvalidSetup";
PromiseRejectionCode["digitalWalletUninitialized"] = "DigitalWalletUninitialized";
PromiseRejectionCode["digitalWalletNotReady"] = "DigitalWalletNotReady";
PromiseRejectionCode["emptyCompanyLabel"] = "EmptyCompanyLabel";
PromiseRejectionCode["emptyMerchantId"] = "EmptyMerchantId";
PromiseRejectionCode["invalidCountryCode"] = "InvalidCountryCode";
PromiseRejectionCode["lineItemsTotalMismatch"] = "LineItemsTotalMismatch";
PromiseRejectionCode["unexpectedError"] = "UnexpectedError";
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.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)
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.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)
// NOTE: This web interface is required by the Capacitor Plugin, but it will not do anything
class OloPaySDKWeb extends core.WebPlugin {
/* eslint-disable @typescript-eslint/no-unused-vars */
async updateDigitalWalletConfiguration(_options) {
return Promise.reject({
code: exports.PromiseRejectionCode.uninmplemented.toString(),
message: 'updateDigitalWalletConfiguration() is not implemented for web',
});
}
/* eslint-disable @typescript-eslint/no-unused-vars */
async isDigitalWalletReady() {
return Promise.reject({
code: exports.PromiseRejectionCode.uninmplemented.toString(),
message: 'isDigitalWalletReady() is not implemented for web',
});
}
async createDigitalWalletPaymentMethod(_options) {
return Promise.reject({
code: exports.PromiseRejectionCode.uninmplemented.toString(),
message: 'createDigitalWalletPaymentMethod() is not implemented for web',
});
}
/* eslint-disable @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 @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;
//# sourceMappingURL=plugin.cjs.js.map