Skip to content
Last updated

Solutions

The ZRU API allows three types of integrations, each one adapts to different needs, allowing you to model any scenario you want to achieve through the API.

You can see an example of each type of integration in the Our solution section of our website.

Through the ZRU Panel, payment links can also be generated to send to the customer and make payments without using the API.

Redirect

This would be the simplest integration of all, after a few lines we are already receiving payments.

The flow would be the following:

  1. The user requests to pay for the order
  2. The payment order is created through the ZRU API (using the public and private key obtained from the ZRU Panel)
  3. The ZRU API returns a response, and using the token included in the response, you must create the redirect url using this format: https://pay.mychoice2pay.com/TOKEN (TOKEN must replaced by the value of token).
  4. The user is taken to the redirect url, which would be the ZRU payment screen
  5. The user is redirected to a different page, depending on the payment status. In case the payment completed correctly, the user is forwarded to return_url, already sent when the payment order was created. In case the user cancels the payment, it will return to the cancel_url already sent when the payment order was created

*. ZRU will send a notification confirming the payment to the notification_url sent when the payment order was created. Likewise, it will send notifications in case of changes related to the payment, or errors, or in case it is a subscription or authorization, it will notify of each payment received.

iFrame

It is quite similar to Redirect, the only difference is that the user never leaves your domain because an iframe is used to make the payment.

  1. The user requests to pay for the order
  2. The payment order is created through the ZRU API (using the public and private key obtained from the ZRU Panel)
  3. The ZRU API returns a response, and using the token included in the response, you must create the iframe url using this format: https://pay.mychoice2pay.com/TOKEN/iframe (TOKEN must replaced by the value of token).
  4. An iframe is created in the user interface with the iframe url with the following parameters: <iframe allowpaymentrequest sandbox="allow-forms allow-popups allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation" src="IFRAME_URL" frameBorder="0" style="width: 100%; height: 700px"></iframe>
  5. The user is redirected to a different page, depending on the payment status. In case the payment completed correctly, the user is forwarded to return_url, already sent when the payment order was created. In case the user cancels the payment, it will return to the cancel_url already sent when the payment order was created

*. ZRU will send a notification confirming the payment to the notification_url sent when the payment order was created. Likewise, it will send notifications in case of changes related to the payment, or errors, or in case it is a subscription or authorization, it will notify of each payment received.

Custom

This way of integrating ZRU allows everything to be done in your domain and you can customize every detail of the user experience when paying.

  1. The user requests to pay for the order
  2. The payment order is created through the ZRU API (using the public and private key obtained from the ZRU Panel)
  3. The ZRU API returns a response, among the data it returns will be the token that we will use in the rest of the steps.
  4. The token is sent to the user interface.
  5. The payment methods available for that payment order are requested through the ZRU API, using the token and the public key.
  6. The ZRU API returns the information about the payment methods and their types.
  7. Based on the type of gateway, two things can happen: a. In the case of card gateways, the card information will be sent to the ZRU API.

b. In the case of form gateways, the user must be sent to the url https://pay.mychoice2pay.com/<token>/redirect/<gateway_code>. The user will be redirected to the gateway to finalize the payment.

  • The answer depends on the way used between 7.a and 7.b. a. The ZRU API responds with the confirmation or not of the payment. If it is affirmative, the payment is completed.

b. The user returns to the return_url sent when the payment order was created in case the payment completes correctly, in case the user cancels the payment, it will return to the cancel_url sent when the payment order was created.

*. ZRU will send a notification confirming the payment to the notification_url sent when the payment order was created. Likewise, it will send notifications in case of changes related to the payment, or errors, or in case it is a subscription or authorization, it will notify of each payment received.