Short answer: install the free Chargily Pay plugin for Moodle, paste your Chargily secret key into a payment account, and price your course in dinars. Learners then pay with their EDAHABIA (Algérie Poste) or CIB card on Chargily’s secure page, and Moodle enrols them as soon as Chargily confirms the payment.
This guide covers the whole setup, test mode first, and what to check before you take real payments.
Who is this for?
Anyone running Moodle who sells courses to learners in Algeria: training centres, schools, independent teachers, companies. Algerian learners mostly pay online with two cards: EDAHABIA, issued by Algérie Poste, and the CIB bank cards. Both run on the SATIM network, and only in dinars (DZD). Moodle’s built-in PayPal gateway does not help here: PayPal is not open to Algerian merchants.
Chargily Pay is an Algerian payment company with a public API and a test mode, which makes it the easiest of the Algerian gateways to set up yourself.
What do you need?
| You need | Where to get it |
|---|---|
| Moodle 4.5 to 5.3 | Your site, as administrator |
| A Chargily Pay account | chargily.com. Test mode works right after sign-up; live payments need the account verified |
| The Chargily Pay plugin for Moodle | github.com/devlms/moodle-paygw_chargily, free and open source (GPL) |
| A course to sell | With the Enrolment on payment method, or anything else in Moodle that takes payments |
Step 1: get your Chargily secret key
Sign in to the Chargily Pay dashboard and open the Developers Corner. You will see two pairs of keys:
- Test keys start with
test_sk_. Payments in test mode move no money. - Live keys start with
live_sk_. Chargily shows them once your account is verified.
Copy the test secret key for now. Keep it private: anyone with it can create payments in your name.
Step 2: install the plugin
- Download the latest release from the plugin’s releases page.
- Unzip it into
payment/gateway/chargilyin your Moodle folder (or use Site administration > Plugins > Install plugins and upload the zip). - Visit Site administration > Notifications and finish the upgrade.
If you use the DevLMS payment hub, you do not need to download anything: open the hub’s Gateways page and press Activate next to Chargily Pay.
Step 3: enable Chargily Pay
Go to Site administration > Plugins > Payment gateways > Manage payment gateways and enable Chargily Pay. Until it is enabled here, payment accounts cannot use it.
Step 4: add your key to a payment account
- Go to Site administration > Payments > Payment accounts. Create an account if you have none.
- Next to Chargily Pay, choose the settings link.
- Paste the secret key.
- Tick the cards you accept: EDAHABIA, CIB or both.
- Enable it and save.
The form shows a webhook address. There is nothing to copy into the Chargily dashboard: the plugin sends that address to Chargily with every payment, and Chargily uses it to report the result.
Step 5: price a course in dinars
- Enable the Enrolment on payment method in Site administration > Plugins > Enrolments, if it is not already.
- In the course, go to Participants > Enrolment methods and add Enrolment on payment.
- Choose the payment account from step 4, set the currency to Algerian Dinar (DZD) and enter the price.
Chargily takes whole dinars, so a price with centimes is rounded up: 2500.40 DZD is charged as 2501 DZD.
Step 6: test a payment
Log in as a test learner, open the course and choose Pay. In Moodle’s payment window choose EDAHABIA or CIB card (Chargily Pay), then pick a card type. You land on Chargily’s test checkout; complete it with the test details Chargily gives in its dashboard.
When you come back to Moodle, the plugin asks Chargily for the result before it does anything. A successful test payment enrols the learner and appears in Site administration > Reports > Payments.
Then try a cancelled payment: the learner sees that nothing was charged and can try again.
Step 7: go live
When your Chargily account is verified, replace the test key with the live secret key (live_sk_...) in the payment account. Nothing else changes. Make one small real payment yourself before you announce it.
How does the plugin keep payments safe?
- Card details never touch your Moodle. Learners type them on Chargily’s page.
- Moodle never trusts the redirect. Coming back from Chargily, or receiving a webhook, only makes the plugin ask Chargily’s API for the checkout’s status.
- Webhooks are signed. Chargily signs each one with your secret key (HMAC-SHA256); the plugin rejects anything that does not match.
- The amount must match. A checkout Chargily reports as paid for a different amount or currency is not delivered.
- Each payment is delivered once, even when the return page and the webhook arrive at the same time.
What about learners abroad?
Chargily only takes dinars, from Algerian cards. To also sell to learners outside Algeria, add an international gateway next to it. The DevLMS payment hub shows both at one checkout, each with its own price: “Local payment” in DZD with EDAHABIA or CIB, and “International payment” for cards from anywhere, with your own exchange rate. See the payment hub.
Common problems
| Problem | What to check |
|---|---|
| Chargily is not in the payment window | The gateway is enabled in Manage payment gateways, the account has Chargily enabled, and the course price is in DZD |
| ”Enter a Chargily secret key” when saving | The key must start with test_sk_ or live_sk_. Public keys (pk_) do not work here |
| The learner paid but is not enrolled yet | Open the return page again (“Check again”). If Chargily could not reach your site, the webhook retries; the payment is delivered on the first successful check |
| You need to refund | Chargily has no refund API. Refund from the Chargily dashboard, then unenrol the learner in Moodle |
Need something more?
Chargily is one of eight Algerian payment providers we looked at, and one of 238 worldwide in our payment providers list. For SofizPay, see the SofizPay guide. If you need SATIM direct, an installment plan, or payment wired to your own systems, ask us for a fixed price.