-
Notifications
You must be signed in to change notification settings - Fork 54
SDK Installation
We publish our SDK to bintray repository. Please add bintray in your repository list(as below)
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" }
}
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'
}
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'
}
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'
}
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>
}
}
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" />
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.