Portmone eCommerce Android SDK
Glossary
Term | Definition |
---|---|
Merchant, Online Store or Partner | Organization which has signed a payment acceptance agreement with Portmone.com |
Buyer, Client or Customer | A person who visits the Merchant's Online Store in order to learn about the range of goods (services) and to make a purchase |
Card, Payment Card | Payment cards of Visa, Mastercard international card associations and the National payment system PROSTIR |
Token | A unique digital identifier of a card, which is generated during the first operation and then used for quick payment |
CVV2/CVC2 | CVV2 (Card Verification Value 2) is a three-digit card security code that helps to verify legitimacy of a Visa payment card. The MasterCard payment system has similar card security code called CVC2 (Card Validation Code 2) |
Authorization | The procedure of obtaining confirmation from the issuing bank to make a payment by card |
Biometric authorization | The process of payment confirmation using biometric data (e.g. fingerprint) identification technology |
Issuing Bank (Card Issuing Bank) | A bank licensed as a member of a card association (like Visa or Mastercard), that issues and maintains payment cards |
3-D Secure | 3-D Secure is a protocol which is used for secure handling of online bank card payments |
General description
Portmone SDK supports Android 5.0 version, API level 21 and above.
Integration
settings.gradle (project level)
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter()
maven {
url "https://github.com/Portmone/Android-e-Commerce-SDK/raw/master/"
}
}
}
rootProject.name = "TestSDK_v3" include ':app'
build.gradle (project level)
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://github.com/Portmone/Android-e-Commerce-SDK/raw/master/"
}
}
}
build.gradle (app level)
dependencies {
implementation 'com.portmone.ecomsdk:ecomsdk:1.3.4'
}
The SDK has a logic that allows you to safely remove the card_io library from dependencies (function is available for SDK version 1.3.0 and higher).
build.gradle (app level)
dependencies {
implementation ('com.portmone.ecomsdk:ecomsdk:2.2.5'){
exclude group: 'io.card'
}
}
In this case, card scanning functionality will be removed from the SDK UI, which allows to reduce the size of the application.
If you use proguard you need to add next row: keep class com.portmone.ecomsdk.** { *; }
Usage scenarios
- Payment by card.
- Saving a card.
- Payment by token (card token can be obtained using scenario 1 or 2).
- Money transfer from card to card using sender’s card token.
- Fingerprint payment confirmation.
- Payment via Google Pay.
- Mass payment of utility bills.
Software interface description
1. Language setting
SDK provides possibility to localize system text and responses from the server using this method:
PortmoneSDK.setLanguage(languageСode);
The method uses a constant from the Constant$Language.* class as the parameter to set Ukrainian, English or Russian language. If this function was not called, the language set at the system level will be used. If the translation according to the system language was not found, the Ukrainian language will be used.
2. Screen styles
For the screens used in the SDK, the elements and font colors as well as the text color can be changed using the AppStyle class. The class contains a set of parameters that are responsible for certain elements on the screens. Only the required parameters can be filled in. All colors are set in hex format.
To specify styles, use the following function:
PortmoneSDK.setAppStyle(...);
The specified styles are saved until the application shuts down.
App style
Field | Type | Description |
---|---|---|
background | int | Screens background color |
toolbar | int | Toolbar color on all screens |
iconSuccess | int | Changes the successful payment icon (available for SDK version 1.2.1 and higher) |
iconError | int | Changes the failed payment icon (available for SDK version 1.2.1 and higher) |
type | Constant$Type.* | This parameter is set using the values from the Constant$Type file. There are three options: 1. Default – standard option; 2. Phone – the description title “Order description” is changed to “Phone number” and “+380” is added to the description value itself (available for SDK version 1.2.1 and higher) 3. Account – the description title “Order description” is changed to “Personal account number” (available for SDK version 1.3.3 and higher) |
buttonStyle | ButtonStyle | Contains the button text color and the button background color in normal and clicked states, as well as the font for the button text |
editTextStyle | EditTextStyle | Used for input fields. Allows to change the color of the main text, tips and errors, and the corresponding fonts |
blockTitleTextStyle | BlockTitleTextStyle | Used for block headers on the screens. Allows to specify the background color, text color and font |
titleTextStyle | TitleTextStyle | Allows to specify the color and font of the titles on the screens |
descriptionTextStyle | TextStyle | Allows to specify the color and font of the main text on the screens |
additionalInfoTextStyle | TextStyle | Allows to specify the color and font of the additional text on the screens |
fingerprintButton | TextStyle | Allows to specify the color and font of the text for the fingerprint payment button (available for SDK version 1.1.4 and higher) |
paymentSuccessDownload | TextStyle | Allows to specify the color and font of the receipt downloading button on the successful payment screen (available for SDK version 1.2.1 and higher) |
dialogInfoStyle | DialogInfoStyle | Allows to specify the color and font of the title, text and the button text in the dialogs |
paymentDivider | TextStyle | The color of the text separator between payment types (by Google Pay and by payment card) |
With version 2.2.5 of the SDK, the following style properties and a small change to the logic of the screens are available:
PortmoneSDK.setStandardResultFlow(false); - allows you to disable screens about the result of the operation from the SDK side. Then the result can be processed - see point 11.2
PortmoneSDK.setAdditionalCustomize(true); - additional customization of screens for card storage and card payment.
Additional customization of the card storage and card payment screens.
Card saving method PreAuthCardPreActivity
Standard text
PortmoneSDK.setDescriptionSaveCard("");
PortmoneSDK.setTitleSaveCard("");
No text
WalletSDK.setDescriptionSaveCard(" ");
WalletSDK.setTitleSaveCard(" ");
Custom text
PortmoneSDK.setDescriptionSaveCard("Save card");
PortmoneSDK.setTitleSaveCard("Do you want 100 million UAH?");
Saving the card by the PreAuthCardPreActivity method and paying by card by the CardActivity method
PortmoneSDK.setNameCompany("PORTMONE"); - establishment of the company name. WalletSDK.setUAHSymbol(true); - installation of UAH sign, instead of UAH after the amount.
appStyle.setIconPayment(R.drawable.ic_portmone); - you can set the company icon.
New stylization of input fields:
Field | Description |
---|---|
EditTextStyleAdditional editTextStyleAdditional = new EditTextStyleAdditional(); | we create a new style |
editTextStyleAdditional.setTextColor(Color.parseColor("#6A5ACD")); | text color |
editTextStyleAdditional.setErrorTextColor(Color.parseColor("#90EE90")); | error color |
editTextStyleAdditional.setHintTextColor(Color.parseColor("#C0C0C0")); | hint color |
editTextStyleAdditional.setFocusedBorderColor(Color.parseColor("#7FFFD4")); | the frame is in focus, that is, when the user is typing something |
editTextStyleAdditional.setUnfocusedBorderColor(Color.parseColor("#4682B4")); | the frame is not in focus, that is, when the user is on another element |
editTextStyleAdditional.setSizeFocusedBorderThickness(4); | the thickness of the border of the input field, if the input field is in focus |
editTextStyleAdditional.setSizeUnfocusedBorderThickness(2); | the thickness of the frame of the input field, if the input field is not in focus |
editTextStyleAdditional.setSizeRoundedCornerShape(16); | rounding of the frame of the input field |
appStyle.setEditTextStyleAdditional(editTextStyleAdditional); | add style to appStyle |
3. Custom UID setting
SDK allows you to set up your own UID (sales channel ID for custom settings; set by agreement with the Portmone.com manager). Use the setUid static method to do that:
PortmoneSDK.setUid("customUID");
UID (shop_site_ID).If there is no UID, don`t pass a value.