Skip to content
Last updated

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.

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

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

Then install these dependencies

// 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:

// 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.

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

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')