Install the SDK

To begin using the SDK, you must first add it as a dependency to your app, integrating it into your existing application. A pre-requisite to using the SDK is setting up the Paydock API, the instructions for which are linked in this guide.

Setup the Paydock API Integration

Get up and running using the PayDock API in just a few minutes.

  1. Signup for a sandbox account by contacting PayDock. This gives you access to the admin portal.

  2. Once you have an account, follow our integration guide on how to configure and setup your server integration.

  3. After authenticating your API keys, integrate the SDK into either your iOS or Android application by following the instructions in this guide.

Setup the Paydock iOS SDK

This guide walks you through how to integrate the Paydock Android SDK into your Android application.

Step 1: Configure Repository Access

You can configure repository access using either Swift Package Manager or CocoaPods.

Swift Package Manager

  1. In Xcode, select File > Add Packages. Enter the following:
https://github.com/PayDock/ios-mobile-sdk
  1. Select the latest version number from our release page.

  2. Add the version number when you are prompted and click Add Package.

Step 2: Add SDK Dependency

Choose the project file where you want to access the SDK components. In this file, add the following import:

import MobileSDK
  1. The SDK has now been added to your project. To use the SDK in your project, you must include import MobileSDK at the top of the file where you will use the SDK. You can then move to the next step and initialize your MobileSDK.

Setup the Paydock Android SDK

This guide walks you through the steps to add the Paydock Android MobileSDK into your Android application.

Step 1: Configure Repository Access

Before you can access the MobileSDK, you need to:

  1. Create a Personal Access Token on your Github account. This is your authentication, enabling you to access the MobileSDK through Github's repository package registry. The package registry is where the dependencies for the MobileSDK are located.

  2. Replace the <username> in the instructions with your Github username.

  3. Replace the <access_token> in the instructions with the Personal Access Token you have created in step 1.

The following examples in both Groovy and Kotlin demonstrate how this looks like.

Project Level build.gradle

Groovy

repositories {
  // ... other repositories
  maven {
      url "https://maven.pkg.github.com/Paydock/android-mobile-sdk"
      name "GitHubPackages"
      credentials {
            username "<username>"
            password "<access_token>"
      }
  }
}

Kotlin DSL

repositories {
    // ... other repositories
    maven {
        name = "GitHubPackages"
        url = uri("https://maven.pkg.github.com/Paydock/android-mobile-sdk")
        credentials(HttpHeaderCredentials) {
            username = "<username>"
            password = "<access_token>"
        }
    }
}

Step 2: Add SDK Dependency

In your app/module level build.gradle, add the MobileSDK dependency. Replace <latest_version> with the latest version of the SDK.

Note: You can find the latest version of the SDK in our documentation or on Github.

Project Level build.gradle

Groovy

dependencies {
  implementation 'com.paydock:mobile-sdk:<latest_version>'
}

Kotlin DSL

dependencies {
  implementation("com.paydock:mobile-sdk:<latest_version>")
}

That's it! You have successfully configured your project to use the Paydock Android SDK. You can now start using the SDK to integrate Paydock's payment processing capabilities into your Android application.