You can initialise the TyroSDK using our provider component as seen below.
toggles between the live and sandbox environments
See Style Guide page to learn more
See Style Guide page to learn more
configuration options for wallet and credit card payments.
Toggles whether Apple Pay is enabled. Defaults to false.
merchant identifier required for Apple Pay.
the label required for Apple Pay to be displayed next to the amount.
Optional array of supported card types for Apple Pay. Defaults to support all.
Toggles whether Google Pay is enabled. Defaults to false.
The name of the merchant required for Google Pay.
Optional array of supported card types for Google Pay. Defaults to support all.
An optional object containing properties for customizing the Credit Card Form.
Credit Card Form will be shown when true. Default is true.
Optional array of supported card types for the credit card form. Defaults to support all, and may be limited by your merchant account.
The TyroProvider component is a root level component and accepts the previously described method parameters as props.
This component also optionally supports a styleProp object to customize the appearance.
Please refer to the Style Guide for detailed information about appearance customizations.
// example javascript code for using TyroProvider component
import { TyroProvider } from "@tyro/tyro-pay-api-react-native";
const providerOptions = {
applePay: {
enabled: true,
merchantId: '123456789',
supportedNetworks: ['visa', 'mastercard'],
},
googlePay: {
enabled: true,
merchantName: 'The merchant name',
supportedNetworks: ['visa', 'mastercard'],
},
creditCardForm: {
enabled: true,
supportedNetworks: ['visa', 'mastercard'],
},
}
function App() {
return (
<TyroProvider
options={liveMode: false, options: providerOptions}
>
// Your App Checkout Code wrapped here
</TyroProvider>
);
}