App Payment Gateways

In-App Purchase

Estimated reading: 4 minutes 31 views

Google Play Console Setup

NOTE

If you’re integrating In-App Purhcase for the first time then do follow this instructions below:
– Verfiy that for app level build.gradle consist billing_version and dependency.
– Go to android/app/build.gradle
– Find def billing_version = “x.x.x”. If not then add it below the plugins declaration block

def billing_version = “7.0.0”
– Check for the line below in dependencies block in same file
implementation “com.android.billingclient:billing:$billing_version”

Now create a release bundle and upload it in Playstore inside “Close Testing”.

After this you’ll be able to access Subcriptions in Play Console.

 

Please checkout this link – Gogle Play Console Setup

Note : Skip the step – Add non-consumable products

Appstore Setup

Please checkout this link – iOS App Setup

1. Create a RevenueCat Account

Sign up for a new RevenueCat account here.

Organizations / Enterprise

We recommend using a company account when registering for RevenueCat and setting up your app within a project. You’ll be able to invite the rest of your team as collaborators to your project, but only the project owner can manage billing. Project collaborators can’t manage billing details.

2. Project and App Configuration

▶️ Create a Project

Navigate to the RevenueCat dashboard and add a new project from the dropdown in the top navigation menu called Projects.

▶️ Add an App / Platform

Select the platform for the app you want to add.

▶️ Appstore App Setup

The field App name is required to add your app to RevenueCat. For iOS apps In-App Purchase Key(iOS) is also required. To make test and production purchases, the Bundle ID (iOS) as well as the Shared Secret(iOS) must be configured.

IMPORTANT

If you try making purchases without a bundle ID and valid credentials, the SDK will fail with a ‘receipt is not valid‘ error as RevenueCat will be unable to validate the transaction with the store.

In-App Purchase Key Configuration

How to get App-Specific Shared Secret?

▶️ Android App Setup

The field App name is required to add your app to RevenueCat. To make test and production purchases, the Package Name (Android) as well as the Service Credentials (Android) must be configured.

What to upload as Service Account Credentials JSON?

How to get Play Store Financial Reports Bucket ID?

Obtain API Keys

Create Entitlement

Note – Your all products/subciptions plans should be in single entitlement.
– Create an entitlement with name “default”.

Add Products/Subscription Plans

  • Here you have to import plants you have added on Google Play Console Subscription and Appstore in-app purchase for respective Android and iOS Apps.

After choosing Platform, you’ll get option to import the subcription plans you’ve created in Google Play Console and Appstore. 

IMPORTANT

For iOS “Paid App Agreement” activation is required for importing plans from Appstore.

To activate it open your Appstore and go to Business section.

– Provide necessary details like Bank account and Tax data to Appstore.

After Business configuration you’ll be able to fetch all the plans inside RevenueCat.

Create Offerings

Add Entitlement Id in Admin Panel

Open Admin Panel
– Go to App options -> Settings -> Membership
– Select In-App Payment
– Add Entitlement indetifier into Entitlement ID field.
– Add Android app Public API Key into Google API key
– Add iOS app Public API Key into Apple API key 
– Save the changes

  • You can find Public API Key for both app here in RevenueCat dashboard.

Add Plan Identifiers

  • Open admin panel 
  • Go to “Membership – > Settings”
  • Add identifiers for Playstore and Appstore.
    For that click on edit button below the plan name.
  • For your Free plan use identifier below
    Google Playstore Identifier = free_plan:free-plan
    Apple Appstore Identifier = free_plan

    For other plans add same identifier from Playstore and Appstore Subscriptions you’ve set.
  • Verify Identifiers once just to make sure everythings is proper.
  • Save the changes.
Great! You have successfully configured in-App purchase