Chargily Pay, a gateway that allows you to accept online payments with many payment methods in Algeria such as EDAHABIA and CIB cards.
First, start by creating an account on Chargily. Then create your application on the dashboard.
You will be on the Test Mode by default, you can switch to Live Mode (you need to verify your identity first) when you are ready to go live.
The endpoint of this service in Test Mode is https://pay.chargily.net/test/api/v2 and in Live Mode is https://pay.chargily.net/api/v2.
To create a payment, you need to send a POST request to the endpoint with the following parameters:
amount: The amount of the payment in DZD.currency: The currency of the payment, alwaysDZD.success_url: The URL to redirect the user to after a successful payment.
The structure of a webhook's payload
type: The type key in the payload indicates the type of event that occurred.
data: The data key in the payload contains the object related to the event.
Create your webhook endpoint
You need to set up an endpoint on your backend that accepts POST requests so that Chargily Pay can send you the webhooks.
What should your endpoint do:
- Verifying the signature
- Identify the event
- Handle the event
- Respond with a 200 response