rikudosama/cinetpay

A Laravel package for integrating CinetPay

dev-main 2025-02-03 09:49 UTC

This package is auto-updated.

Last update: 2025-05-01 00:14:41 UTC


README

A Laravel package for integrating CinetPay

Support us

Installation

You can install the package via composer:

composer require Rikudosama/Cinetpay

You can publish and run the migrations with:

php artisan vendor:publish --provider="Rikudosama\Cinetpay\CinetpayServiceProvider" --tag="config"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="config"

This is the contents of the published config file:

return [
     'api_key' => env('CINETPAY_API_KEY'),
    'site_id' => env('CINETPAY_SITE_ID'),
    'base_url' => env('CINETPAY_BASE_URL', 'https://api.cinetpay.com/v1/'),
];

Optionally, you can publish the views using

php artisan vendor:publish --tag=":cinetpay-views"

Usage

use Rikudosama\Cinetpay\Cinetpay;

class PaymentController extends Controller
{
    protected $cinetpay;

    public function __construct(Cinetpay $cinetpay)
    {
        $this->cinetpay = $cinetpay;
    }

    public function processPayment(Request $request)
    {
        $data = [
            // Les données requises pour le paiement
        ];

        $response = $this->cinetpay->makePayment($data);

        // Traitez la réponse comme nécessaire
    }
}

Usage views

return view('cinetpay::cinetpay');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.