Implementing Recurring Payments

Hyp does not provide built-in subscription lifecycle management. It does not store the charge interval, amount, or other recurring payment settings. As the merchant, you are responsible for managing subscription lifecycles internally and using Hyp's API only to execute the transactions.

The API flow differs between the initial payment and subsequent payments.

Initial payment using the payment page

When a customer makes the initial purchase — for example, signs up for a SaaS subscription with monthly billing — you collect the first payment through Hyp's standard payment page.

When Hyp performs a payment completion redirect, save the following URL parameters:

  1. cardToken: the token of the customer's card created by Hyp.

  2. cardExp: the card's expiration date.

You will need these values to initiate subsequent payments.

Some terminals also require the cardholder's Israeli ID number (תעודת זהות). In this case, you must save the ID number along with the token and expiration date. You receive the ID from the payment completion redirect as the personalId URL parameter and then use it in payment requests as the id parameter. Note that the Israeli ID number is considered sensitive personal data under privacy regulations such as the GDPR and the Israeli Privacy Law. As a merchant, you are responsible for ensuring the secure storage and handling of this information.

Second and subsequent payments

On the next billing date, perform a server-to-server payment request without customer interaction. Send a standard Hyp API request with the doDeal command payload in the int_in parameter:

<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>Internet</transactionCode>
            <validation>AutoComm</validation>
        </doDeal>
    </request>
</ashrait>

Variable parameters of the doDeal command in the server-to-server request are:

  • terminalNumber: a unique number assigned to you as a merchant during registration.

  • cardId: the card token that Hyp returned as the cardToken URL parameter in the payment completion redirect after the first payment.

  • cardExpiration: the card expiration date that Hyp returned as the cardExp URL parameter in the payment completion redirect.

  • total: the scheduled payment amount.

Here is an example of a successful response to the server-to-server payment request:

Show response

Repeat the same server-to-server payment request on each subsequent billing date.

Last updated

Was this helpful?