Skip to main content

Configuration Options & Parameters

This article is dedicated to walking you through how to manage the React Native 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:​

 var configuration = PaymentSdkConfigurationDetails(
profileId: profileId,
serverKey: serverKey,
clientKey: clientKey,
cartId: cartId,
cartDescription: cartDescription,
amount: amount,
currencyCode: currencyCode,
merchantCountryCode: merchantCountryCode
);



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"

var configuration = PaymentSdkConfigurationDetails(
profileId: profileId,
serverKey: serverKey,
clientKey: clientKey,
cartId: cartId,
cartDescription: cartDescription,
amount: amount,
currencyCode: currencyCode,
merchantCountryCode: merchantCountryCode
);

serverKey​

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

val serverKey = "SERVER_KEY"

var configuration = PaymentSdkConfigurationDetails(
profileId: profileId,
serverKey: serverKey,
clientKey: clientKey,
cartId: cartId,
cartDescription: cartDescription,
amount: amount,
currencyCode: currencyCode,
merchantCountryCode: merchantCountryCode
);

clientKey​

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

val clientKey = "CLIENT_KEY"

var configuration = PaymentSdkConfigurationDetails(
profileId: profileId,
serverKey: serverKey,
clientKey: clientKey,
cartId: cartId,
cartDescription: cartDescription,
amount: amount,
currencyCode: currencyCode,
merchantCountryCode: merchantCountryCode
);

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

var configuration = PaymentSdkConfigurationDetails(
profileId: profileId,
serverKey: serverKey,
clientKey: clientKey,
cartId: cartId,
cartDescription: cartDescription,
amount: amount,
currencyCode: currencyCode,
merchantCountryCode: merchantCountryCode
);

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"
)

var configuration = PaymentSdkConfigurationDetails(
profileId: profileId,
serverKey: serverKey,
clientKey: clientKey,
cartId: cartId,
cartDescription: cartDescription,
amount: amount,
currencyCode: currencyCode,
merchantCountryCode: merchantCountryCode
);
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"
)

var configuration = PaymentSdkConfigurationDetails(
profileId: profileId,
serverKey: serverKey,
clientKey: clientKey,
cartId: cartId,
cartDescription: cartDescription,
amount: amount,
currencyCode: currencyCode,
merchantCountryCode: merchantCountryCode
);
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βœ”

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.