zerosdev / nobubank-php
Nobu Bank API Integration Library for PHP
v1.2.2
2023-07-10 01:19 UTC
Requires
- php: >=7.0.0
- ext-json: *
- guzzlehttp/guzzle: ^6.5|^7.0
README
About
This library give you an easy way to call Nobu Bank API in elegant code style. Example :
NobuBank::qris() ->setTransactionNo('ABCDEFGHIJKLMN') ->setReferenceNo('1234567890') ->setAmount(1000) ->setValidTime(3600) ->setStoreName('Nama Merchant') ->setCityName('Ponorogo') ->createDynamic();
Installation
- Run command
composer require zerosdev/nobubank-php
The following steps only needed if you are using Laravel
- Then
php artisan vendor:publish --provider="ZerosDev\NobuBank\Laravel\ServiceProvider"
- Edit config/nobu_bank.php and put your API credentials
Usage
Laravel
<?php namespace App\Http\Controllers; use NobuBank; class YourController extends Controller { public function index() { $dynamicQris = NobuBank::qris() ->setTransactionNo('ABCDEFGHIJKLMN') ->setReferenceNo('1234567890') ->setAmount(1000) ->setValidTime(3600) ->setStoreName('Nama Merchant') ->setCityName('Ponorogo') ->createDynamic(); dd($dynamicQris); } }
Non-Laravel
<?php require 'path/to/your/vendor/autoload.php'; use ZerosDev\NobuBank\Client as NobuClient; $mode = 'development'; $config = [ 'login' => '', 'password' => '', 'merchant_id' => '', 'store_id' => '', 'pos_id' => '', 'secret_key' => '', ]; $nobu = new NobuClient($mode, $config); $dynamicQris = $nobu->qris() ->setTransactionNo('ABCDEFGHIJKLMN') ->setReferenceNo('1234567890') ->setAmount(1000) ->setValidTime(3600) ->setStoreName('Nama Merchant') ->setCityName('Ponorogo') ->createDynamic(); print_r($dynamicQris);