> For the complete documentation index, see [llms.txt](https://checkoutdocs.oneglobal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://checkoutdocs.oneglobal.com/direct-pay/4.-process-payment.md).

# 4. Process Payment

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 <mark style="color:blue;">**form.result**</mark> equals "SUCCESS" and <mark style="color:blue;">**form.response.gatewayRecommendation**</mark> 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.

{% tabs %}
{% tab title="Production Endpoint" %}

```
Direct pay Production Base URL /ProcessPayment
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
Direct Pay SandboxBase URL /ProcessPayment
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}

```
{
    "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
}
```

{% endtab %}

{% tab title="Sample Response" %}

```
{
  "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": "..."
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://checkoutdocs.oneglobal.com/direct-pay/4.-process-payment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
