PayTabs Node.js Package makes integration with the PayTabs payment gateway very easy by providing a ready-made payment class 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 how to initiate a payment request with a specific transaction type. The following string values can be passed within the "transaction_details" array, which is passed as the second parameter to the "createPaymentPage" function, as shown below: 


Through out the article we will use the transaction types clarified in our What is "tran_type"? solution article.


  • "auth"
  • "sale"


let transaction = {
    type:"sale",
    class:"ecom"
};

let transaction_details = [
    transaction.type,
    transaction.class
];

paytabs.createPaymentPage(
    paymentMethods,
    transaction_details, // array expected 
    cart_details,
    customer_details,
    shipping_address,
    response_URLs,
    lang,
    paymentPageCreated
);


This "transaction_details" parameter is Mandatory, not passing it would throw an exception.



The "transaction_details" is an array of two elements the first one is the tranaction type which you can mange as shown below, but the second one is the transaction class that will be always "ecom" NO other options are availabe using this package.


  • Sale

    This means that the amount of the transaction will be deducted directly from the customer's bank account once he submits the purchase, and it will be transferred to the acquirer's bank account. 



  • Auth

    This means the amount of the purchase will be deducted from the cardholder's bank account, yet it will be held (authorized) for a certain period of time/days, differing from one issuer bank to another. This amount will remain at the cardholder bank until it gets captured. In other words, it will not be transferred to the acquirer's bank account until it gets captured from your side; otherwise, it will be voided back to the customer.







⌂ To get familiar with the whole process and the other steps, kindly navigate to our "The Node.js Packge Integration Manual" solution article. 
        
And to get familiar with the rest of the steps regarding the previous step
"Step 2 - Configure the integration method" kindly click here. And to get familiar with the rest of the steps regarding the current step "Step 3 - Initiating the payment" click here.
        
 And to navigate to the next step in the integration process "Step 4 - Accepting the payment" kindly click here.