ezha / purwantaraphp

Package Laravel For Integration To Purwantara

Stars
1

PurwantaraPHP

Latest Version on Packagist
Total Downloads
Build Status
StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Documentation

Payment Code
    - CIMB = 6 DIGIT
    - MANDIRI = X DIGIT
    - MUAMALAT = X DIGIT
    - PERMATA = X DIGIT
    - BNI = X DIGIT

Bank
    - CIMB
    - MANDIRI
    - MUAMALAT
    - PERMATA
    - BNI

Installation

Via Composer

$ composer require ezha/purwantaraphp

Publish in config folder

$ php artisan vendor:publish --provider="Ezha\PurwantaraPHP\PurwantaraPHPServiceProvider"

Usage

Open .env file and put

PURWANTARA_TOKEN=YOUR_TOKEN_FROM_PURWANTARA

Get Channel From Purwantara

<?php

use Carbon\Carbon;
use Ezha\PurwantaraPHP\PurwantaraPHP;

class PurwantaraController extends Controller
{
    public function Channel()
    {
        $purwantara    = new PurwantaraPHP();
        
        return $purwantara->getChannel();
    }
}

Create Virtual Account

<?php

use Carbon\Carbon;
use Ezha\PurwantaraPHP\PurwantaraPHP;

class PurwantaraController extends Controller
{
    public function VirtualAccount()
    {
        $params = [
            'amount'        => 10000,
            'name'          => 'Ezha Syafaat',
            'channel'       => 'CIMB', //required, see list bank code in Documentation
            'desc'          => 'Description',
            'expired_at'    => Carbon::now()->addDays(2)->toIso8601String(), //Expired time with format Iso8601
            'unique_id'     => 'TESTING PACKAGE EZHA',
            'payment_code'  => null, //optional, see format payemnt code in Documentation
        ];

        $purwantara    = new PurwantaraPHP();
        
        return $purwantara->getVirtualAccount($params);
    }
}

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.