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 | ||
|---|---|---|---|---|
screenTitleβ | STRING | β | ||
| The title that'll be shown on the payment form screen under the logo. | ||||
merchantNameβ | STRING | β | ||
| The name of the merchant will be shown to the customer on the SamsungPay wallet screen. | ||||
hideCardScannerβ | Boolean | β | ||
| Indicates whether to show the camera card scanner button from the payment form screen or not. | ||||
linkBillingNameWithCardβ | Boolean | β | ||
| Indicates whether to add the billing name to be the same as the cardholder's name or not. | ||||
isDigitalProductβ | Boolean | β | ||
| Implementing this option will enable you to initiate payments targeted to be paid using the supported types of credit cards such as Visa, MasterCard, Amex, etc. using only the customer name and email in case your products/services are not physical and don't need to be shipped to the customers. Note that the digital product mode is not universally compatible with all processors. Therefore, it is advisable to seek guidance from your Relationship Manager (RM) to determine if it is suitable for your specific processor. | ||||
setPaymentExpiryβ | STRING | β | ||
| Option to set expiry timeout in seconds for the card payment screen. Set to zero to deactivate the timeout feature, and less than 60 seconds will not affect. If the merchant presses the "PAY NOW" button the timeout will stop and the customer will proceed without expiration. | ||||
showBillingInfoβ | BOOLEAN | β | ||
| Indicates whether to hide billing information or not from the payment form screen. Noting that the customer details are still required and must be passed, in case any of the details are missing or passed with invalid values; the request will fail and the SDK will throw an exception. | ||||
setCardDiscountβ | 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. | ||||
showShippingInfoβ | BOOLEAN | β | ||
| Indicates whether to show the shipping information or not from the payment form screen. | ||||
tokeniseTypeβ | TokeniseType | β | ||
| The tokenization format the generated token should follow. | ||||
tokenFormatβ | TokenFormat | β | ||
| This indicates the type of tokenization used. | ||||
alternativePaymentMethodsβ | AlternativePaymentMethod | β | ||
| Used to add another payment method in the payment form screen (such as Aman, StcPay, OmanNet, .. etc) or not. For more information please check the related section on this from here. | ||||
tokenβ | STRING | β | ||
| The customer's saved card token which has to be passed within the transaction. This field is required for creating tokenized (recurring) transactions. | ||||
transactionReferenceβ | STRING | β | ||
| Indicates the Transaction Reference on the PayTabs side check details on [Response Parameters | tran_ref] | ||||
| ||||
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. | ||||
| ||||