Casheer KW
  • Introduction
  • Integration Steps
  • Types of Integration
    • 1. Standard Pay
    • 2. Plugins
    • 3. SDK
  • Sample Code
    • 1. Get Payment URL
    • 2. Redirect to Payment URL
    • 3. Callback To Merchant Portal
    • 4. Compute HASH
    • 5. Refund Request
    • 6, Payment Status
  • Parameters & Description
  • Payment Methods
  • Test Cards
  • Download Plugins/SDK
  • Direct Pay
    • 1. Generate Merchant Keys
    • 2. Validate Request
    • 3. Initiate Pay
    • 4. Process Payment
  • Modules Setup Guides
    • WooCommerce
    • Drupal Commerce
    • OpenCart
    • Magento 1
    • Magento 2
    • PrestaShop
    • Joomla
    • WHMCS
Powered by GitBook
On this page
  1. Direct Pay

4. Process Payment

Use the ProcessPayment request to initiate a payment process for a given ReferenceId.

Upon completing the 3DS authentication process, the user is redirected to the endpoint specified in the Acs_CallbackUrl parameter of the InitiatePay request. The merchant receives a response containing a form object at this endpoint. The merchant must verify that form.result equals "SUCCESS" and form.response.gatewayRecommendation equals "PROCEED" to determine whether to proceed with the payment process. If both conditions are satisfied, the merchant should call the ProcessPayment API with the specified parameters.

API Edpoints

https://kwpaypg.casheer.com/COFWAY/ProcessPayment
https://kwpaypgsb.casheer.com/COFWAY/ProcessPayment   
 {
    "ReferenceId": "xxxxxxxxxxxx",  // 15-digit reference id used in the validate request
    "MerchantId": "KW23821",        // Merchant code
     "Result": "success",             // result received in the form.result object
    "GatewayRecommendation": "PROCEED" // Gateway recommendation received in the form.result.gatewayrecommandation
}

  "errorCode": 0,
  "errorMessgae": "SUCCESS",
  "result": {
    "error": null,
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "",
    "order": {
      "amount": 10,
      "certainty": null,
      "creationTime": "2025-04-23T10:27:26.416Z",
      "currency": "USD",
      "id": "543839849919125",
      "status": "CAPTURED",
      "totalAuthorizedAmount": 10,
      "totalCapturedAmount": 10,
      "totalRefundedAmount": 0,
      "authenticationStatus": "AUTHENTICATION_SUCCESSFUL",
      "lastUpdatedTime": "2025-04-23T10:27:41.733+00:00",
      "merchantCategoryCode": "5399",
      "valueTransfer": null
    },
    "response": {
      "the3DSecure": null,
      "acquirerCode": "00",
      "acquirerMessage": "Approved",
      "gatewayCode": "APPROVED",
      "gatewayRecommendation": "NO_ACTION"
    },
    "result": "SUCCESS",
    "sourceOfFunds": {
      "provided": {
        "card": {
          "brand": "MASTERCARD",
          "number": "512345xxxxxx0008",
          "securityCode": null,
          "expiry": {
            "month": "1",
            "year": "39"
          }
        }
      },
      "type": "CARD"
    },
    "timeOfRecord": "2025-04-23T13:27:41.529+03:00",
    "transaction": {
      "acquirer": {
        "batch": 20250423,
        "date": "0423",
        "id": "NBK_S2I",
        "merchantId": "900459840",
        "settlementDate": "2025-04-23T00:00:00",
        "timeZone": "+0300",
        "tra": "..."
      }
    }
  }
}

Upon receiving the response from the ProcessPayment API, the merchant must verify the errorCode to determine the next steps. If the errorCode is 0, indicating a successful API call, the merchant should parse the result object and verify that result.result equals "SUCCESS" and result.response.acquirerMessage equals "APPROVED". These conditions confirm a successful payment transaction.

Previous3. Initiate PayNextWooCommerce

Last updated 11 days ago