Simple package to interact GMOPG API for laravel project
You can install the package via composer:
composer require nekoding/gmo-payment-gateway
Publish configuration file with
php artisan vendor:publish --provider="Nekoding\GmoPaymentGateway\GmoPaymentGatewayServiceProvider"
// Usage description here
// via GmoPaymentGateway Class
$gmo = new \Nekoding\GmoPaymentGateway\GmoPaymentGateway();
// if you want interact with GMO Site API use this
$siteApi = $gmo->useSiteApi();
// if you want interact with GMO Shop API use this
$shopApi = $gmo->useShopApi();
// Or you can use facade like this too
\Nekoding\GmoPaymentGateway\GmoPaymentGatewayFacade::useShopApi();
\Nekoding\GmoPaymentGateway\GmoPaymentGatewayFacade::useSiteApi();
\Nekoding\GmoPaymentGateway\GmoPaymentGatewayFacade::creditCard();
// If you want execution CreditCard EntryTran and CreditCard ExecTran at once
// You can use CreditCard entryTransaction callback like this
use Nekoding\GmoPaymentGateway\Contracts\Shop\CreditCard\Basic;
use \Nekoding\GmoPaymentGateway\GmoPaymentGatewayFacade;
$data = ['OrderID' => uniqid(), 'JobCd' => 'AUTH', 'Amount' => 1000, 'Method' => '', 'Token' => ''];
$response = GmoPaymentGatewayFacade::creditCard()
->entryTransaction($data, function (Basic $gmo) use (&$data) {
return $gmo->execTransaction($data);
});
$response->getResult(); // it will return response from entry transaction and exec transaction process
// example response :
[
"ACS" => "0"
"OrderID" => "xxxx"
"Forward" => "xxx"
"Method" => "1"
"PayTimes" => ""
"Approve" => "xxx"
"TranID" => "xxxx"
"TranDate" => "xxxxx"
"CheckString" => "xxxxx",
"AccessID" => "xxxxx",
"AccessPass" => "xxxx"
]
You can change api credential via .env
or via config/config.php
ENV Key | Description |
---|---|
GMO_API_SANDBOX_MODE | If true package will use sandbox endpoint instead production endpoint |
GMO_SITE_ID | Credential to connect GMO Site API |
GMO_SITE_PASS | Credential to connect GMO Site API |
GMO_SHOP_ID | Credential to connect GMO Shop API |
GMO_SHOP_PASS | Credential to connect GMO Shop API |
GMO_3DS_VERSION | 3DS API Version for credit card (only support value 1 / 2) |
GMO_API_TIMEOUT | Determine API Timeout (default: 2s) |
- SiteAPI
- ShopAPI - Credit card payment
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email enggartivandi@outlook.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.