On the next section will be specified how to implement the payment services with the basic functionalities, there exist some extra custom features that are detailed on Aditional customization features.

Summary of the process


When a client decides to pay with ETpay, a flow is triggered thats works on the next way:

  1. CREATE SESSION ****From the merchant's website a POST request is generated to our API to obtain the session_token that allows the customer to initiate the payment session.
  2. START FUNNEL ****From the merchant’s website it’s redirect to the link of the session with the token that obtain on the last step.
  3. CLIENT SESSION (FUNNEL) Process that user realize to complete the transfer
  4. SUCCESS/ERROR REDIRECT When the user complete the payment process on our funnel, this will be redirected to the success or error url. This is only to bring a visual confirmation to the user on the commerce page.
  5. RECEPTION OF NOTIFICATION ****ETpay do a POST request to the webhook URL specify by the commerce. This request confirm the final status of the payment (success/error) and require a information validation step.

Definitions:

Parameter Description
merchant_code Id of the commerce, delivered at the beginning of the process after complete the Basic requirements .
merchant_api_token Authentication token to use the API, delivered at the beginning of the process after complete the Basic requirements .
api_url URL of services and session creation, delivered at the beginning of the process after complete the Basic requirements .
pmt_url Payment Gateway URL, be use together the session_token to initialize the payment flow of the client. this will vary between sandbox and pre-productive/productive. delivered at the beginning of the process after complete the Basic requirements .
merchant_order_id ID of the commerce, will be use at the moment of create the payment session (alphanumeric - max 64 lenght). Usually used the payment order number.
order_amount Order amount, used at the creation of the sesion
session_token Unique session token, returned by the response of the API at the moment of the creation of the session, be use together the pmt_url to initialize the payment flow of the client.
signature_token Signature token, returned by the response of the API at the moment of the creation of the session. Use to validate the information notifications of the JWTs.
JWT The JWT is a secure and easy way to transmit the information by web.
This are encrypted and have a “signature” to guarantee that the content didn’t changed. In our case, the signature of the JWT its the signature_token.
If the content of the JWT change, we can know with the signature_token because well be obtained different values when ill try to validate.
payment_token Payment ID, this ID be returned when the payment session is completed and permit to identify all the payment information on our system.

Development by stage


Session creation

The first step of the payment process consist on obtain a session_token by a POST request from the server of the commerce (not from the client browser) with the merchant_code and merchant_api_key to the next endpoint: [API_URL]/session/initialize. The body must have a JSON with the next variables:

{
    "merchant_code": "your_merchant_code",
    "merchant_api_token": "your_merchant_api_token",
    "merchant_order_id": "your_order_id",
    "order_amount": 10
}

<aside> <img src="/icons/info-alternate_blue.svg" alt="/icons/info-alternate_blue.svg" width="40px" /> We have a simplify example in POSTMAN in Quick Start

</aside>

<aside> ⚠️ Considerate that the credentials and URLs changes between enviorements (Sandbox/Preproductive)

</aside>

If the POST request format is the correct, our API will response a JSON with the next information: