Skip to main content

Configuration Options & Parameters

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

PaymentSDKConfiguration​

The PaymentSDKConfiguration class can be instantiated using the PaymentSdkConfigBuilder, which follows the builder design pattern to facilitate structured and customizable configuration setup.


Sample Code:​

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)
.cartDescription("Flowers")
.cartID("1234")
.billingDetails(billingDetails)



Methods used via this object:​

  • startCardPayment
  • start3DSecureTokenizedCardPayment
  • startTokenizedCardPayment
  • startApplePayPayment
  • startAlternativePaymentMethod



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"

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)

serverKey​

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

val serverKey = "SERVER_KEY"

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)

clientKey​

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

val clientKey = "CLIENT_KEY"

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)

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

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)

currency​

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"

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)

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"

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)

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

let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)
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βœ”

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.