> For the complete documentation index, see [llms.txt](https://developers.hyp.co.il/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.hyp.co.il/enterprise/two-phase-commits/payment-page-auth.md).

# Payment Page Authorization

If you want to collect card data through a payment page, send an authorization request and then, once you've checked your inventory, send a follow-up capture request, here's what you need to do.

First, send a [payment page request](https://developers.hyp.co.il/enterprise/payment-page-integration/integrating-hyps-payment-page-and-accepting-payment.md#create-a-payment-page-request) where, inside the `doDeal` command, `mpiValidation` is set to `Verify`:

```xml
<ashrait>
      <request>
          <version>2000</version>
          <language>ENG</language>
          <command>doDeal</command>
          <doDeal>
              <terminalNumber>{terminalNumber}</terminalNumber>
              <cardNo>CGMPI</cardNo>
              <total>{totalAmount}</total>
              <transactionType>Debit</transactionType>
              <creditType>RegularCredit</creditType>
              <currency>ILS</currency>
              <transactionCode>Internet</transactionCode>
              <validation>TxnSetup</validation>
              <mid>{mid}</mid>
              <uniqueid>{uniqueId}</uniqueid>
              <mpiValidation>Verify</mpiValidation>
              <successUrl>{successUrl}</successUrl>
              <errorUrl>{errorUrl}</errorUrl>
          </doDeal>
      </request>
  </ashrait>
```

Extract and handle the returned payment page URL as usual.

When Hyp Enterprise performs a [payment completion redirect](https://developers.hyp.co.il/enterprise/payment-page-integration/integrating-hyps-payment-page-and-accepting-payment.md#handle-payment-completion-redirect), save the values of the following URL parameters:

1. `cardToken`
2. `cardExp`
3. `cgUid`

If your authorization request allowed [installments](https://developers.hyp.co.il/enterprise/payment-page-integration/installments.md), save the following values as well:

1. `numberOfPayments`
2. `periodicalPayment`
3. `firstPayment`

Take any steps you need before you're ready to charge the customer. Normally, acquirers allow up to 5 days between authorization and capture requests, although you may want to check the exact limit with your acquirer.

When you're ready, perform a capture request. This is a [standard Hyp Enterprise API request](https://developers.hyp.co.il/enterprise/introduction/request-and-response-general-structure.md) with the `doDeal` command payload in the `int_in` parameter:

```xml
<ashrait>
  <request>
      <version>2000</version>
      <language>ENG</language>
      <command>doDeal</command>
      <doDeal>
          <terminalNumber>{terminalNumber}</terminalNumber>
          <cardId>{cardToken}</cardId>
          <cardExpiration>{cardExp}</cardExpiration>
          <total>{total}</total>
          <transactionType>Debit</transactionType>
          <creditType>RegularCredit</creditType>
          <currency>ILS</currency>
          <transactionCode>Phone</transactionCode>
          <validation>AutoComm</validation>
          <cgUid>{cgUid}</cgUid>
      </doDeal>
</request>
</ashrait>
```

Variable parameters of the `doDeal` command in a capture request are:

* `terminalNumber`: a unique number assigned to you as a merchant during [registration](https://developers.hyp.co.il/enterprise/introduction/prerequisites-and-requirements.md).
* `cardId`: the card token that Hyp Enterprise returned as the `cardToken` URL parameter in the payment completion redirect following the authorization request.
* `cardExpiration`: the card expiration date that Hyp Enterprise returned as the `cardExp` URL parameter in the payment completion redirect.
* `cgUid`: the ID that Hyp Enterprise returned as the `cgUid` URL parameter in the payment completion redirect.
* `total`: the total amount to charge, which can be equal to or less than the authorized amount.
* If your authorization request allowed [installments](https://developers.hyp.co.il/enterprise/payment-page-integration/installments.md), make sure to also include `numberOfPayments`, `periodicalPayment` and `firstPayment` as saved from the payment completion redirect. If the amount you charge is less than the authorized amount, you need to recalculate the values of these three parameters. For more details, see [Installments in Direct Charge and Two-Phase Commit](https://developers.hyp.co.il/enterprise/additional-payment-scenarios/installments-direct-charge.md).

Here's a sample response for a successful capture request:

<details>

<summary>Show response</summary>

```xml
<?xml version='1.0'?>
<ashrait>
    <response>
        <command>doDeal</command>
        <dateTime>2025-08-19 20:29</dateTime>
        <requestId/>
        <tranId>119565716</tranId>
        <result>000</result>
        <message>Permitted transaction</message>
        <userMessage>Permitted transaction</userMessage>
        <additionalInfo>Host Result Local 00-SUCCESS</additionalInfo>
        <version>2000</version>
        <language>Eng</language>
        <doDeal>
            <status>000</status>
            <statusText>Permitted transaction</statusText>
            <extendedStatus/>
            <extendedStatusText/>
            <extendedUserMessage/>
            <terminalNumber>0882819014</terminalNumber>
            <cardId>1092880571131111</cardId>
            <cardBin>411111</cardBin>
            <cardMask>411111******1111</cardMask>
            <cardLength>16</cardLength>
            <cardNo>xxxxxxxxxxxx1111</cardNo>
            <cardName/>
            <cardExpiration>0328</cardExpiration>
            <cardType code="99">Foreign</cardType>
            <extendedCardType code="0">Credit</extendedCardType>
            <blockedCard/>
            <lifeStyle/>
            <customCardType/>
            <creditCompany code="0">Foreign</creditCompany>
            <cardBrand code="2">Visa</cardBrand>
            <cardAcquirer code="6">Alphacard</cardAcquirer>
            <serviceCode/>
            <transactionType code="01">RegularDebit</transactionType>
            <creditType code="1">RegularCredit</creditType>
            <currency code="1">ILS</currency>
            <baseCurrency/>
            <baseAmount/>
            <transactionCode code="52">Internet</transactionCode>
            <total>11400</total>
            <firstPayment/>
            <periodicalPayment/>
            <numberOfPayments/>
            <clubId/>
            <validation code="4">AutoComm</validation>
            <idStatus code=""/>
            <cvvStatus code=""/>
            <authSource code="3">VoiceMail</authSource>
            <authNumber>7420996</authNumber>
            <fileNumber>63</fileNumber>
            <slaveTerminalNumber>086</slaveTerminalNumber>
            <slaveTerminalSequence>451</slaveTerminalSequence>
            <eci>7</eci>
            <clientIp>84.50.146.252</clientIp>
            <email/>
            <cavv code=""/>
            <user/>
            <addonData/>
            <supplierNumber>300012</supplierNumber>
            <id/>
            <shiftId1/>
            <shiftId2/>
            <shiftId3/>
            <shiftTxnDate/>
            <cgUid>119565594</cgUid>
            <cardHash/>
            <acquirerData>
                <gateway>AshraitEmv</gateway>
                <acquirerResponseId>478808928365</acquirerResponseId>
                <mcc>4121</mcc>
                <acquirerTranType>01</acquirerTranType>
                <acquirerTranCode>52</acquirerTranCode>
            </acquirerData>
            <ashraitEmvData>
                <orgUid>25081920121808828195988</orgUid>
                <orgAuthCodeCreditCompany>1</orgAuthCodeCreditCompany>
                <orgAuthCodeAcquirer>0</orgAuthCodeAcquirer>
                <orgAuthNo>7420996</orgAuthNo>
                <orgAmount>11400</orgAmount>
                <orgTranDate>0819</orgTranDate>
                <orgCvvFlag>1</orgCvvFlag>
                <orgTranTime>201218</orgTranTime>
                <authCodeCreditCompany code="7">CreditCompanyPreAuthorized</authCodeCreditCompany>
                <uid>25081920121808828195988</uid>
                <idFlag>0</idFlag>
                <manufId>CGD</manufId>
                <catLevel>0</catLevel>
                <cvvFlag>0</cvvFlag>
                <manufUse>001101</manufUse>
                <ashVersion>x</ashVersion>
                <ashTermType>0</ashTermType>
                <deviceStatus>1111000000</deviceStatus>
                <authCodeAcquirer code="0">NoAuthNumber</authCodeAcquirer>
                <isDoReverseDeal>0</isDoReverseDeal>
                <mti>100</mti>
            </ashraitEmvData>
            <extendedTranCode/>
            <sendNotification/>
        </doDeal>
    </response>
</ashrait>
```

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.hyp.co.il/enterprise/two-phase-commits/payment-page-auth.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
