Saudi local cards (cardpay)
Basic information
Customers follow the payment provider’s hosted page to pay by card and complete any requested verification.
- Integration paths: Direct API, Checkout
- Transaction type: One-time payment
lpmsInfo.lpmsType:cardpay
| Customer country/region | Order currency |
|---|---|
| 🇸🇦 SA | SAR |
The customer country/region is the billingInformation.country value in the payment request.
This guide covers enabled configurations for purchases of physical or digital goods, where you collect the customer and product details before creating the payment, as described in Before you begin. The value cardpay is lowercase. This is an aggregated card-payment method with a hosted payment page; it is not limited to mada cards. The Direct API flow below uses productType=LPMS and does not collect card details in your application. Before using another market or order currency, confirm the enabled scope for your merchant account and application with Onerway, then check the current order with List available payment methods.
Before you begin
Complete Setup and confirm that cardpay is enabled. Also confirm transaction limits, the applicable payment validity period, settlement arrangements, and the test procedure. For amount formatting, see Currency and amount validation.
Confirm that your merchant account and application are enabled for cardpay and the product categories you sell. Collect a stable customer identifier, billing name, email, and country; for physical goods, also collect the billing phone number and the delivery recipient’s full contact and address details. Use the customer’s actual billing and shipping countries. Configure your notification and return URLs, and store the mapping between your order and the Onerway identifiers.
Start the payment
Prepare customer and product details
For this flow, prepare the following fields before creating the payment. The shared API Reference example does not include all of these method-specific details.
| Field | Value for this flow |
|---|---|
merchantCustId | Stable customer identifier in your system; reuse it for the same customer. |
billingInformation | Collected firstName, lastName, email, and country. For physical goods, also supply phone and phoneCountryCode. Follow the API format for the local number and separate country code. |
shippingInformation | Follow the API conditions, including its required email and country. For physical goods, also provide the recipient’s firstName, lastName, phone, phoneCountryCode, city, address, and postalCode. For digital goods, the API’s required fields still apply. |
txnOrderMsg.products | Include the product name, quantity, unit price, currency, type, and productAvatarUrl. Categorize merchandise as physical or virtual; retain the API’s distinct types for shipping-fee and discount lines. |
txnOrderMsg.customerPlatform | Your website domain for web purchases or application name for app purchases. |
Encode billingInformation, shippingInformation, and txnOrderMsg as JSON strings. The nested txnOrderMsg.products value is also a JSON string. Follow the product field definitions for amounts and image requirements.
The field names and JSON-string encoding also apply to Create checkout payment. Include at least one merchandise item with type=physical or type=virtual. If any item is physical, supply the physical-goods details for the order.
Direct API
- Check List available payment methods for the current order. After the customer selects this method, call Create direct transaction from your server with
productType=LPMS,subProductType=DIRECT, andtxnType=SALE. SetlpmsType=cardpayinlpmsInfo, encoded as a JSON string. - Supply the customer and product fields above, plus notification and return URLs and merchant-collected end-user IP, browser, and device information in
txnOrderMsg. Keep product and order currencies consistent, with product amounts, discounts, and shipping fees adding up toorderAmount.
Select the request example “Redirect local payment request (illustrative)”. It uses Bancontact / BE / EUR to show the shared structure. Replace the method withcardpay, use SAR for this flow and the customer’s actual address countries, then add the method-specific details above. Do not addcardInfofor this hosted flow. - Store the returned
paymentIdandtransactionId. Whenstatus=RandactionType=RedirectURL, redirect the customer’s browser toredirectUrl. The shared response example “Redirect local payment response (illustrative)” shows this shape. For other returned actions or statuses, follow Local payment integration; do not repeatedly create the same order. - The payment provider collects the card details and guides the customer through payment. When the customer returns to your site, display the result retrieved from your server. See Request signing for request authentication.
Checkout
When locking Checkout to this method, first confirm that it is returned by List available payment methods for the current order. When Checkout displays all available methods, Onerway performs this filtering. Supply the customer and product details prepared above.
- On your server, call Create checkout payment with
productType=ALL,subProductType=DIRECT, andtxnType=SALE. To show only cardpay, setlpmsInfo.lpmsTypetocardpay, sendinglpmsInfoas a JSON string. If you omitlpmsInfo, the customer chooses from the methods available for the order. - Supply the required billing, shipping, product, return URL, and notification URL fields. Encode
billingInformationandshippingInformationas JSON strings. Keep product and order currencies consistent, and ensure that product amounts, discount entries, and shipping fees add up toorderAmount.
Select the request example “Unified Checkout with all available payment methods”. Replace the order and customer details, use SAR for this flow, and add this method’slpmsInfoif you want to select only cardpay. RemovecardInfofrom the example for this hosted flow. The example shows the shared Checkout request structure. - Select the response example “Unified Checkout session created”. Store the returned
paymentIdandtransactionIdagainst your order, then redirect the customer’s browser toredirectUrl. The initialstatus=Umeans that payment has not been completed. - Checkout handles the payment page and subsequent customer interaction. When the customer reaches
returnUrl, display the result retrieved from your server. For signing, redirects, and return handling, see Checkout integration.
Customer actions and final result
Customers follow the hosted payment page to pay by card. They review the amount, provide the information requested, and complete any cardholder verification required for that payment. Your application does not collect the card details or verification code for this flow.
Customers may leave before completing verification or payment. Completing verification or returning to your site does not confirm payment. Keep the order awaiting confirmation until your server retrieves the result.
Process the order using a signature-verified payment result webhook. If no notification has arrived or you need to check the result, call Query payments with the stored paymentId. Fulfill the order only after your server confirms a successful payment. For verification, acknowledgement, idempotency, and query fallback, see Webhooks.
Delivery information and settlement
For physical goods, fulfill the order after your server confirms successful payment. Once the package has actually been delivered and signed for, call Upload logistics information for that successful transaction. Use its original transactionId, select carrierNo from the linked carrier list, and submit the real trackingNo. The API Reference contains the shared request example and signing requirements.
Payment success and settlement eligibility are separate. Delivery information is used for subsequent settlement processing; a successful upload response does not mean that settlement funds have arrived. Submitting the same transactionId again replaces the saved logistics information, so verify corrections before resubmitting.
For digital-goods purchases, you do not upload logistics information.
Refunds and disputes
Confirm the refund capabilities, restrictions, and dispute process applicable to your merchant with Onerway. If refunds are enabled, follow Refunds.
Testing and go-live
Confirm the test environment and available cardpay test procedure with Onerway, then follow Sandbox testing:
- Test each path you use with SAR and the required customer and product details. For the Direct API, verify that the returned action opens the provider’s payment page. For Checkout, verify that
redirectUrlopens Checkout and that cardpay is available. - Complete the agreed card-payment and verification test on the hosted page, then verify the result on your server. Completing verification alone does not pass the successful-payment check.
- Test a customer leaving before payment, failed verification or payment, and a return to your site before a final result. Verify query fallback when no notification has arrived and idempotent handling of duplicate notifications. For physical goods, separately verify the agreed logistics-upload procedure after the package has been delivered and signed for; do not use fabricated shipment details.
- For go-live acceptance, retain the notification and acknowledgement for the same order. Query the payment status and check that it matches the notification. Check production enablement, notification and return URLs, limits, and validity periods. Test refunds separately if they are enabled.
JD Pay
Accept one-time JD Pay payments for physical goods through the Direct API or browser Checkout, with an explicit business type, and confirm the result on your server.
BLIK Seamless
Collect a one-time BLIK code on your page, submit it through the Direct API, and confirm payment after the customer authorizes it in their banking app.