Manage the Payment Methods
PayTabs provides you with the backend packages that make the integrating with PayTabs payment gateway very easy by providing ready-made classes that handle the payment process.
This article is dedicated to walking you through managing the payment methods available for your customers on the payment page. The following payment methods keys can be sent within the sendPaymentCode
function as shown below:
Supported Payment Methods List:
CreditCard: | creditcard |
Amex: | amex |
mada: | mada |
UrPay: | urpay |
UnionPay: | unionpay |
StcPay: | stcpay |
StcPay(QR): | stcpayqr |
Valu: | valu |
Aman: | aman |
Meeza (QR): | meezaqr |
OmanNet Debit: | omannet |
KnPay: | knet |
KnPay (Debit): | knetdebit |
KnPay (Credit): | knetcredit |
ApplePay: | applepay |
SamsungPay: | samsungpay |
NBE installment: | installment |
Forsa: | forsa |
Halan: | halan |
Tamara: | tamara |
Aman installments: | amaninstallments |
Souhoola: | souhoola |
Tabby: | tabby |
Touchpoints: | touchpoints |
PayPal: | paypal |
Sadad: | sadad |
Method Specification
Description | Accept and filter supported payment methods. |
---|---|
Since | 1.0.0 |
Required | ✘ |
Signature |
|
Sample |
|
Method Parameters:
Code
Name | $code |
---|---|
Type | STRING |
Description | Accept |
Default | "all" |
Required | ✘ |
Method Parameter Behavior:
All available Payment methods
You can send the value "all" to show all available/configured payment methods on your PayTabs account on the payment page.
paypage::sendPaymentCode("all")
Multiple Payment methods
To initiate a payment page with multiple specific payment methods, you can pass a comma-separate string with all the preferred payment methods, as shown below:
paypage::sendPaymentCode("creditcard, valu");
paypage::sendPaymentCode("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:
paypage::sendPaymentCode("creditcard, -valu");
paypage::sendPaymentCode("creditcard, -valu, -applepay")
Expected payment flow behaviour:
- As a merchant you would initiate a payment request per the above Specifications, which include a sample code.
- Then, you will call the method create_pay_page() and return the result to redirect the customer to the payment page.
try {
$paymentPage = paypage::sendPaymentCode('all')
->sendTransaction('sale','ecom')
->sendCart("Order_101", 1000.00, 'Order Description')
->create_pay_page();
return $paymentPage;
} catch (\Exception $e) {
// Handle errors appropriately
return back()->with('error', 'Payment initiation failed: ' . $e->getMessage());
} - After this, your customer would proceed normally with payment by choosing the preferred payment method (if available), and providing his card information.
- Then, he will be redirected to his issuer bank 3DS/OTP page to authenticate the used card
- Finally, he would be redirect to a success/error page accordingly. By this time, you will be able to see his transaction on your merchant dashboard, whether it's accepted/authorized or not.