If your are doing a Laravel project and want to integrate Chapa's payment solution, this package would help big time.
Go to Chapa to signup and get your secret key
'composer require negusnati/chapa-laravel-11x'
Please visit Chapa for full documentation.
Please visit Developers Guide for full guide and examples.
You can check this sample Laravel code as a reference.
Open your .env file and add your public key, secret keys, and other environment variables like this:
CHAPA_SECRET_KEY=CHAPA-SECK-xxxxxxxxxxxxxxxxxxxxx-X
The current features have been implemented
- Initiate Payment
- Payment verification
POST https://api.chapa.co/v1/transaction/initialize
Parameter | Type | Required | Description |
---|---|---|---|
key |
string |
Yes. | This will be your public key from Chapa. When on test mode use the test key, and when on live mode use the live key. |
email |
string |
No. | A customer’s email. address. |
phone_number |
numeric |
No. | A customer’s phone number. address. |
amount |
string |
Yes. | The amount you will be charging your customer. |
first_name |
string |
No. | A customer’s first name. |
last_name |
string |
No. | A customer’s last name. |
tx_ref |
string |
Yes. | A unique reference given to each transaction. |
callback_url |
string |
No. | Function that runs when payment is successful. This should ideally be a script that uses the verify endpoint on the Chapa API to check the status of the transaction. |
return_url |
string |
No. | A web address provided by the merchant to a payment gateway during payment integration. It serves as the destination where the payment gateway sends the customer after completing a payment transaction. |
currency |
string |
Yes. | The currency in which all the charges are made. Currency allowed is ETB. |
customization[tiitle] |
string |
No. | The customizations field (optional) allows you to customize the look and feel of the payment modal. You can set a logo, the store name to be displayed (title), and a description for the payment.. |
customization[description] |
string |
No. | The customizations field (optional) allows you to customize the look and feel of the payment modal. |
GET https://api.chapa.dev/v1/transaction/verify/{tx-ref}
Parameter | Type | Required | Description |
---|---|---|---|
key |
string |
Yes. | This will be your public key from Chapa. When on test mode use the test key, and when on live mode use the live key. |
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.