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:β
- Required configuration methods
- All including the optional methods
let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)
.cartDescription("Flowers")
.cartID("1234")
.billingDetails(billingDetails)
let configuration = PaymentSDKConfiguration(
profileID: profileID,
serverKey: serverKey,
clientKey: clientKey,
currency: "SAR",
amount: 5.0,
merchantCountryCode: "SA"
)
.cartID("1234")
.billingDetails(billingDetails)
.shippingDetails(shippingDetails)
.merchantName("Merchant Name")
.cartDescription("Order #12345 - Electronics Purchase")
.languageCode("en")
.tokeniseType(.merchantMandatory)
.tokenFormat(.hex32)
.token(nil)
.transactionreference(nil)
.merchantIdentifier("merchant.com.yourcompany.app")
.paymentNetworks([...])
.simplifyApplePayValidation(true)
.forceShippingInfo(false)
.linkBillingNameWithCard(true)
.showSaveCardsUI(true)
.requestCVV(true)
.isDigitalProduct(false)
.expiryTime(3600)
.cardDiscounts(nil)
.cardApproval(cardApproval)
configuration.theme = customTheme
configuration.transactionType = .sale
configuration.transactionClass = .ecom
configuration.screenTitle = "Title"
configuration.hideCardScanner = false
configuration.alternativePaymentMethods = [.stcPay, .valu]
Methods used via this object:β
- startCardPayment
- start3DSecureTokenizedCardPayment
- startTokenizedCardPayment
- startApplePayPayment
- startAlternativePaymentMethod
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. | ||||
| ||||
currencyβ | 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. | ||||
| ||||
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 | β |
| 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. | ||||
expiryTimeβ | 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 be affected. If the merchant presses the "PAY NOW" button the timeout will stop and the customer will proceed without expiration. | ||||
simplifyApplePayValidationβ | Boolean | β | ||
| Indicates whether to only validate necessary fields when using the ApplePay payment method, which is (name, phone, email) or not. | ||||
transactionTypeβ | STRING | β | ||
| The identification of the type of the transaction. To know more about these types please check our What is the "tran_type" (transaction type)? solution article. To know more about this parameter please click here. | ||||
| ||||
transactionClassβ | STRING | β | ||
| The identification of the category/class this transaction will follow, such as eCommerce, Recurring, etc. To know more about these types please check our What is the "tran_class" (transaction class)? solution article. 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. | ||||
| ||||
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 | β |
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. | ||||
merchantIdentifierβ | STRING | β | ||
| Apple Pay Merchant Identifier. | ||||
paymentNetworksβ | PassKit.PKPaymentNetwork | β | ||
| Apple Pay Payment Networks. | ||||
cardDiscountsβ | [PaymentSDK.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. | ||||
themeβ | PaymentSDKTheme | β | ||
| Used in customizing the payment view design. For more information please check the related section on this from here. | ||||
showShippingInfoβ | BOOLEAN | β | ||
| Indicates whether to show the shipping information or not from the payment form screen. | ||||
forceShippingInfoβ | BOOLEAN | β | ||
| Indicates whether to hide shipping and billing information or not from the payment page. Note: The customer details are still required and must be passed in case any of the details are missing or passed with invalid values; the hide_shipping option will be ignored, and the cardholder will be required to enter any of the missing details on the payment page. To know more about this parameter please click here. | ||||
languageCodeβ | STRING | Either en or ar | β | |
| Indicates the payment page displaying language. To know more about this parameter please click here. | ||||
| ||||
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] | ||||
| ||||