Package Data | |
---|---|
Maintainer Username: | xfoxawy |
Maintainer Contact: | xfoxawy@gmail.com (xfoxawy) |
Package Create Date: | 2017-07-06 |
Package Last Update: | 2018-02-18 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:00:46 |
Package Statistics | |
---|---|
Total Downloads: | 588 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 10 |
Total Watchers: | 3 |
Total Forks: | 2 |
Total Open Issues: | 1 |
Providing Simple Integration and expressive interface for 2Checkout Payment Gateway
composer require "xfoxawy/2checkout:dev-master"
$providers
array in config/app.php
file like:TwoCheckout\TwoCheckoutServiceProvider // Laravel 5
TwoCheckout\TwoCheckoutServiceProvider::class // Laravel 5.1 or greater
$aliases
array in config/app.php
file like:'TwoCheckout' => TwoCheckout\Facades\TwoCheckout // Laravel 5
'TwoCheckout' => TwoCheckout\Facades\TwoCheckout::class // Laravel 5.1 or greater
php artisan vendor:publish
config/2checkout.php
class ExampleController
{
public function __construct(\TwoCheckout\TwoCheckout $tco)
{
$this->tco = $tco;
}
public function product()
{
$this->tco->Product()->get($product_id);
}
}
class ExampleController
{
public function product()
{
TwoCheckout::Sale()->list();
}
}
TwoCheckout Provides expressive OOP access interface, each EndPoint / Event is Represented by Class with regular CRUD interface (get/create/update/delete) representing 2Checkout Restful API.
TwoCheckout Admin API is represented By Resources
classes, and TwoCheckout Webhooks Events are represented by Events
classes, for more information please review 2Checkout Documentation.
the following Walkthrough will guide you to each class normal usage.
to receive 2Checkout Webhook Event, in your route method.
listenTo
method verifies and returns Event as Array
.
for more info about the return data for each event please review the Documentation.
public function receive($event_data)
{
$event = TwoCheckout::listenTo($event_data);
}