In-App-Payments SDK

Install In-App Payments SDK

Add the In-App-Payments SDK to your mobile developement environment.

Android
iOS
UI
In-App Payments SDK
Java (Android)

To use the example code in this guide, make sure you have the following information available:

  • Your application ID. Find your application ID on the Credentials setting page of your Square application.

Did you know?

The In-App Payments SDK is supported in v2 Sandbox.

Step 1: Add the In-App Payments SDK dependency
Permalink Get a link to this section

  1. Add the Square SDK public repository in the build.gradle file for your project.

repositories {
   google()
   maven {
     url 'https://sdk.squareup.com/public/android'
   }
 }
  1. Add a compile option to support Java version 1.8 in the build.gradle file for your :app module.

android {
   ...

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
   ...
}
  1. Add the In-App Payments SDK dependency to the module build.gradle file.

dependencies {
  implementation "com.squareup.sdk.in-app-payments:card-entry:1.3.0"
}
  1. Update the ProGuard-rules.pro file in the solution app folder to apply rules to In-App Payment SDK classes:

-keep class sqip.** { *; }

Step 2: Configure the In-App Payments SDK
Permalink Get a link to this section

To configure the In-App Payments SDK, you must set the Square Application ID for your application in AndroidManifest.xml. Open the AndroidManifest.xml file for your app gradle module and add the following XML to set the application ID.

Important

For testing an app in the v2 Sandbox: In your app Application Dashboard, set the dashboard to Sandbox Settings mode before completing the following instructions in this step.

  1. Copy your Application ID from the Credentials page.

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

  <application
     ...>

    <meta-data
       android:name="sqip.SQUARE_APPLICATION_ID"
       android:value="REPLACE_WITH_YOUR_SQUARE_APPLICATION_ID"/>
  </application>
</manifest>

Next steps

Now that In-App Payments SDK is installed, follow one of these build guides to add it to your mobile app.