SDK Installation - veritrans/veritrans-android GitHub Wiki
We publish our SDK to bintray repository. Please add bintray in your repository list(as below)
Gradle Setup
Following bintray repository needs to be added to your repository section in build.gradle
repositories {
jcenter()
// Add the midtrans repository into the list of repositories
maven { url "http://dl.bintray.com/pt-midtrans/maven" }
}
Core Flow SDK Installation
Add one of SDK codeflow installation following into your build.gradle
dependencies {
// For using the Veritrans Sandbox
compile 'com.midtrans:corekit:$VERSION-SANDBOX'
// For using the Veritrans Production
compile 'com.midtrans:corekit:$VERSION'
}
UI Flow SDK Installation
Add one of SDK uiflow installation following into your build.gradle
dependencies {
// For using the Veritrans Sandbox
compile 'com.midtrans:uikit:$VERSION-SANDBOX'
// For using the Veritrans Production
compile 'com.midtrans:uikit:$VERSION'
}
Adding external card scanner (Using Card.io library)
We provide a plugin to integrate card.io for allowing customers to read the credit card/debit card information using the mobile phone camera.
You can add external card scanner using ScanCardLibrary
implementation by adding this code block into your build.gradle
.
//..other dependencies
compile ('com.midtrans:scancard:$VERSION'){
exclude module: 'uikit'
}
Product Flavor Definition (Optional)
Add the Merchant server URL (MERCHANT_BASE_URL
) and the Veritrans client key (CLIENT_KEY
) in the MAP configuration into your build.gradle file.
Note:
- MERCHANT_BASE_URL (
PRODUCTION
AND/ORSANBDOX
) is merchant API endpoint that implemented basic requirement of merchant server reference. - We have different
CLIENT_KEY
values forSANDBOX
andPRODUCTION
so it's better if you have two flavors inbuild.gradle
script and define them here.
productFlavors {
development {
buildConfigField "String", "BASE_URL", <MERCHANT_BASE_URL_SANDBOX>
buildConfigField "String", "CLIENT_KEY", <MERCHANT_CLIENT_KEY_SANDBOX>
}
production {
buildConfigField "String", "BASE_URL", <MERCHANT_BASE_URL_PRODUCTION>
buildConfigField "String", "CLIENT_KEY", <MERCHANT_CLIENT_KEY_PRODUCTION>
}
}
Modify Manifest (Optional)
This can be skipped since gradle build will automatically add these permissions.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Proguard Rules
Merchants don't need to add any proguard rules to their app. This SDK will automatically add the rules when merchant enable the proguard build.