UNPKG

@olo/pay-react-native

Version:
202 lines (191 loc) 9.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PromiseRejectionCode = exports.GooglePayErrorType = exports.FontWeight = exports.DigitalWalletType = exports.DigitalWalletReadyEvent = exports.CardType = exports.CardField = void 0; // Copyright © 2022 Olo Inc. All rights reserved. // This software is made available under the Olo Pay SDK License (See LICENSE.md file) /** Type alias representing options for a digital wallet payment method request */ /** * Type alias representing a digital wallet payment method result. The * object will either contain payment method data or error data. */ /** * Type representing a digital wallet error * | Property | Description | * | -------- | ----------- | * | `errorMessage` | Error message indicating what went wrong | * | `digitalWalletType` | Enum value indicating Apple Pay or Google Pay. If this is a Google Pay error, there are additional properties indicating the type of error that occurred. See `GooglePayError` | */ /** * Type representing specific error types that can occur while processing a Google Pay transaction * | Property | Description | * | -------- | ----------- | * | `googlePayErrorType` | The type of error that occurred. See `GooglePayErrorType` | */ /** * Options for initializing the Olo Pay SDK * | Property | Description | Default | * | -------- | ----------- | ------- | * | `productionEnvironment` | `true` to use the production environment, `false` for the test environment. | `true` | * | `freshInstall` | **_DEPRECATED:_** This property is deprecated and is ignored if used | */ /** * Options for initializing Apple Pay * | Property | Description | * | -------- | ----------- | * | `applePayMerchantId` | The merchant id registered with Apple for Apple Pay | * | `applePayCompanyLabel` | The company name that will be displayed on the Apple Pay payment sheet | */ /** Options for initializing the Android Olo Pay SDK. This is a type alias for code readability. */ /** Options for initializing the iOS Olo Pay SDK. This is a type alias for code readability */ /** * Options for intializing Google Pay * | Property | Description | Default | * | -------- | ----------- | ------- | * | `googlePayProductionEnvironment` | `true` to use the production environment, `false` for the test environment | `true` | * | `countryCode` | A two character country code for the vendor that will be processing the payment | - | * | `merchantName` | The merchant/vendor display name | - | * | `fullAddressFormat` | Determines what address fields are required to complete a Google Pay transaction. `true` includes name, street address, locality, region, country code, and postal code. `false` only includes name, country code, and postal code | `false` | * | `existingPaymentMethodRequired` | Whether an existing saved payment method is required for Google Pay to be considered ready | `true` | * | `emailRequired` | Whether Google Pay collects an email when processing payments | `false` | * | `phoenNumberRequired` | Whether Google Pay collects a phone number when processing payments | `false` | */ /** * Options for changing the country code or merchant name for Google Pay transactions * | Property | Description | * | -------- | ----------- | * | `countryCode` | A two character country code for the vendor that will be processing the payment | * | `merchantName` | The merchant/vendor display name | */ /** * Options for requesting a payment method via Google Pay * | Property | Description | Default | * | -------- | ----------- | ------- | * | `amount` | The amount to be charged | - | * | `currencyCode` | A three character currency code for the transaction | 'USD' | * | `currencyMulitplier` | Multiplier to convert the amount to the currency's smallest currency unit (e.g. $2.34 * 100 = 234 cents) | 100 | * * **_Important_:** The amount charged will be equivalent to `amount * currencyCode` so ensure these are set properly */ /** * Options for requesting a payment method via Apple Pay * | Property | Description | Default | * | -------- | ----------- | ------- | * | `amount` | The amount to be charged | - | * | `currencyCode` | A three character currency code for the transaction | 'USD' | * | `countryCode` | A two character country code | 'US' | */ /** * Represents the status of digital wallets. * | Property | Description | * | -------- | ----------- | * | `isReady` | `true` if digital wallets are ready to be used, `false` otherwise | */ /** * Represents the status for SDK initialization * | Property | Description | * | -------- | ----------- | * | `isInitialized` | `true` if the SDK is initialized, `false` otherwise | */ /** * Payment method used for submitting payments to Olo's Ordering API * | Property | Description | * | -------- | ----------- | * | `id` | The payment method id. This should be set to the token field when submitting a basket | * | `last4` | The last four digits of the card | * | `cardType` | The issuer of the card | * | `expMonth` | Two-digit number representing the card's expiration month | * | `expYear` | Four-digit number representing the card's expiration year | * | `postalCode` | Zip or postal code | * | `countryCode` | Two character country code | * | `isDigitalWallet` | `true` if this payment method was created by digital wallets (e.g. Apple Pay or Google Pay), `false` otherwise | */ // SEE DOCUMENTATION IN README.MD /** Digital wallet types */ let DigitalWalletType = exports.DigitalWalletType = /*#__PURE__*/function (DigitalWalletType) { DigitalWalletType["applePay"] = "applePay"; DigitalWalletType["googlePay"] = "googlePay"; return DigitalWalletType; }({}); /** Specific kinds of Google Pay Errors */ let GooglePayErrorType = exports.GooglePayErrorType = /*#__PURE__*/function (GooglePayErrorType) { GooglePayErrorType["networkError"] = "NetworkError"; GooglePayErrorType["developerError"] = "DeveloperError"; GooglePayErrorType["internalError"] = "InternalError"; return GooglePayErrorType; }({}); let CardType = exports.CardType = /*#__PURE__*/function (CardType) { CardType["visa"] = "Visa"; CardType["amex"] = "Amex"; CardType["mastercard"] = "Mastercard"; CardType["discover"] = "Discover"; CardType["unsupported"] = "Unsupported"; CardType["unknown"] = "Unknown"; return CardType; }({}); // SEE DOCUMENTATION IN README.MD let PromiseRejectionCode = exports.PromiseRejectionCode = /*#__PURE__*/function (PromiseRejectionCode) { PromiseRejectionCode["invalidParameter"] = "InvalidParameter"; PromiseRejectionCode["missingParameter"] = "MissingParameter"; PromiseRejectionCode["sdkUninitialized"] = "SdkUninitialized"; PromiseRejectionCode["applePayUnsupported"] = "ApplePayUnsupported"; PromiseRejectionCode["googlePayUninitialized"] = "GooglePayUninitialized"; PromiseRejectionCode["googlePayNotReady"] = "GooglePayNotReady"; PromiseRejectionCode["uninmplemented"] = "UNIMPLEMENTED"; PromiseRejectionCode["viewNotFound"] = "ViewNotFound"; PromiseRejectionCode["apiError"] = "ApiError"; PromiseRejectionCode["invalidRequest"] = "InvalidRequest"; PromiseRejectionCode["connectionError"] = "ConnectionError"; PromiseRejectionCode["cancellationError"] = "CancellationError"; PromiseRejectionCode["authenticationError"] = "AuthenticationError"; PromiseRejectionCode["invalidCardDetails"] = "InvalidCardDetails"; PromiseRejectionCode["invalidNumber"] = "InvalidNumber"; PromiseRejectionCode["invalidExpiration"] = "InvalidExpiration"; PromiseRejectionCode["invalidCvv"] = "InvalidCVV"; PromiseRejectionCode["invalidPostalCode"] = "InvalidPostalCode"; PromiseRejectionCode["expiredCard"] = "ExpiredCard"; PromiseRejectionCode["cardDeclined"] = "CardDeclined"; PromiseRejectionCode["processingError"] = "ProcessingError"; PromiseRejectionCode["unknownCardError"] = "UnknownCardError"; PromiseRejectionCode["generalError"] = "generalError"; return PromiseRejectionCode; }({}); // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD const DigitalWalletReadyEvent = exports.DigitalWalletReadyEvent = 'digitalWalletReadyEvent'; // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD let CardField = exports.CardField = /*#__PURE__*/function (CardField) { CardField["number"] = "number"; CardField["expiration"] = "expiration"; CardField["cvv"] = "cvv"; CardField["postalCode"] = "postalCode"; return CardField; }({}); // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD // SEE DOCUMENTATION IN README.MD let FontWeight = exports.FontWeight = /*#__PURE__*/function (FontWeight) { FontWeight["ultraLight"] = "100"; FontWeight["thin"] = "200"; FontWeight["light"] = "300"; FontWeight["regular"] = "400"; FontWeight["medium"] = "500"; FontWeight["semiBold"] = "600"; FontWeight["bold"] = "700"; FontWeight["extraBold"] = "800"; FontWeight["black"] = "900"; return FontWeight; }({}); //# sourceMappingURL=definitions.js.map