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.
When a client decides to pay with ETpay, a flow is triggered thats works on the next way:
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. |
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: