Skip to main content

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:​

val configData = PaymentSdkConfigBuilder(
profileId = profileId,
serverKey = serverKey,
clientKey = clientKey,
amount = amount,
currencyCode = currency
)
.setMerchantCountryCode(merchantCountryCode)
.setCartId(cartId)
.setCartDescription(cartDesc)
.setBillingData(billingData)
.setShippingData(shippingData)
.build()



Methods used via this object:​

  • startCardPayment
  • start3DSecureTokenizedCardPayment
  • startTokenizedCardPayment
  • startSamsungPayment
  • startAlternativePaymentMethods



Properties:​

ParameterData Type
Validation Rule
Required

profileID​

INTAccept 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..

val profileId = "PROFILE_ID"

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.build()

serverKey​

STRINGAccepts only a valid Server Key of your profileβœ”
This a unique identifiers, used to authenticate your integration.

val serverKey = "SERVER_KEY"

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.build()

clientKey​

STRINGAccepts only a valid client Key of your profileβœ”
This a unique identifiers, used to authenticate your integration.

val clientKey = "CLIENT_KEY"

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.build()

amount​

DOUBLEMin: 0.01Max: 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.

val amount = 20.0

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.build()

currencyCode​

STRINGValid 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.

val currency = "SAR"

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.build()

merchantCountryCode​

STRINGCountry ISO Alpha-2 charachters codeβœ”
Indicates the merchant country code, where the merchant run there business.

var merchantCountryCode = "SA"

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.build()

cartId​

STRINGMin: 1Max: 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.

val cartId = "Order1001"

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.setCartId(cartId)
.build()

cartDescription​

STRINGMin: 1Max: 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.

var cartDesc = "cart description"

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.setCartDescription(cartDesc)
.build()

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.

var billingData = PaymentSdkBillingDetails(
city = "Jeddah",
countryCode = "sA",
email = "[email protected]",
name = "Technical Support",
phone = "+966 55 xxxxxx6",
state = "Makkah",
addressLine = "address street",
zip = "24211"
)

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.setBillingData(billingData)
.build()
billingDetails's Nested Parameters
Nested ParameterData TypeMinMaxRequired
city
STRING3128βœ”
countryCode
STRINGN/AN/Aβœ”
email
STRINGN/AN/Aβœ”
name
STRING3128βœ”
phone
STRINGN/AN/Aβœ”
state
STRING22βœ”
addressLine
STRING3128βœ”
zip
STRINGN/AN/Aβœ”

shippingDetails​

OBJECTβœ”
Indicates the customer shipping details for this payment. If provided, the payment page will be prefilled with the provided data..

var billingData = PaymentSdkShippingDetails(
city = "Jeddah",
countryCode = "sA",
email = "[email protected]",
name = "Technical Support",
phone = "+966 55 xxxxxx6",
state = "Makkah",
addressLine = "address street",
zip = "24211"
)

val configData = PaymentSdkConfigBuilder(profileId, serverKey, clientKey, amount, currencyCode)
.setShippingData(shippingData)
.build()
shippingDetails's Nested Parameters
Nested ParameterData TypeMinMaxRequired
city
STRING3128βœ”
countryCode
STRINGN/AN/Aβœ”
email
STRINGN/AN/Aβœ”
name
STRING3128βœ”
phone
STRINGN/AN/Aβœ”
state
STRING22βœ”
addressLine
STRING3128βœ”
zip
STRINGN/AN/Aβœ”



PaymentSDKQueryConfiguration​

The PaymentSDKQueryConfiguration class can be instantiated directly. This allows for straightforward creation and usage in methods where configuration is passed explicitly.


Sample Code:​

val queryConfig = PaymentSDKQueryConfiguration(
serverKey = serverKey,
clientKey = clientKey,
merchantCountryCode = merchantCountryCode,
profileID = profileId,
transactionReference = transactionReference
)



Methods used via this object:​

  • queryTransaction



Properties:​

ParameterData Type
Validation Rule
Required

profileID​

INTAccept 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..

val profileId = "PROFILE_ID"

undefined

serverKey​

STRINGAccepts only a valid Server Key of your profileβœ”
This a unique identifiers, used to authenticate your integration.

val serverKey = "SERVER_KEY"

undefined

clientKey​

STRINGAccepts only a valid client Key of your profileβœ”
This a unique identifiers, used to authenticate your integration.

val clientKey = "CLIENT_KEY"

undefined

merchantCountryCode​

STRINGCountry ISO Alpha-2 charachters codeβœ”
Indicates the merchant country code, where the merchant run there business.

var merchantCountryCode = "SA"

undefined

We are glad to be always in help. We aim to serve you better each time. As such, please spare a minute to share feedback about your recent experience with PayTabs Developers , on Trustpilot, or Google Reviews.