# Getting Started

The Merchant  PayContactless SDK enables seamless contactless payment and refund operations from your React Native application. The SDK handles payment transaction UI internally, provides  querying of transaction history, daily summaries, and lot more.

Integrators must initialize the SDK early in the app lifecycle to ensure proper transaction handling.

### Prerequisites

Before integrating this SDK, ensure you have:

* **API Key, Organization ID, and Google Cloud ID.** [Learn more](https://developer.prophius.com/developer-console/merchant-embed-sdk/react-native/sdk-api-reference/start-sdk) on SDK Initialization section to understand how to get this parameters. &#x20;
* **Merchant ID,** **Terminal ID, Phone Number, Business Name**
* React Native dependencies installed in your project, preferably;

```json
"react": "19.2.0" or updward,
"react-native": "0.83.1" or upward
```

{% hint style="info" %}
To download the PayContactless embedded SDK, you will be provided with secure credentials (username and password).

Follow the steps below to configure your project and sync the SDK dependency.
{% endhint %}

### Supported Android SDKs

* Minimum Android SDK: **30**
* Kotlin minimum version: **1.9**
* Minimum Android NDK version: 26.+

Add the required permissions in android directory `AndroidManifest.xml`:

```xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 <uses-permission android:name="android.permission.NFC" />
 <uses-permission android:name="android.permission.READ_PHONE_STATE" />
 <uses-feature android:name="android.hardware.nfc" android:required="false" />

```

> No custom activities are required. The SDK handles UI internally.

Add the Maven repository block to your android directory:

* `settings.gradle`&#x20;

{% hint style="warning" %}
We recommend keeping the credential in your [`gradle.properties`](#user-content-fn-1)[^1] file, and avoid committing this file to your repo.

You can ignore this in git by adding it to `.gitignore`
{% endhint %}

{% tabs %}
{% tab title="Groovy DSL" %}

```kts
def libUser = hasProperty('YOUR USERNAME') ? YOUR USERNAME : ""
def libPass = hasProperty('YOUR PASSWORD') ? YOUR PASSWORD : ""
//dependencyResolutionManagement block
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        google()
        mavenCentral()
        flatDir {
            dirs 'libs'
        }

        maven {
            url "https://nexus.prophius-api.com/repository/maven-releases/"
            credentials {
                username = libUser
                password = libPass
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
We recommend using the following version of ndkd kotlin.

Add this to your project level buildscript block, and your reference in your app level android block, accordingly.&#x20;

```
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"
```

{% endhint %}

Add the SDK dependency in your module level `build.gradle` file of the project like below.

```gradle
implementation 'com.prophius:paycontactlesssdk.embed.stage:3.4.18'
```

{% hint style="info" %}
SDK does not allow to run the app on debug. The application must be release build.

Check Security Mechanisms section for the other restriction.
{% endhint %}

{% content-ref url="../security-mechanisms" %}
[security-mechanisms](https://developer.prophius.com/developer-console/merchant-embed-sdk/security-mechanisms)
{% endcontent-ref %}

{% hint style="danger" %}
This version of the SDK must be used in integration phase by developer. For the internal and external tests, the version of SDK must never be used.
{% endhint %}

## Other required dependencies <a href="#id-6.-dependencies" id="id-6.-dependencies"></a>

SDK needs some third party libraries and the integrator app must have these dependencies. The libraries which is shared below should be added to the build.gradle file.

```gradle
// Room
    implementation "androidx.room:room-runtime:2.7.0"
    annotationProcessor "androidx.room:room-compiler:2.7.0"
// SQLCipher
    implementation "net.zetetic:android-database-sqlcipher:4.5.0"
// Gson
    implementation 'com.google.code.gson:gson:2.10.1'
// Lottie
    implementation "com.airbnb.android:lottie:3.4.0"
// Google Play Services
    implementation 'com.google.android.gms:play-services-base:18.6.0'
// Google Play Integrity
    implementation 'com.google.android.play:integrity:1.4.0'
// OkHttp3
    implementation 'com.squareup.okhttp3:okhttp:4.12.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
// Android appcompact & material ui
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'com.google.android.material:material:1.9.0'

```

{% hint style="warning" %}
In order to support schemas' branding animations, jetifier tools must be enabled on your project. The following configuration must be added on your `gradle.properties` file.&#x20;

<pre class="language-kotlin"><code class="lang-kotlin"><strong># Automatically convert third-party libraries to use AndroidX
</strong>android.useAndroidX=true
android.enableJetifier=true
</code></pre>

{% endhint %}

[^1]:
