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 which payment methods be available for your customers on the payment page. The following string values can be passed within the "paymentMethods" array, which is passed as the first parameter to the "createPaymentPage" function, as shown below:
let paymentMethods = ["all"]; paytabs.createPaymentPage( paymentMethods, transaction_details, cart_details, customer_details, shipping_address, response_URLs, lang, paymentPageCreated );
This "paymentMethods" parameter is Mandatory, not passing it would throw an exception.
All available Payment methodsYou can send the value "all" to show all available/configured payment methods on your PayTabs account on the payment page.
let paymentMethods = ["all"];
This is the default value. In other words, not passing this parameter at all will be the same as passing this "all" value.
Multiple Payment methods
To initiate a payment page with multiple specific payment methods, you can pass a comma-separated string with all the preferred payment methods, as shown below:
let paymentMethods = ["creditcard, valu"];
let paymentMethods = ["creditcard, valu, applepay"];
Excluding Payment methods
You can initiate a payment page with all the configured payment methods, excluding one method or more from being displayed in the payment by adding (-) before the excluded payment method, as shown below:
let paymentMethods = ["creditcard, -valu"];
let paymentMethods = ["creditcard, -valu, -applepay"];
⌂ 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.