Skip to main content

Installation and configuration

Installation

Add this to your buildScript repositories declaration

    repositories {
maven { url 'https://nexus.devops.geopagos.com/repository/android-geopagos_public/' }
google()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}

And this to your module dependencies

    dependencies {
implementation "com.geopagos.payments.sdk:payments-core:$paymentVersion"
}

And for each type of reader you want to support (you may choose to support one or more)

  dependencies {
implementation "com.geopagos.payments.sdk:sdk-reader-qpos:$paymentVersion"
}

Configure the SDK

This consists of initializing the Readers SDK, provide data acording to code documentation.

First of all, SDK intialization is required, there is a Builder SDKPaymentsConfiguration.Builderto configure the required data:

val sdkPaymentsConfiguration = SDKPaymentsConfiguration.Builder()
.setLogger(<LOGGER>)
.setSwipePinDecider(<SWIPE_PIN_DECIDER>)
.build(
<CONTEXT>,
"<ENDPOINT>",
setOf(<READER_INSTALLER_SET>,
setOf(<PLUGIN_INSTALLER_SET>)
)

SDKPayments.init(sdkPaymentsConfiguration)

Where:

  • CONTEXT* is the ApplicationContext
  • ENDPOINT is a String with the URL path of the processor URL. Geopagos will provide this URL
  • READER_INSTALLER_SET is a set of reader installers. According to the dependencies you added
  • PLUGIN_INSTALLER_SET is a set of optional plugins. According to the dependencies you added. Geopagos will provide the corresponding documentation according to the contracted plugins
  • LOGGER is a custom logger you can provide to get additional information about what the sdk is doing (is useful for debugging purposes)
  • SWIPE_PIN_DECIDER is an interface that allows you to decide if the SDK should ask pin on swipe transactions. This is optional. By default the SDK is loaded with an implementation that decides if a Swipe Card requires PIN based on the last ServiceCode Digit

About installers

Each reader has its own installer. Whether you've added the QPOS, Urovo SmartPOS and/or MAGICPOS dependencies (see above), you'll gain access to SDKQposReader, SDKUrovoReader and/or SDKMagicPosReader that allows you to install each reader as is shown below.

SDKQposReader.getInstaller()

Initialization Example (supporting only MagicPos)

val swipePinDecider = object : SDKSwipePinDecider{
override fun decide(card: SDKTransactionCard.Magnetic, decision: (pinRequire: Boolean) -> Unit) {
decision(true)
}
}

val sdkPaymentsConfiguration = SDKPaymentsConfiguration.Builder()
.setLogger(myCustomLogger)
.setSwipePinDecider(swipePinDecider)
.build(
applicationContext,
"https://example.net/",
setOf(SDKMagicPosReader.getInstaller()),
setOf(SDKBinCvmContactlessDeciderPlugin.getInstaller(sdkBinTable))
)

SDKPayments.init(sdkPaymentsConfiguration)