Configuration Options & Parameters
This article is dedicated to walking you through how to manage the Native Android SDK configuration options.
You will get to know each parameter type and its usage of it so that you can easily configure the SDK to suit your business needs.
PaymentSdkConfigurationDetailsβ
The PaymentSdkConfigurationDetails class can be instantiated using the PaymentSdkConfigBuilder, which follows the builder design pattern to facilitate structured and customizable configuration setup.
Sample Code:β
- Required configuration methods
- All including the optional methods
val configData = PaymentSdkConfigBuilder(
profileId = profileId,
serverKey = serverKey,
clientKey = clientKey,
amount = amount,
currencyCode = currency
)
.setMerchantCountryCode(merchantCountryCode)
.setCartId(cartId)
.setCartDescription(cartDesc)
.setBillingData(billingData)
.setShippingData(shippingData)
.build()
val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.setCartDescription(cartDesc)
.setLanguageCode(locale)
.setMerchantIcon(ResourcesCompat.getDrawable(resources, R.drawable.paytabs, null))
.setMerchantCountryCode(merchantCountryCode)
.setCartId(cartId)
.setTransactionClass(transactionClass)
.setTransactionType(transType)
.setBillingData(billingData)
.setShippingData(shippingData)
.setCardDiscount(cardDiscount)
.setPaymentExpiry(120)
.setAlternativePaymentMethods(alternativePaymentMethods)
.showBillingInfo(showBillingInfo)
.showShippingInfo(showShippingInfo)
.forceShippingInfo(forceShippingInfo)
.setScreenTitle(screenTitle)
.setServerIp("1.1.1.1")
.hideCardScanner(false)
.setTokenise(tokeniseType, tokenFormat)
.isDigitalProduct(isDigitalProduct)
.setCardApproval(cardApproval)
.linkBillingNameWithCard(true)
.build()
Methods used via this object:β
- startCardPayment
- start3DSecureTokenizedCardPayment
- startTokenizedCardPayment
- startSamsungPayment
- startAlternativePaymentMethods
Properties:β
- Required Properties
- Optional Properties
| Parameter | Data Type | Required | ||
|---|---|---|---|---|
profileIDβ | INT | Accept only valid profile number. | β | |
| The merchant Profile ID you can get from your PayTabs dashboard. For more information please check our How to get your account information from PT Dashboard? solution article.. | ||||
| ||||
serverKeyβ | STRING | Accepts only a valid Server Key of your profile | β | |
| This a unique identifiers, used to authenticate your integration. | ||||
| ||||
clientKeyβ | STRING | Accepts only a valid client Key of your profile | β | |
| This a unique identifiers, used to authenticate your integration. | ||||
| ||||
amountβ | DOUBLE | Min: 0.01 | Max: 9999999999.99 | β |
| Indicates the amount of the transaction the customer is about to be charged. Both min and max values are subjected to the merchant transaction limits. | ||||
| ||||
currencyCodeβ | STRING | Valid string from the following list: SAR AED BHD EGP EUR GBP HKD IDR INR IQD JOD JPY KWD MAD OMR PKR QAR USD Accepts both upper/lower case characters | β | |
| Indicates the transaction currency, which the customer will be charged with. To know more about this parameter please click here. | ||||
| ||||
merchantCountryCodeβ | STRING | Country ISO Alpha-2 charachters code | β | |
| Indicates the merchant country code, where the merchant run there business. | ||||
| ||||
cartIdβ | STRING | Min: 1 | Max: 64 | β |
| Indicates the cart/order id at the merchant end, to easily relate the PayTabs transaction to. To know more about this parameter please click here. | ||||
| ||||
cartDescriptionβ | STRING | Min: 1 | Max: 128 | β |
| Indicates the cart/order description at the merchant end, to easily relate the PayTabs transaction to. To know more about this parameter please click here. | ||||
| ||||
billingDetailsβ | OBJECT | β | ||
| Indicates the customer details for this payment. If provided, the payment page will be prefilled with the provided data. To know more about this parameter please click here. | ||||
| ||||
| Nested Parameter | Data Type | Min | Max | Required |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
| STRING | N/A | N/A | β |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
| STRING | 2 | 2 | β |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
shippingDetailsβ | OBJECT | β | ||
| Indicates the customer shipping details for this payment. If provided, the payment page will be prefilled with the provided data.. | ||||
| ||||
| Nested Parameter | Data Type | Min | Max | Required |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
| STRING | N/A | N/A | β |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
| STRING | 2 | 2 | β |
| STRING | 3 | 128 | β |
| STRING | N/A | N/A | β |
| Parameter | Data Type | Required | ||
|---|---|---|---|---|
cardDiscountβ | List<PaymentSdkCardDiscount> | β | ||
| To enables merchants to provide tailored discounts to their customers based on specific card BIN ranges. This feature is designed to enhance customer loyalty and engagement by allowing merchants to offer discounts either as a fixed amount or a percentage off the total purchase. To know more about this parameter please click here. | ||||
| ||||
| Nested Parameter | Data Type | Min | Max | Required |
| List<String> | N/A | N/A | β |
| Provide a list of card prefixes strings (usually first 4, can be up to first 10 prefixes digits) that will be used to determine if the discount should be applied to the transaction.). | ||||
| DECIMAL | 0.01 | 9999999999.99 | β |
The actual discount should be deducted from the amount, could be a value or percentage according to the isPercentage value | ||||
| STRING | N/A | N/A | β |
| Description of the discount that will be displayed for the customer on the hosted payment page. | ||||
| BOOLEAN | N/A | N/A | β |
| Determines whether the discount is a percentage or a value. | ||||
cardApprovalβ | PaymentSdkCardApproval | β | ||
| Allow you to collects approval of the customer card details via an API, before proceed with payment process. | ||||
| ||||
| Nested Parameter | Data Type | Min | Max | Required |
| String | N/A | N/A | β |
| Provide a list of card prefixes strings (usually first 4, can be up to first 10 prefixes digits) that will be used to determine if the discount should be applied to the transaction.). | ||||
| INTEGER | 0.01 | 9999999999.99 | β |
The actual discount should be deducted from the amount, could be a value or percentage according to the isPercentage value | ||||
| Boolean | N/A | N/A | β |
| Description of the discount that will be displayed for the customer on the hosted payment page. | ||||
PaymentSDKQueryConfigurationβ
The PaymentSDKQueryConfiguration class can be instantiated directly. This allows for straightforward creation and usage in methods where configuration is passed explicitly.
Sample Code:β
- Required configuration methods
- All including the optional methods
val queryConfig = PaymentSDKQueryConfiguration(
serverKey = serverKey,
clientKey = clientKey,
merchantCountryCode = merchantCountryCode,
profileID = profileId,
transactionReference = transactionReference
)
Methods used via this object:β
- queryTransaction
Properties:β
- Required Properties
| Parameter | Data Type | Required | ||
|---|---|---|---|---|
profileIDβ | INT | Accept only valid profile number. | β | |
| The merchant Profile ID you can get from your PayTabs dashboard. For more information please check our How to get your account information from PT Dashboard? solution article.. | ||||
| ||||
serverKeyβ | STRING | Accepts only a valid Server Key of your profile | β | |
| This a unique identifiers, used to authenticate your integration. | ||||
| ||||
clientKeyβ | STRING | Accepts only a valid client Key of your profile | β | |
| This a unique identifiers, used to authenticate your integration. | ||||
| ||||
merchantCountryCodeβ | STRING | Country ISO Alpha-2 charachters code | β | |
| Indicates the merchant country code, where the merchant run there business. | ||||
| ||||