Android implementation of PayApi Secure Form.
Includes an easy-to-use PayApi SDK for any Android application. In order to use the SDK, please register for a free PayApi user account
1 - Add the repository url to your project level build.gradle
allprojects {
repositories {
maven {
url "https://raw.githubusercontent.com/payapi/payapi-sdk-android/releases"
}
}
}2 - Add the library as a dependency in your app module level build.gradle
dependencies {
...
compile 'io.payapi.payapisdk:payapi-sdk-android:1.0'
}import io.payapi.payapisdk.SecureForm;Initialize SDK with your credentials (Public Id and PayApi key)
SecureForm secureForm = new SecureForm(activity, "SHOP_PUBLIC_ID", "PROVIDED_API_KEY");String message = "{" +
"\"order\": {" +
"\"sumInCentsIncVat\": 122," +
"\"sumInCentsExcVat\": 100," +
"\"vatInCents\": 22," +
"\"currency\": \"EUR\"," +
"\"referenceId\": \"ref123\"" +
"}," +
"\"products\": [" +
"{" +
"\"quantity\": 1," +
"\"title\": \"Black bling cap\"," +
"\"priceInCentsIncVat\": 122," +
"\"priceInCentsExcVat\": 100," +
"\"vatInCents\": 22," +
"\"vatPercentage\": 22" +
"}" +
"]," +
"\"consumer\": {" +
"\"email\": \"support@payapi.io\"" +
"}" +
"}";Method to open the Secure Form on any View or Button click event
secureForm.addSecureFormToButton(myButton, productData);Please contact support@payapi.io for any questions.