Install the Mobile SDK

Pre-requisites

iOS

To use the Integrated POS service Mobile SDK for iOS, you must meet the following requirements:

  • Your project must use XCode 12.0
  • Your project must target iOS 9.0 or above
  • Swift projects must use Swift 5.3

Android

To use the Integrated POS service Mobile SDK for Android, you must meet the following requirements:

  • Your project must have a minimum Android version of 24 or above
  • Your project must have a target Android version of 29 or above

Install the SDK

iOS

We provide the Integrated POS service Mobile SDK for iOS as a framework. See theRelease notesfor the available versions.

For each target of your app:

  1. Add WorldpayTotalSDK.framework to "Frameworks, Libraries, and Embedded Content"
  2. Add the directory you have put the framework file in to “Framework Search Paths”, e.g. $(PROJECT_DIR)/Frameworks/ (recursive)
  3. Add the Dependencies directory inside the framework file to “Import Paths”, e.g. $(PROJECT_DIR)/Frameworks/WorldpayTotalSDK.framework/Dependencies/ (recursive)

Android

We provide the Integrated POS service Mobile SDK for Android as an Apache Maven Dependency.

Add the following in the build.gradle of your project to specify our Maven repository. The SDK is downloaded from this Maven repository:

Copied!
allprojects {
  repositories {
    maven {
      setUrl("https://artifacts.mobile.worldpay.com/artifactory/libs-release/")
      credentials {
        username = <username-provided-by-worldpay>
        password = <password-provided-by-worldpay>
      }
    }
  }
}

Then define the Integrated POS service Mobile SDK as a dependency for your app. To do this, add the following in the build.gradle of your app, setting <version> as the version number you require from theRelease notes:

Copied!
dependencies {
  compile(name:'com.worldpay:worldpay-total-sdk:<version>')
}

Install the test harness

A test harness is available for the SDK. Use it to simulate typical scenarios that allow payment flows without the need for an IPC installation or payment terminals.

The SDK test harness is an executable Java application that you can run on a Windows/Linux PC or Mac. The mobile device that uses the SDK can connect to this PC or Mac.

Download the test harness from theRelease notes, and then run it by executing the following from your command line:

Copied!
java -jar worldpay-total-sdk-test-harness-<version>.jar

You can check the test harness is running by visiting http://localhost:8080/actuator/health.

To customise the port that the server runs on, add --server.port=XXXX after the jar name in the java command.

You canconfigure your SDKinstance to connect to the test harness by providing the following values:

  • Host URL: ws://localhost:8080/ (update the hostname and port as appropriate for where you have deployed the test harness)
  • Paypoint ID: Any value is accepted by the test harness (e.g. PAYPOINT_1)
  • POS License Key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.4Z3CseLRkkmLxat9JI2RYWjHwFSulJQiy8dmiNvdCW4 (this is a test value accepted only by the test harness)

Next steps