@olo/pay-capacitor
Version:
Olo Pay SDK Capacitor Plugin
409 lines • 19.5 kB
JSON
{
"api": {
"name": "OloPaySDKPlugin",
"slug": "olopaysdkplugin",
"docs": "",
"tags": [],
"methods": [
{
"name": "initialize",
"signature": "(options: AndroidInitializationOptions | iOSInitializationOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "Initialization options",
"type": "OloPayInitializationConfig | iOSInitializationOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options Initialization options"
}
],
"docs": "Initialize the Olo Pay SDK. The SDK must be initialized prior to calling other methods.\n\nThis promise will only be rejected on iOS. If it is rejected the `code` property on the returned\nerror will be [`PromiseRejectionCode.missingParameter`](#promiserejectioncode)\n\n_**NOTE:**_ On iOS, this method will also initialize Apple Pay and a [`DigitalWalletReadyEvent`](#digitalwalletreadyevent)\nwill be emitted when it is ready to process payments. On Android, a separate initialization\ncall to `initializeGooglePay()` is required.",
"complexTypes": [
"AndroidInitializationOptions",
"iOSInitializationOptions"
],
"slug": "initialize"
},
{
"name": "initializeInternal",
"signature": "(options: InternalInitOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "",
"type": "InternalInitOptions"
}
],
"returns": "Promise<void>",
"tags": [],
"docs": "Used internally by the Olo Pay SDK Plugin. Calling this method manually\nwill result in a no-op",
"complexTypes": [
"InternalInitOptions"
],
"slug": "initializeinternal"
},
{
"name": "initializeGooglePay",
"signature": "(options: GooglePayInitializationOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "Options for initializing digital wallets. _`countryCode` and `merchantName` are required options._",
"type": "GooglePayInitializationOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options Options for initializing digital wallets. _`countryCode` and `merchantName` are required options._"
}
],
"docs": "_**ANDROID ONLY:** If this method is called on iOS the promise will be rejected_\n\nInitialize digital wallets. This must be called after initializing the SDK. When digital wallets\nare ready, a [`DigitalWalletReadyEvent`](#digitalwalletreadyevent) will be emitted.\n\nIf the promise is rejected, possible values of the `code` property on the returned error will be one of:\n- [PromiseRejectionCode.unimplemented (iOS)](#promiserejectioncode)\n- [PromiseRejectionCode.missingParameter](#promiserejectioncode)\n- [PromiseRejectionCode.sdkUninitialized](#promiserejectioncode)",
"complexTypes": [
"GooglePayInitializationOptions"
],
"slug": "initializegooglepay"
},
{
"name": "changeGooglePayVendor",
"signature": "(options: ChangeGooglePayVendorOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "Options for changing the country and merchant name. _`countryCode` and `merchantName` are required options._",
"type": "ChangeGooglePayVendorOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options Options for changing the country and merchant name. _`countryCode` and `merchantName` are required options._"
}
],
"docs": "_**ANDROID ONLY:** If this method is called on iOS the promise will be rejected_\n\nCall this to change the country and merchant name used for processing Google Pay payments. This will immediately\ntrigger a [`DigitalWalletReadyEvent`](#digitalwalletreadyevent) indicating digital wallets are not ready. When Google Pay\nhas been reinitialized and is ready to be used with the new parameters, another event will be emitted.\n\n_**NOTE:** If other options need to be changed besides country code and merchant name you can call \n `initializeGooglePay()` instead, but it is more expensive than calling this method._\n\nIf the promise is rejected, possible values of the `code` property on the returned error will be one of:\n- [PromiseRejectionCode.unimplemented (iOS)](#promiserejectioncode)\n- [PromiseRejectionCode.missingParameter](#promiserejectioncode)\n- [PromiseRejectionCode.sdkUninitialized](#promiserejectioncode)\n- [PromiseRejectionCode.googlePayUninitialized](#promiserejectioncode)",
"complexTypes": [
"ChangeGooglePayVendorOptions"
],
"slug": "changegooglepayvendor"
},
{
"name": "getDigitalWalletPaymentMethod",
"signature": "(options: DigitalWalletPaymentRequestOptions) => Promise<DigitalWalletPaymentMethodResult | undefined>",
"parameters": [
{
"name": "options",
"docs": "Options for processing a digital wallet payment. _`amount` is a required option_",
"type": "DigitalWalletPaymentRequestOptions"
}
],
"returns": "Promise<DigitalWalletPaymentMethodResult | undefined>",
"tags": [
{
"name": "param",
"text": "options Options for processing a digital wallet payment. _`amount` is a required option_"
}
],
"docs": "Launch the digital wallet flow and generate a payment method to be used with Olo's Ordering API.\n\nIf the promise is rejected, the `code` property of the returned error object will be one of:\n- [PromiseRejectionCode.sdkUninitialized](#promiserejectioncode)\n- [PromiseRejectionCode.invalidParameter](#promiserejectioncode)\n- [PromiseRejectionCode.missingParameter](#promiserejectioncode)\n- [PromiseRejectionCode.applePayUnsupported (iOS)](#promiserejectioncode)\n- [PromiseRejectionCode.googlePayNotReady (Android)](#promiserejectioncode)\n- [PromiseRejectionCode.googlePayUninitialized (Android)](#promiserejectioncode)\n- [PromiseRejectionCode.generalError](#promiserejectioncode)",
"complexTypes": [
"DigitalWalletPaymentMethodResult",
"DigitalWalletPaymentRequestOptions"
],
"slug": "getdigitalwalletpaymentmethod"
},
{
"name": "isInitialized",
"signature": "() => Promise<InitializationStatus>",
"parameters": [],
"returns": "Promise<InitializationStatus>",
"tags": [],
"docs": "Check if the Olo Pay SDK has been initialized",
"complexTypes": [
"InitializationStatus"
],
"slug": "isinitialized"
},
{
"name": "isDigitalWalletInitialized",
"signature": "() => Promise<InitializationStatus>",
"parameters": [],
"returns": "Promise<InitializationStatus>",
"tags": [],
"docs": "Check if digital wallets have been initialized. On iOS, digital wallets are initialized when the SDK is initialized, so this method\nwill behave the same as `isInitialized()`. On Android, a separate call to `initializeGooglePay()` is required to initialize digital wallets.",
"complexTypes": [
"InitializationStatus"
],
"slug": "isdigitalwalletinitialized"
},
{
"name": "isDigitalWalletReady",
"signature": "() => Promise<DigitalWalletStatus>",
"parameters": [],
"returns": "Promise<DigitalWalletStatus>",
"tags": [],
"docs": "Check if digital wallets are ready to be used. Events are emitted whenever the digital wallet status\nchanges, so listenting to that event can be used instead of calling this method, if desired.",
"complexTypes": [
"DigitalWalletStatus"
],
"slug": "isdigitalwalletready"
}
],
"properties": []
},
"interfaces": [],
"enums": [
{
"name": "DigitalWalletType",
"slug": "digitalwallettype",
"members": [
{
"name": "applePay",
"value": "'applePay'",
"tags": [],
"docs": ""
},
{
"name": "googlePay",
"value": "'googlePay'",
"tags": [],
"docs": ""
}
]
},
{
"name": "GooglePayErrorType",
"slug": "googlepayerrortype",
"members": [
{
"name": "networkError",
"value": "'NetworkError'",
"tags": [],
"docs": "Google Pay didn't succeed due to a network error"
},
{
"name": "developerError",
"value": "'DeveloperError'",
"tags": [],
"docs": "Google Pay didn't succeed due to developer error"
},
{
"name": "internalError",
"value": "'InternalError'",
"tags": [],
"docs": "Google Pay didn't succeed due to an internal error"
}
]
}
],
"typeAliases": [
{
"name": "AndroidInitializationOptions",
"slug": "androidinitializationoptions",
"docs": "Options for initializing the Android Olo Pay SDK. This is a type alias for code readability.",
"types": [
{
"text": "OloPayInitializationConfig",
"complexTypes": [
"OloPayInitializationConfig"
]
}
]
},
{
"name": "OloPayInitializationConfig",
"slug": "olopayinitializationconfig",
"docs": "Options for initializing the Olo Pay SDK \n| Property | Description | Default |\n| -------- | ----------- | ------- |\n| `productionEnvironment` | `true` to use the production environment, `false` for the test environment. | `true` |",
"types": [
{
"text": "{\n productionEnvironment?: boolean;\n}",
"complexTypes": []
}
]
},
{
"name": "iOSInitializationOptions",
"slug": "iosinitializationoptions",
"docs": "Options for initializing the iOS Olo Pay SDK. This is a type alias for code readability",
"types": [
{
"text": "OloPayInitializationConfig & ApplePayInitializationConfig",
"complexTypes": [
"OloPayInitializationConfig",
"ApplePayInitializationConfig"
]
}
]
},
{
"name": "ApplePayInitializationConfig",
"slug": "applepayinitializationconfig",
"docs": "Options for initializing Apple Pay \n| Property | Description |\n| -------- | ----------- |\n| `applePayMerchantId` | The merchant id registered with Apple for Apple Pay |\n| `applePayCompanyLabel` | The company name that will be displayed on the Apple Pay payment sheet |",
"types": [
{
"text": "{\n applePayMerchantId: string;\n applePayCompanyLabel: string;\n}",
"complexTypes": []
}
]
},
{
"name": "InternalInitOptions",
"slug": "internalinitoptions",
"docs": "Used internally by the Olo Pay SDK Plugin",
"types": [
{
"text": "{\n version: string;\n buildType: string;\n}",
"complexTypes": []
}
]
},
{
"name": "GooglePayInitializationOptions",
"slug": "googlepayinitializationoptions",
"docs": "Options for intializing Google Pay \n| Property | Description | Default |\n| -------- | ----------- | ------- |\n| `googlePayProductionEnvironment` | `true` to use the production environment, `false` for the test environment | `true` |\n| `countryCode` | A two character country code for the vendor that will be processing the payment | - |\n| `merchantName` | The merchant/vendor display name | - |\n| `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` |\n| `existingPaymentMethodRequired` | Whether an existing saved payment method is required for Google Pay to be considered ready | `true` |\n| `emailRequired` | Whether Google Pay collects an email when processing payments | `false` |\n| `phoenNumberRequired` | Whether Google Pay collects a phone number when processing payments | `false` |",
"types": [
{
"text": "{\n googlePayProductionEnvironment?: boolean;\n countryCode: string;\n merchantName: string;\n fullAddressFormat?: boolean;\n existingPaymentMethodRequired?: boolean;\n emailRequired?: boolean;\n phoneNumberRequired?: boolean;\n}",
"complexTypes": []
}
]
},
{
"name": "ChangeGooglePayVendorOptions",
"slug": "changegooglepayvendoroptions",
"docs": "Options for changing the country code or merchant name for Google Pay transactions\n| Property | Description |\n| -------- | ----------- |\n| `countryCode` | A two character country code for the vendor that will be processing the payment |\n| `merchantName` | The merchant/vendor display name |",
"types": [
{
"text": "{\n countryCode: string;\n merchantName: string;\n}",
"complexTypes": []
}
]
},
{
"name": "DigitalWalletPaymentMethodResult",
"slug": "digitalwalletpaymentmethodresult",
"docs": "Type alias representing a digital wallet payment method result. The\nobject will either contain payment method data or error data.",
"types": [
{
"text": "{ paymentMethod: PaymentMethod; error?: undefined; }",
"complexTypes": [
"PaymentMethod"
]
},
{
"text": "{ paymentMethod?: undefined; error: DigitalWalletError }",
"complexTypes": [
"DigitalWalletError"
]
}
]
},
{
"name": "PaymentMethod",
"slug": "paymentmethod",
"docs": "Payment method used for submitting payments to Olo's Ordering API \n| Property | Description |\n| -------- | ----------- |\n| `id` | The payment method id. This should be set to the token field when submitting a basket |\n| `last4` | The last four digits of the card |\n| `cardType` | The issuer of the card |\n| `expMonth` | Two-digit number representing the card's expiration month |\n| `expYear` | Four-digit number representing the card's expiration year |\n| `postalCode` | Zip or postal code |\n| `countryCode` | Two character country code |\n| `isDigitalWallet` | `true` if this payment method was created by digital wallets (e.g. Apple Pay or Google Pay), `false` otherwise |\n| `productionEnvironment` | Whether or not this payment method was created in the production environment |",
"types": [
{
"text": "{\n id?: string;\n last4?: string;\n cardType?: string;\n expMonth?: number;\n expYear?: number;\n postalCode?: string;\n countryCode?: string;\n isDigitalWallet: boolean;\n productionEnvironment: boolean;\n}",
"complexTypes": []
}
]
},
{
"name": "DigitalWalletError",
"slug": "digitalwalleterror",
"docs": "Type representing a digital wallet error \n| Property | Description |\n| -------- | ----------- |\n| `errorMessage` | Error message indicating what went wrong |\n| `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` |",
"types": [
{
"text": "{\n errorMessage: string;\n digitalWalletType: DigitalWalletType;\n} & (GooglePayError | null)",
"complexTypes": [
"DigitalWalletType",
"GooglePayError"
]
}
]
},
{
"name": "GooglePayError",
"slug": "googlepayerror",
"docs": "Type representing specific error types that can occur while processing a Google Pay transaction \n| Property | Description |\n| -------- | ----------- |\n| `googlePayErrorType` | The type of error that occurred. See `GooglePayErrorType` |",
"types": [
{
"text": "{\n googlePayErrorType: GooglePayErrorType;\n}",
"complexTypes": [
"GooglePayErrorType"
]
}
]
},
{
"name": "DigitalWalletPaymentRequestOptions",
"slug": "digitalwalletpaymentrequestoptions",
"docs": "Type alias representing options for a digital wallet payment method request",
"types": [
{
"text": "GooglePayPaymentRequestOptions",
"complexTypes": [
"GooglePayPaymentRequestOptions"
]
},
{
"text": "ApplePayPaymentRequestOptions",
"complexTypes": [
"ApplePayPaymentRequestOptions"
]
}
]
},
{
"name": "GooglePayPaymentRequestOptions",
"slug": "googlepaypaymentrequestoptions",
"docs": "Options for requesting a payment method via Google Pay \n| Property | Description | Default |\n| -------- | ----------- | ------- |\n| `amount` | The amount to be charged | - |\n| `currencyCode` | A three character currency code for the transaction | 'USD' |\n| `currencyMulitplier` | Multiplier to convert the amount to the currency's smallest currency unit (e.g. $2.34 * 100 = 234 cents) | 100 |\n\n_**IMPORTANT:** The amount charged will be equivalent to `amount * currencyCode` so ensure these are set properly_",
"types": [
{
"text": "{\n amount: number;\n currencyCode?: string;\n currencyMultiplier?: number;\n}",
"complexTypes": []
}
]
},
{
"name": "ApplePayPaymentRequestOptions",
"slug": "applepaypaymentrequestoptions",
"docs": "Options for requesting a payment method via Apple Pay \n| Property | Description | Default |\n| -------- | ----------- | ------- |\n| `amount` | The amount to be charged | - |\n| `currencyCode` | A three character currency code for the transaction | 'USD' |\n| `countryCode` | A two character country code | 'US' |",
"types": [
{
"text": "{\n amount: number;\n countryCode?: string;\n currencyCode?: string;\n}",
"complexTypes": []
}
]
},
{
"name": "InitializationStatus",
"slug": "initializationstatus",
"docs": "Represents the initialization status of digital wallets\n| Property | Description |\n| -------- | ----------- |\n| `isInitialized` | `true` if the SDK has been initialized, `false` otherwise |",
"types": [
{
"text": "{\n isInitialized: boolean\n}",
"complexTypes": []
}
]
},
{
"name": "DigitalWalletStatus",
"slug": "digitalwalletstatus",
"docs": "Represents the status of digital wallets\n| Property | Description |\n| -------- | ----------- |\n| `isReady` | `true` if digital wallets are ready to be used, `false` otherwise |",
"types": [
{
"text": "{\n isReady: boolean\n}",
"complexTypes": []
}
]
}
],
"pluginConfigs": []
}