@olo/pay-react-native
Version:
Olo Pay React Native SDK
701 lines (646 loc) • 26.1 kB
text/typescript
// Copyright © 2022 Olo Inc. All rights reserved.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)
import type { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native';
export interface IOloPaySDK {
/**
* Initialize the Olo Pay SDK and, optionally, configure and initialize digital wallets. The SDK must be initialized prior to calling other methods. Calling this method **will** ensure that the Olo Pay SDK is initialized.
* If a [DigitalWalletConfig](#digitalwalletconfig) is provided, when digital wallets become ready, a [DigitalWalletReadyEvent](#digitalwalletreadyevent) will be emitted. If digital wallets are not configured
* and initialized here, this can be done later by calling [updateDigitalWalletConfig](#updatedigitalwalletconfig).
*
* **Important:** The Olo Pay SDK is guaranteed to be initialized even if the promise is rejected. Promise rejections will only occur due to an error while initializing digital wallets, which happens after successful SDK initialization.
*
* If the promise is rejected, the `code` property of the returned error object will be one of:
* - [OloErrorCode.missingParameter](#oloerrorcode)
* - [OloErrorCode.invalidParameter](#oloerrorcode)
* - [OloErrorCode.googlePayInvalidSetup](#oloerrorcode) **_(Android only)_**
* - [OloErrorCode.unexpectedError](#oloerrorcode) **_(Android only)_**
*
* @param productionEnvironment `true` to use the production environment, `false` for the test environment
* @param digitalWalletConfig Initialization options for digital wallets
*/
initialize(
productionEnvironment: boolean,
digitalWalletConfig?: DigitalWalletConfig
): Promise<void>;
/**
* Update the configuration settings for digital wallets.
*
* This can be used to change configuration parameters for digital wallets. Calling this method will
* immediately invalidate digital wallet readiness and will cause a [DigitalWalletReadyEvent](#digitalwalletreadyevent)
* to be emitted with a value of `false`. Once the new configuration is ready to be used,
* the [DigitalWalletReadyEvent](#digitalwalletreadyevent) will be triggered again with a value of `true`.
*
* **Note:** This method can also be used to initialize digital wallets if they were not initialized as part of SDK initialization (see [initialize](#initialize)).
*
* If the promise is rejected, the `code` property of the returned error object will be one of:
* - [OloErrorCode.missingParameter](#oloerrorcode)
* - [OloErrorCode.invalidParameter](#oloerrorcode)
* - [OloErrorCode.sdkUninitialized](#oloerrorcode)
* - [OloErrorCode.googlePayInvalidSetup](#oloerrorcode) **_(Android only)_**
* - [OloErrorCode.unexpectedError](#oloerrorcode) **_(Android only)_**
*
* @param digitalWalletConfig The new configuration settings for digital wallets. See [DigitalWalletConfig](#digitalwalletconfig) for more details.
*/
updateDigitalWalletConfig(
digitalWalletConfig: DigitalWalletConfig
): Promise<void>;
/**
* Launch the digital wallet flow and generate a payment method to be used with Olo's Ordering API.
*
* If the promise is rejected, the `code` property of the returned error object will be one of:
* - [OloErrorCode.sdkUninitialized](#oloerrorcode)
* - [OloErrorCode.digitalWalletUninitialized](#oloerrorcode)
* - [OloErrorCode.digitalWalletNotReady](#oloerrorcode)
* - [OloErrorCode.invalidParameter](#oloerrorcode)
* - [OloErrorCode.missingParameter](#oloerrorcode)
* - [OloErrorCode.emptyCompanyLabel](#oloerrorcode)
* - [OloErrorCode.invalidCountyCode](#oloerrorcode)
* - [OloErrorCode.lineItemsTotalMismatch](#oloerrorcode)
* - [OloErrorCode.applePayEmptyMerchantId](#oloerrorcode) **_(iOS only)_**
* - [OloErrorCode.applePayUnsupported](#oloerrorcode) **_(iOS only)_**
* - [OloErrorCode.applePayError](#oloerrorcode) **_(iOS only)_**
* - [OloErrorCode.applePayTimeout](#oloerrorcode) **_(iOS only)_**
* - [OloErrorCode.googlePayNetworkError](#oloerrorcode) **_(Android only)_**
* - [OloErrorCode.googlePayDeveloperError](#oloerrorcode) **_(Android only)_**
* - [OloErrorCode.googlePayInternalError](#oloerrorcode) **_(Android only)_**
* - [OloErrorCode.unexpectedError](#oloerrorcode) **_(Android only)_**
* - [OloErrorCode.generalError](#oloerrorcode)
*
* ```typescript
* try {
* const { paymentMethod } = await createDigitalWalletPaymentMethod({ amount: 5.00 });
* if (paymentMethod === undefined) {
* // User canceled the digital wallet flow
* } else {
* // Send paymentMethod to Olo's Ordering API
* }
* } catch (error) {
* // Handle error
* }
* ```
*
* @param options Options for processing a digital wallet payment.
*/
createDigitalWalletPaymentMethod(
options: DigitalWalletPaymentRequestOptions
): Promise<DigitalWalletPaymentMethodResult>;
/**
* Check if the Olo Pay SDK has been initialized
*/
isInitialized(): Promise<InitializationStatus>;
/**
* Check if digital wallets have been initialized. On iOS, digital wallets are initialized when the SDK is initialized, so this method
* will behave the same as `isInitialized()`. On Android, a separate call to `initializeGooglePay()` is required to initialize digital wallets.
*/
isDigitalWalletInitialized(): Promise<InitializationStatus>;
/**
* Check if digital wallets are ready to be used. Events are emitted whenever the digital wallet status
* changes, so listenting to that event can be used instead of calling this method, if desired.
*/
isDigitalWalletReady(): Promise<DigitalWalletStatus>;
}
/** Type alias representing options for a digital wallet payment method request */
export type DigitalWalletPaymentRequestOptions =
| GooglePayPaymentRequestOptions
| ApplePayPaymentRequestOptions;
/**
* Type alias representing a digital wallet payment method result.
*
* | Property | Description |
* | -------- | ----------- |
* | `paymentMethod` | The payment method generated by the digital wallet flow, or `undefined` if the user canceled the flow |
*/
export type DigitalWalletPaymentMethodResult = {
paymentMethod?: PaymentMethod;
};
/**
* Options for intializing digital wallets
* | Property | Description | Default |
* | -------- | ----------- | ------- |
* | `countryCode` | A two character country code for the vendor that will be processing the payment | 'US' |
* | `currencyCode` | Currency code to be used for transactions | `CurrencyCode.usd` |
* | `companyLabel` | The company display name | - |
* | `emailRequired` | Whether an email will be collected and returned when processing transactions | `false` |
* | `fullNameRequired` | Whether a full name will be collected and returned when processing transactions | `false` |
* | `fullBillingAddressRequired` | Whether a full billing address will be collected and returned when processing transactions | `false` |
* | `phoneNumberRequired` | Whether a phone number will be collected and returned when processing transactions | `false` |
* | `initializeApplePay` | Whether Apple Pay should be initialized. | - |
* | `initializeGooglePay` | Whether Google Pay should be initialized. | - |
* | `applePayConfig` | Configuration options for initializing Apple Pay. Required if `initializeApplePay` is `true` | - |
* | `googlePayConfig` | Configuration options for initializing Google Pay. Required if `initializeGooglePay` is `true` | - |
*
* **Note:** If Apple Pay or Google Pay were previously initialized and the respective initialize property (`initializeApplePay` or `initializeGooglePay`) is set to `false`, this will not uninitialize digital wallets and will result in a no-op.
*
*/
export type DigitalWalletConfig = {
companyLabel: string;
countryCode?: string;
currencyCode?: CurrencyCode;
emailRequired?: boolean;
phoneNumberRequired?: boolean;
fullNameRequired?: boolean;
fullBillingAddressRequired?: boolean;
initializeApplePay: boolean;
initializeGooglePay: boolean;
applePayConfig?: ApplePayConfig;
googlePayConfig?: GooglePayConfig;
};
/**
* Options for initializing Apple Pay
* | Property | Description | Default |
* | -------- | ----------- | ------- |
* | `fullPhoneticNameRequired` | Whether a full phonetic name will be collected and returned when processing transactions | `false` |
* | `merchantId` | The merchant id registered with Apple for Apple Pay | - |
*/
export type ApplePayConfig = {
fullPhoneticNameRequired?: boolean;
merchantId: string;
};
/**
* Options for intializing Google Pay
* | Property | Description | Default |
* | -------- | ----------- | ------- |
* | `productionEnvironment` | Whether Google Pay will use the production environment | `true` |
* | `existingPaymentMethodRequired` | Whether an existing saved payment method is required for Google Pay to be considered ready | `false` |
* | `currencyMultiplier` | Multiplier to convert the amount to the currency's smallest unit (e.g. $2.34 * 100 = 234 cents) | `100` |
*/
export type GooglePayConfig = {
productionEnvironment?: boolean;
existingPaymentMethodRequired?: boolean;
currencyMultiplier?: number;
};
/**
* Type alias representing currency codes supported by Olo Pay.
*/
export type CurrencyCode = 'USD' | 'CAD';
/**
* Options for requesting a payment method via Google Pay
* | Property | Description | Default |
* | -------- | ----------- | ------- |
* | `amount` | The amount to be charged | - |
* | `checkoutStatus` | The checkout status to be used for the transaction | `FinalImmediatePurchase` |
* | `totalPriceLabel` | A custom value to override the default total price label in the Google Pay sheet | - |
* | `lineItems` | A list of line items to be displayed in the digital wallet payment sheet | - |
* | `validateLineItems` | Whether or not to validate the line items. If `true`, [createDigitalWalletPaymentMethod](#createdigitalwalletpaymentmethod) will throw an exception if the sum of the line items does not equal the total amount passed in. If no line items are provided, this parameter is ignored. | `true` |
*/
export type GooglePayPaymentRequestOptions = {
amount: number;
checkoutStatus?: GooglePayCheckoutStatus;
totalPriceLabel?: string;
lineItems?: LineItem[];
validateLineItems?: boolean;
};
export enum GooglePayCheckoutStatus {
/** Represents an estimated price (meaning it's not final and could change) and the default checkout option. The confirmation button will display "Continue". */
estimatedDefault = 'EstimatedDefault',
/** Represents the final price of the transaction and the default checkout option. The confirmation button will display "Continue". */
finalDefault = 'FinalDefault',
/** Represents the final price of the transaction and the immediate checkout option. The confirmation button will display "Pay Now". */
finalImmediatePurchase = 'FinalImmediatePurchase',
}
/**
* Options for requesting a payment method via Apple Pay
* | Property | Description | Default |
* | -------- | ----------- | ------- |
* | `amount` | The amount to be charged | - |
* | `lineItems` | A list of line items to be displayed in the digital wallet payment sheet | - |
* | `validateLineItems` | Whether or not to validate the line items. If `true`, [createDigitalWalletPaymentMethod](#createdigitalwalletpaymentmethod) will throw an exception if the sum of the line items does not equal the total amount passed in. If no line items are provided, this parameter is ignored. | `true` |
*/
export type ApplePayPaymentRequestOptions = {
amount: number;
lineItems?: LineItem[];
validateLineItems?: boolean;
};
/**
* Represents the status of digital wallets.
* | Property | Description |
* | -------- | ----------- |
* | `isReady` | `true` if digital wallets are ready to be used, `false` otherwise |
*/
export type DigitalWalletStatus = {
isReady: boolean;
};
/**
* Represents the status for SDK initialization
* | Property | Description |
* | -------- | ----------- |
* | `isInitialized` | `true` if the SDK is initialized, `false` otherwise |
*/
export type InitializationStatus = {
isInitialized: boolean;
};
/**
* 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. Will always have the same value as `billingAddress.postalCode` |
* | `countryCode` | Two character country code. Will always have the same value as `billingAddress.countryCode` |
* | `isDigitalWallet` | `true` if this payment method was created by digital wallets (e.g. Apple Pay or Google Pay), `false` otherwise |
* | `productionEnvironment` | `true` if this payment method was created in the production environment, `false` otherwise |
* | `email` | The email address associated with the transaction, or an empty string if unavailable. Only provided for digital wallet payment methods (see `isDigitalWallet`) |
* | `digitalWalletCardDescription` | The description of the card, as provided by Apple or Google. Only provided for digital wallet payment methods (see `isDigitalWallet`) |
* | `billingAddress` | The billing address associated with the transaction. The country code and postal code fields will always have a non-empty value. Other fields will only have non-empty values for digital wallet payment methods (see `isDigitalWallet`) |
* | `fullName` | The full name associated with the transaction. Will only have a non-empty value for digital wallet payment methods (see `isDigitalWallet`) |
* | `fullPhoneticName` | The full phonetic name associated with the transaction. Will only have a non-empty value for digital wallet payment methods (see `isDigitalWallet`) **_(iOS only)_** |
*/
export type PaymentMethod = {
id: string;
last4: string;
cardType: CardType;
expMonth: number;
expYear: number;
postalCode: string;
countryCode: string;
isDigitalWallet: boolean;
productionEnvironment: boolean;
email: string;
digitalWalletCardDescription: string;
billingAddress: Address;
fullName: string;
fullPhoneticName: string;
phoneNumber: string;
};
/**
* Represents an address. Currently only used for digital wallets, if billing address details are requested to be returned in the
* generated digital wallet payment method.
*
* | Property | Description |
* | -------- | ----------- |
* | `address1` | The first line of the address |
* | `address2` | The second line of the address, or an empty string |
* | `address3` | The third line of the address, or an empty string |
* | `postalCode` | The postal or zip code |
* | `countryCode` | The two digit ISO country code |
* | `administrativeArea` | A country subdivision, such as a state or province |
*/
export type Address = {
address1: string;
address2: string;
address3: string;
locality: string;
postalCode: string;
countryCode: string;
administrativeArea: string;
};
// SEE DOCUMENTATION IN README.MD
export type CvvUpdateToken = {
id?: string;
productionEnvironment?: boolean;
};
export enum CardType {
/** Visa credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
visa = 'Visa',
/** American Express credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
amex = 'Amex',
/** Mastercard credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
mastercard = 'Mastercard',
/** Discover credit card type. Pass the string value of this into the Olo Ordering API when submitting orders */
discover = 'Discover',
/** Unsupported credit card type. Passing this to the Olo Ordering API will result in an error */
unsupported = 'Unsupported',
/** Unknown credit card type. Passing this to the Olo Ordering API will result in an error */
unknown = 'Unknown',
}
// SEE DOCUMENTATION IN README.MD
export enum OloErrorCode {
apiError = 'ApiError',
applePayEmptyMerchantId = 'ApplePayEmptyMerchantId',
applePayError = 'ApplePayError',
applePayTimeout = 'ApplePayTimeout',
applePayUnsupported = 'ApplePayUnsupported',
authenticationError = 'AuthenticationError',
cancellationError = 'CancellationError',
cardDeclined = 'CardDeclined',
connectionError = 'ConnectionError',
digitalWalletNotReady = 'DigitalWalletNotReady',
digitalWalletUninitialized = 'DigitalWalletUninitialized',
emptyCompanyLabel = 'EmptyCompanyLabel',
expiredCard = 'ExpiredCard',
generalError = 'generalError',
googlePayDeveloperError = 'GooglePayDeveloperError',
googlePayInternalError = 'GooglePayInternalError',
googlePayInvalidSetup = 'GooglePayInvalidSetup',
googlePayNetworkError = 'GooglePayNetworkError',
invalidCardDetails = 'InvalidCardDetails',
invalidCountryCode = 'InvalidCountryCode',
invalidCvv = 'InvalidCVV',
invalidExpiration = 'InvalidExpiration',
invalidNumber = 'InvalidNumber',
invalidParameter = 'InvalidParameter',
invalidPostalCode = 'InvalidPostalCode',
invalidRequest = 'InvalidRequest',
lineItemsTotalMismatch = 'LineItemsTotalMismatch',
missingParameter = 'MissingParameter',
processingError = 'ProcessingError',
sdkUninitialized = 'SdkUninitialized',
unexpectedError = 'UnexpectedError',
unknownCard = 'UnknownCard',
viewNotFound = 'ViewNotFound',
}
// SEE DOCUMENTATION IN README.MD
export type OloError = {
code: string;
message: string;
};
// SEE DOCUMENTATION IN README.MD
export type PaymentMethodResult = {
paymentMethod?: PaymentMethod;
error?: OloError;
};
// SEE DOCUMENTATION IN README.MD
export type CvvTokenResult = {
token?: CvvUpdateToken;
error?: OloError;
};
// SEE DOCUMENTATION IN README.MD
export const DigitalWalletReadyEvent = 'digitalWalletReadyEvent';
// SEE DOCUMENTATION IN README.MD
export type PaymentCardDetailsPlaceholders = {
number?: string;
expiration?: string;
cvv?: string;
postalCode?: string;
};
// SEE DOCUMENTATION IN README.MD
export type PaymentCardDetailsViewStyles = {
borderWidth?: number;
borderColor?: string;
backgroundColor?: string;
cornerRadius?: number;
cursorColor?: string;
errorTextColor?: string;
fontSize?: number;
fontFamily?: string;
fontWeight?: FontWeight;
italic?: boolean;
textPaddingLeft?: number;
textPaddingRight?: number;
placeholderColor?: string;
styles?: StyleProp<ViewStyle>;
textColor?: string;
};
// SEE DOCUMENTATION IN README.MD
export type PaymentCardDetailsFormStyles = {
styles?: StyleProp<ViewStyle>;
backgroundColor?: string;
cursorColor?: string;
borderColor?: string;
borderWidth?: number;
cornerRadius?: number;
textPaddingLeft?: number;
textPaddingRight?: number;
fieldDividerWidth?: number;
fieldDividerColor?: string;
cardElevation?: number;
textColor?: string;
placeholderColor?: string;
focusedPlaceholderColor?: string;
fontSize?: number;
fontFamily?: string;
fontWeight?: FontWeight;
italic?: boolean;
};
// SEE DOCUMENTATION IN README.MD
export interface PaymentCardDetailsViewProps {
componentStyles?: StyleProp<ViewStyle>;
errorStyles?: StyleProp<TextStyle>;
cardStyles?: PaymentCardDetailsViewStyles;
customErrorMessages?: CustomErrorMessages;
viewProps?: ViewProps;
postalCodeEnabled?: boolean;
disabled?: boolean;
displayErrorMessages?: boolean;
placeholders?: PaymentCardDetailsPlaceholders;
onCardChange?(card: CardDetails): void;
onFocus?(): void;
onBlur?(): void;
onFocusField?(field: CardField): void;
onPaymentMethodResult?(result: PaymentMethodResult): void;
}
// SEE DOCUMENTATION IN README.MD
export interface PaymentCardDetailsFormProps {
cardStyles?: PaymentCardDetailsFormStyles;
componentStyles?: StyleProp<ViewStyle>;
disabled?: boolean;
onFormComplete?(cardValidationStatus: CardValidationStatus): void;
viewProps?: ViewProps;
placeholders?: PaymentCardDetailsPlaceholders;
onPaymentMethodResult?(result: PaymentMethodResult): void;
}
// SEE DOCUMENTATION IN README.MD
export type PaymentCardCvvViewStyles = {
backgroundColor?: string;
borderColor?: string;
borderWidth?: number;
cornerRadius?: number;
cursorColor?: string;
fontFamily?: string;
fontSize?: number;
placeholderColor?: string;
textColor?: string;
errorTextColor?: string;
textPaddingLeft?: number;
textPaddingRight?: number;
fontWeight?: FontWeight;
italic?: boolean;
styles?: StyleProp<ViewStyle>;
textAlign?: 'left' | 'center' | 'right';
};
// SEE DOCUMENTATION IN README.MD
export interface PaymentCardCvvViewProps {
componentStyles?: StyleProp<ViewStyle>;
cvvStyles?: PaymentCardCvvViewStyles;
errorStyles?: StyleProp<TextStyle>;
customErrorMessages?: CustomFieldError;
displayErrorMessages?: boolean;
disabled?: boolean;
placeholder?: string;
viewProps?: ViewProps;
onCvvChange?(cvvDetails: CvvDetails): void;
onFocus?(cvvDetails: CvvDetails): void;
onBlur?(cvvDetails: CvvDetails): void;
onCvvTokenResult?(result: CvvTokenResult): void;
}
// SEE DOCUMENTATION IN README.MD
export interface PaymentCardDetailsViewMethods {
focus(field?: CardField): void;
blur(): void;
clear(): void;
createPaymentMethod(): void;
}
// SEE DOCUMENTATION IN README.MD
export interface PaymentCardDetailsFormMethods {
blur(): void;
clear(): void;
createPaymentMethod(): void;
focus(field?: CardField): void;
}
// SEE DOCUMENTATION IN README.MD
export interface PaymentCardCvvViewMethods {
blur(): void;
clear(): void;
createCvvUpdateToken(): void;
focus(): void;
}
// SEE DOCUMENTATION IN README.MD
export enum CardField {
number = 'number',
expiration = 'expiration',
cvv = 'cvv',
postalCode = 'postalCode',
}
// SEE DOCUMENTATION IN README.MD
export interface CardDetails extends CardValidationStatus {
cardType: CardType;
invalidFields?: CardField[];
emptyFields?: CardField[];
errors?: {
editedFieldsError?: string;
allFieldsError?: string;
};
}
// SEE DOCUMENTATION IN README.MD
export interface FieldState {
isValid: boolean;
isFocused: boolean;
isEmpty: boolean;
wasEdited: boolean;
wasFocused: boolean;
}
// SEE DOCUMENTATION IN README.MD
export interface CvvDetails {
state: FieldState;
errors?: {
editedFieldError?: string;
uneditedFieldError?: string;
};
}
// SEE DOCUMENTATION IN README.MD
export interface CardValidationStatus {
isValid: boolean;
}
// SEE DOCUMENTATION IN README.MD
export interface CustomErrorMessages {
number?: CustomFieldError;
expiration?: CustomFieldError;
cvv?: CustomFieldError;
postalCode?: CustomFieldError;
unsupportedCardError?: string;
}
// SEE DOCUMENTATION IN README.MD
export interface CustomFieldError {
emptyError?: string;
invalidError?: string;
}
/**
* Represents a line item in a digital wallet transaction
*
* | Property | Description |
* | -------- | ----------- |
* | `label` | The label of the line item |
* | `amount` | The amount of the line item |
* | `type` | Enum representing the type of a line item in a digital wallet transaction |
* | `status` | Enum representing the status of a line item. If not provided, default value is `LineItemStatus.final` |
*/
export type LineItem = {
label: string;
amount: number;
type: LineItemType;
status?: LineItemStatus;
};
export enum LineItemType {
/** Represents a subtotal line item in a digital wallet transaction */
subtotal = 'Subtotal',
/** Represents a line item in a digital wallet transaction */
lineItem = 'LineItem',
/** Represents a tax line item in a digital wallet transaction */
tax = 'Tax',
}
export enum LineItemStatus {
/** Indicates that the price is final and has no variance */
final = 'Final',
/** Indicates that the price is pending and may change. On iOS this will cause the amount to appear as an elipsis ("...") */
pending = 'Pending',
}
// SEE DOCUMENTATION IN README.MD
export enum FontWeight {
ultraLight = '100',
thin = '200',
light = '300',
regular = '400',
medium = '500',
semiBold = '600',
bold = '700',
extraBold = '800',
black = '900',
}
// SEE DOCUMENTATION IN README.MD
export enum ApplePayButtonStyle {
automatic = 'automatic',
black = 'black',
white = 'white',
whiteOutline = 'whiteOutline',
}
// SEE DOCUMENTATION IN README.MD
export enum ApplePayButtonType {
addMoney = 'addMoney',
book = 'book',
buy = 'buy',
checkout = 'checkout',
continue = 'continue',
contribute = 'contribute',
donate = 'donate',
inStore = 'inStore',
order = 'order',
pay = 'inStore', //Intentionally maps to inStore
plain = 'plain',
reload = 'reload',
rent = 'rent',
setUp = 'setUp',
subscribe = 'subscribe',
support = 'support',
tip = 'tip',
topUp = 'topUp',
}
// SEE DOCUMENTATION IN README.MD
export enum GooglePayButtonTheme {
dark = 'dark',
light = 'light',
}
// SEE DOCUMENTATION IN README.MD
export enum GooglePayButtonType {
book = 'book',
buy = 'buy',
checkout = 'checkout',
donate = 'donate',
order = 'order',
pay = 'pay',
plain = 'plain',
subscribe = 'subscribe',
}
// SEE DOCUMENTATION IN README.MD
export interface ApplePayButtonConfig {
cornerRadius?: number;
style?: ApplePayButtonStyle;
type?: ApplePayButtonType;
}
// SEE DOCUMENTATION IN README.MD
export interface GooglePayButtonConfig {
cornerRadius?: number;
theme?: GooglePayButtonTheme;
type?: GooglePayButtonType;
}
// SEE DOCUMENTATION IN README.MD
export interface DigitalWalletButtonProps {
applePayConfig?: ApplePayButtonConfig;
googlePayConfig?: GooglePayButtonConfig;
disabled?: boolean;
onPress(): void;
styles?: StyleProp<ViewStyle>;
}