Download the PHP package mcire/paytech without Composer
On this page you can find all versions of the php package mcire/paytech. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mcire/paytech
More information about mcire/paytech
Files in mcire/paytech
Package paytech
Short Description Integration of PayTech payment gateway for Laravel
License MIT
Informations about the package paytech
PayTech Package for Laravel
This package provides an easy integration of the PayTech payment gateway into your Laravel applications.
Installation
🧿 Prerequisite
You have already created a controller for payments, an associated route and a view containing the product purchase form.
⬇ Install now
The package discovery is enabled by default in Laravel 5.5+. If you're using an earlier version, manually add the service provider and facade in config/app.php
:
Configuration
Publish the configuration file:
Add the following variables to your .env
file:
Tips for configuring PayTech's IPN locally
PayTech requires the callback route (IPN) to be accessible via HTTPS. This can pose a challenge during local development.
If you don't need to handle IPN calls :
simply configure the IPN URL as follows
If you need to handle IPN calls locally:
Usage
Initiating a Payment (Put it inside your payment controller)
Available Parameters
Parameter | Type | Description | Required |
---|---|---|---|
item_name | string | Product name | Yes |
item_price | integer | Price in cents | Yes |
currency | string | Currency (XOF, EUR, etc.) | Yes |
ref_command | string | Unique order reference | Yes |
command_name | string | Order description | Yes |
Handling Returns
The package automatically handles three types of returns:
-
IPN (Instant Payment Notification)
- URL configured in
PAYTECH_IPN_URL
- Server-to-server notification from PayTech
- Used to update order status
- URL configured in
-
Success Page
- URL configured in
PAYTECH_SUCCESS_URL
- Redirection after successful payment
- URL configured in
- Cancel Page
- URL configured in
PAYTECH_CANCEL_URL
- Redirection after payment cancellation
- URL configured in
Environments
The package supports two environments:
- test: For testing (default)
- prod: For production
Configure the environment via the PAYTECH_ENV
variable in your .env
file.
Security
- All requests are made over HTTPS
- API keys are securely stored in the
.env
file - Communications are authenticated via API_KEY and API_SECRET headers
Common Error Codes
Code | Description | Solution |
---|---|---|
400 | Invalid parameters | Check the sent parameters |
401 | Authentication failed | Verify your API keys |
500 | Server error | Contact PayTech support |
Support
For any questions or issues:
- Open an issue on GitHub
- Contact me at [email protected]
License
This package is open-sourced software licensed under the MIT license. See the LICENSE file for more details. This package provides an easy integration of the PayTech payment gateway into your Laravel applications.