2017 © Pedro Peláez
 

cakephp-plugin baokim

BaoKim payment gateway plugin for CakePHP 3.x

image

crabstudio/baokim

BaoKim payment gateway plugin for CakePHP 3.x

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

Build Status Latest Stable Version Latest Unstable Version Total Downloads, (*1)

CakePHP 3.x: BaoKim payment gateway plugin

[Donate] Buy me a cup of coffee paypal, (*2)

Installation

You can install this plugin into your CakePHP application using composer., (*3)

The recommended way to install composer packages is:, (*4)

composer require crabstudio/baokim

Or add the following lines to your application's composer.json:, (*5)

"require": {
    "crabstudio/baokim": "^1.0"
}

followed by the command:, (*6)

composer update

Load plugin

Add this line to Your_project\config\bootstrap.php, (*7)

Plugin::load('Crabstudio/BaoKim', ['bootstrap' => true]);

Or from command line:, (*8)

bin/cake plugin load crabstudio/baokim

Configure

Write to your configure:, (*9)

$baokim = [
    'BaoKim' => [
        'merchant_id' => 'your_merchant_id',
        'secure_pass' => 'your_secret',
        'business' => 'your_business_email@example.com'
    ]
];
Cake\Core\Configure::write($baokim);

Usage

Apply in your controller, (*10)

public function checkout() {
    $this->loadComponent('Crabstudio/BaoKim.BaoKim');

    //your checkout logic here
    //$url_success route to checkoutSuccessfull function
    //$url_cancel route to checkoutCancel function

    $redirect_url = $this->BaoKim->createRequestUrl($order_id, $total_amount, $shipping_fee, $tax_fee, $order_description, $url_success, $url_cancel, $url_detail);
    return $this->redirect($redirect_url);
}

public function checkoutSuccessfull() {
    $this->request->allowMethod('get');
    $this->loadComponent('Crabstudio/BaoKim.BaoKim');
    $isValid = $this->BaoKim->verifyResponseUrl($this->request);
    if($isValid) {
        //Valid logic here
    }
    //Invalid logic here
}

public function checkoutCancel() {
    //Cancel logic here
}

The Versions

24/01 2016

dev-master

9999999-dev https://github.com/crabstudio/bao-kim

BaoKim payment gateway plugin for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

The Development Requires

search payment gateway cakephp3 cake3 crabstudio anhtuank7c baokim

24/01 2016

1.0.0

1.0.0.0 https://github.com/crabstudio/bao-kim

BaoKim payment gateway plugin for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

The Development Requires

search payment gateway cakephp3 cake3 crabstudio anhtuank7c baokim

24/01 2016

1.0.1

1.0.1.0 https://github.com/crabstudio/bao-kim

BaoKim payment gateway plugin for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

The Development Requires

search payment gateway cakephp3 cake3 crabstudio anhtuank7c baokim

24/01 2016

1.0.2

1.0.2.0 https://github.com/crabstudio/bao-kim

BaoKim payment gateway plugin for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

The Development Requires

search payment gateway cakephp3 cake3 crabstudio anhtuank7c baokim