Initialise Tyro React Native SDK
Tyro Initialisation
You can initialise the TyroSDK using our provider component as seen below.
Method Parameters
liveMode required | boolean toggles between the live and sandbox environments | ||||||||||||||||||||||||||||||
theme | string See Style Guide page to learn more | ||||||||||||||||||||||||||||||
styleProps | object See Style Guide page to learn more | ||||||||||||||||||||||||||||||
object configuration options for wallet and credit card payments. | |||||||||||||||||||||||||||||||
|
TyroProvider
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>
);
}