To process Mada cards within Saudi Arabia, you will first need to obtain a merchant ID from a Saudi Arabian card acquirer.
Currently, you can only process purchases and refunds with Mada – authorization and void requests will be rejected.
Once the customer submits the credit card form, the first six digits of their card – the bank identification number (BIN) – will be returned, and you'll need to compare this against the list of Mada BINs. If the card's BIN matches one from the list, you'll know it's a Mada card.
Next, follow these steps:
Before you redirect the customer, send a hidden HTML field or another indication that the card type is Mada to your server. For instance: <input name=”cardType” type=”hidden” value=”mada”>.
In the backend code, check if the posted hidden variable cardType was a Mada card. If so, make sure you:
set "3ds.enabled" to true to process the payment with 3D Secure authentication,
set "metadata.udf1" to "mada", and
do not pass "capture" or "capture_on" in the request.
To process a Mada card with full card details, simply follow the steps in the Frames section above.
The only difference is that you won't need to wait to receive the customer's BIN because you'll have full access to the card number. Simply get the first six digits from the card form, compare it with the Mada BIN list, and then send a request with the required parameters described in the Frames section above.
To process Mada card payments through a mobile app, follow the Frames process above.
Like step 1 in that process, before you post the cart data and checkout data to your web server, you'll need to add a field to your API request that indicates whether or not it's a Mada card. For example: cardType:”mada”
Mada cards processed through Apple Pay all have the same BIN: 506968
Mada cards can be processed the same way as other cards in Apple Pay, but you'll need to make sure that the device's payments permission is enabled for your merchant ID.
Also, in order to process Mada cards on the local Saudi Arabian network, you'll need to include mada in the supportedNetworks array.
Please contact your Account Manager if you’re not dealing with the acquiring bank directly.