Onerway
Payment methods

Saudi local cards (cardpay)

Accept hosted cardpay payments with Saudi local cards through the Direct API or Checkout, supply customer and product details, and handle payment results and delivery information.

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/regionOrder currency
🇸🇦 SASAR

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.

FieldValue for this flow
merchantCustIdStable customer identifier in your system; reuse it for the same customer.
billingInformationCollected 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.
shippingInformationFollow 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.productsInclude 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.customerPlatformYour 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

  1. 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, and txnType=SALE. Set lpmsType=cardpay in lpmsInfo, encoded as a JSON string.
  2. 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 to orderAmount.
    Select the request example “Redirect local payment request (illustrative)”. It uses Bancontact / BE / EUR to show the shared structure. Replace the method with cardpay, use SAR for this flow and the customer’s actual address countries, then add the method-specific details above. Do not add cardInfo for this hosted flow.
  3. Store the returned paymentId and transactionId. When status=R and actionType=RedirectURL, redirect the customer’s browser to redirectUrl. 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.
  4. 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 authentication 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.

  1. On your server, call Create checkout payment with productType=ALL, subProductType=DIRECT, and txnType=SALE. To show only cardpay, set lpmsInfo.lpmsType to cardpay, sending lpmsInfo as a JSON string. If you omit lpmsInfo, the customer chooses from the methods available for the order.
  2. Supply the required billing, shipping, product, return URL, and notification URL fields. Encode billingInformation and shippingInformation as JSON strings. Keep product and order currencies consistent, and ensure that product amounts, discount entries, and shipping fees add up to orderAmount.
    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’s lpmsInfo if you want to select only cardpay. Remove cardInfo from the example for this hosted flow. The example shows the shared Checkout request structure.
  3. Select the response example “Unified Checkout session created”. Store the returned paymentId and transactionId against your order, then redirect the customer’s browser to redirectUrl. The initial status=U means that payment has not been completed.
  4. Checkout handles the payment page and subsequent customer interaction. When the customer reaches returnUrl, display the result retrieved from your server. For request authentication, 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 authentication 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:

  1. 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 redirectUrl opens Checkout and that cardpay is available.
  2. 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.
  3. 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.
  4. 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.