dinwwwh / laravel-card-charging-v2

Package for interacting with api from `card charging v2` (thesieure.com, doithengay.com,...)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Package for interacting with api from card charging v2 (thesieure.com, doithengay.com,...)

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

composer require dinhdjj/laravel-card-charging-v2

You can publish and run the migrations with:

    php artisan vendor:publish --tag="card-charging-v2-migrations"
    php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="card-charging-v2-config"

This is the contents of the published config file:

return [
    // Default connection
    'default' => env('THESIEURE_CONNECTION', 'default'),

    // List config connection
    'connections' => [
        'default' => [
            'domain' => env('THESIEURE_DOMAIN', 'thesieure.com'),
            'partner_id' => env('THESIEURE_PARTNER_ID'),
            'partner_key' => env('THESIEURE_PARTNER_KEY'),
        ],
    ],

    // Related to card model
    'card' => [
        'table' => 'card_charging_v2',
        'model' => Dinhdjj\CardChargingV2\Models\Card::class,
    ],

    'callback' => [
        'uri' => 'api/card-charging-v2/callback',
        'middleware' => ['api'],
        'name' => 'card-charging-v2-callback',
        'controller' => Dinhdjj\CardChargingV2\Controllers\CallbackController::class,
        // Event will dispatch after callback is called (validated callback signature)
        'event' => Dinhdjj\CardChargingV2\Events\CallbackCalled::class,
    ],
];

Usage

use CardChargingV2;

/** @var \Dinhdjj\CardChargingV2\Data\CardType[] */
$cardTypes =  CardChargingV2::getFee();

/** @var \Dinhdjj\CardChargingV2\Models\Card[] */
$card = CardChargingV2::charging('VIETTEL', 10000, '1000372684732', '3729473289432', '1');
$card = CardChargingV2::check('VIETTEL', 10000, '1000372684732', '3729473289432', '1');

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.

About

Package for interacting with api from `card charging v2` (thesieure.com, doithengay.com,...)

License:MIT License


Languages

Language:PHP 100.0%