Generating Signature and Making API Requests
This section of the documentation explains how to generate a signature for requests and how to make requests to the E-Gates API to work with the payment method.
Generating a Signature
Prepare Parameters: For each request, prepare the parameters that will be passed. Include all necessary parameters in the request.
Create Query String: Formulate the query string, including all sorted parameters in the format key=value, separated by the & symbol.
Sign Query String: Use your private key to create a signature for the query string. Depending on the programming language you're using, you can use the following functions:
In PHP:
In JavaScript (using CryptoJS library):
Making API Requests
Set Headers: When making a request, set the following headers:
API-KEY: The value of the API key you created in your account.
SIGNATURE: The signature generated in the previous step.
Make Request: Use the programming language of your choice to perform an HTTP request to the E-Gates API. Pass all necessary parameters, headers, and the signature in the request.
Process Result: Handle the API response. Typically, successful responses contain required information, such as created invoices or other details.
Example: Creating an Invoice
Conclusion
Following this guide, you'll be able to successfully generate signatures for requests and interact with the E-Gates API to work with the payment method. Please ensure you follow all security measures and provide accurate parameters when forming requests and signatures.
Last updated