Enable Apple Pay and Google Pay

Apple Pay

The following is required to enable the use of Apple Pay in your app:

Create an Apple Merchant Id

You can follow the steps outlined here to create your Apple Merchant Id. Provide Tyro with your newly created Apple Merchant Id.

Create a Payment Processing certificate

In order to create a Payment Processing Certificate you will need to first create a Certificate Signing Request (CSR) file.
Create the key and CSR file by doing the following.

Copy
Copied
Generate a set of ECC Keys: openssl ecparam -out applepay.key -name prime256v1 -genkey
Generate a CSR: openssl req -new -sha256 -key applepay.key -nodes -out applepay.csr -subj '/O=Company/C=US'

You can set the -subj to what you require.

Then create the Payment Processing Certificate using your CSR file. You will then need to download the certificate file (file with .cer extension) and provide this to Tyro along with the key you created when making your CSR file.

You can follow this guide to create a payment processing certificate.

Enable Apple Pay

You will need to enable Apple Pay in Xcode

Pod Setup

Add the following lines to the Podfile in your iOS folder

Copy
Copied
source 'https://github.com/tyro/connect-cocoapods.git'
source 'https://cdn.cocoapods.org/'

Then install these dependencies

Copy
Copied
// navigate to your ios directory to install dependencies
pod install

Google Pay

The following is required to enable the use of Google Pay in your app:

Copy
Copied
// Add to the <application> element of your projects AndroidManifest.xml
<meta-data
  android:name="com.google.android.gms.wallet.api.enabled"
  android:value:"true"
/>

Also add this to your android projects app level gradle file to add the required dependency.

Copy
Copied
allprojects {
  repositories {
      maven {
          url = uri("https://maven.pkg.github.com/tyro/tyro-pay-api-google-pay-sdk-android")
          credentials {
              username = System.getenv("GITHUB_PACKAGES_USER")
              password = System.getenv("GITHUB_PACKAGES_TOKEN")
          }
      }
  }
}

Add this to your android/settings.gradle file

Copy
Copied
include ':tyro_tyro-pay-api-react-native'
project(':tyro_tyro-pay-api-react-native').projectDir = file('../node_modules/@tyro/tyro-pay-api-react-native/android/lib')
Copyright © Tyro Payments 2019-2024. All right reserved.