PayTabs SDK makes the integration with the PayTabs payment gateway very easy by providing a ready-made payment screen that handles the card entry, and billing & shipping information and completes the missing details.


This article is dedicated to walking you through how to manage Enums in this SDK.


An enumeration/enumeration  defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code. 


Hence, here are the predefined enums by PayTabs that will help you in customizing your configuration as shown below:




iOS


Tokenise types


This option is used only when you want to tokenize the transaction for any further recurring transactions. This indicates whether the tokenization is optional or mandatory or if no tokenization will be done at all.

This field is required for creating tokenized (recurring) transactions. 

The default type is none


TokeniseType {
    None, 
    MerchantMandatory,
    UserMandatory,
    UserOptional;
}


You can pass/use it as shown below:

configuration.TokeniseType = TokeniseType.UserOptional;

Transaction classes 



The default type is ecom


TransactionClass {
    Ecom, 
    Recurring;
}


You can pass/use it as shown below:

configuration.TransactionClass = TransactionClass.Recurring;

Token Formats


This option indicates the type of tokenization used. This field is required for creating tokenized (recurring) transactions. 


The default format is hex32.


TokeniseFromat {
    None, 
    Hex32, 
    AlphaNum20, 
    Digit22, 
    Digit16, 
    AlphaNum32;
}


You can pass/use it as shown below:

configuration.TokenFormat = TokeniseFromat.Hex32;

Transaction Type


This option is the identification of the type of transactionTo know more about these types please check our What is the "tran_type" (transaction type)? solution article.


- This is a required configuration parameter to perform any transaction.
- Only "Sale" and "Auth" types are supported in this SDK.
- The default type is "Sale".


TransactionType {
    Sale, 
    Authorize;
}


You can pass/use it as shown below:

configuration.TransactionType = TransactionType.Sale;

Alternative Payment Methods


Used to add another payment method in the payment form screen (such as Valu, StcPay, OmanNet, .. etc) or not. 


AlternativePaymentMethod {
    UnionPay, 
    StcPay, 
    Valu, 
    MeezaQR, 
    Omannet, 
    KnetCredit, 
    KnetDebit;
}


You can pass/use it as shown below:

configuration.alternativePaymentMethods = new string[] { AlternativePaymentMethod.StcPay, ...};




Android


Tokenise types


This option is used only when you want to tokenize the transaction for any further recurring transactions. This indicates whether the tokenization is optional or mandatory or if no tokenization will be done at all.

This field is required for creating tokenized (recurring) transactions. 

The default type is none


PaymentSdkTokenise {
    None,                                 // tokenise is off
    MerchantMandatory,         // tokenise is forced
    UserMandatory,                 // tokenise is forced as per user 
    UserOptional;                    // tokenise if optional as per user 
}


You can pass/use it as shown below:

configuration.TokeniseType = TokeniseType.UserOptional;



Token Formats


This option indicates the type of tokenization used. This field is required for creating tokenized (recurring) transactions. 


The default format is hex32.


PaymentSdkTokenFormat {
    None, 
    Hex32, 
    AlphaNum20, 
    Digit22, 
    Digit16, 
    AlphaNum32;
}


You can pass/use it as shown below:

configuration.TokenFormat = TokeniseFromat.Hex32;

Transaction Type


This option is the identification of the type of transactionTo know more about these types please check our What is the "tran_type" (transaction type)? solution article.


- This is a required configuration parameter to perform any transaction.
- Only "Sale" and "Auth" types are supported in this SDK.
- The default type is "Sale".


PaymentSdkTransactionType {
    Sale, 
    Auth;
}


You can pass/use it as shown below:

configuration.TransactionType = TransactionType.Sale;



Alternative Payment Methods


Used to add another payment method in the payment form screen (such as Valu, StcPay, OmanNet, .. etc) or not.


AlternativePaymentMethod {
    UnionPay, 
    StcPay, 
    Valu, 
    MeezaQr, 
    OmanNet, 
    KnetCredit, 
    KnetDebit;
}


You can pass/use it as shown below:

configuration.alternativePaymentMethods = new string[] { AlternativePaymentMethod.StcPay, ...};









To get familiar with the whole process and the other steps, kindly navigate to our "The Xamarin (Bridge) SDK Integration Manual" solution article. 

 And to navigate to the previous step in the integration process "Step 1 - Setup and activate the integration method" kindly click here.

 And to get familiar with the rest of the steps regarding the current step "Step 2 - Configure the integration method" click here.
Or you can navigate to the next step in the integration process "Step 3 - Initiating the payment" kindly click here.