nekoding / tripay
Tripay PHP Client for Laravel
Installs: 1 225
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ^7.4|^8.0|^8.1|^8.2
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^10.18|^11.0
Requires (Dev)
- orchestra/testbench: ^8
- phpunit/phpunit: ^9.0
README
Package ini digunakan untuk berinteraksi dengan API milik Tripay.
Installation
You can install the package via composer:
composer require nekoding/tripay
Usage
use Nekoding\Tripay\Networks\HttpClient; use Nekoding\Tripay\Tripay; use Nekoding\Tripay\Signature; $data = [ 'method' => 'BRIVA', 'merchant_ref' => 'KODE INVOICE', 'amount' => 50000, 'customer_name' => 'Nama Pelanggan', 'customer_email' => 'emailpelanggan@domain.com', 'customer_phone' => '081234567890', 'order_items' => [ [ 'sku' => 'FB-06', 'name' => 'Nama Produk 1', 'price' => 50000, 'quantity' => 1, 'product_url' => 'https://tokokamu.com/product/nama-produk-1', 'image_url' => 'https://tokokamu.com/product/nama-produk-1.jpg', ] ], 'return_url' => 'https://domainanda.com/redirect', 'expired_time' => (time() + (24 * 60 * 60)), // 24 jam 'signature' => Signature::generate('KODE INVOICE' . 50000) ]; // dengan facade $res = Tripay::createTransaction($data) $res = Tripay::createTransaction($data, Tripay::CLOSE_TRANSACTION); // tanpa facade $tripay = new Tripay(new HttpClient('api_key_anda')); $res = $tripay->createTransaction($data); $res = $tripay->createTransaction($data, Tripay::CLOSE_TRANSACTION);
Method Available
Tripay
Signature
Cek pattern hash dari transaksi yang akan digunakan disini :
CLOSE TRANSACTION
OPEN TRANSACTION
Validasi Parameter
Package ini melakukan validasi data sebelum diteruskan ke API tripay untuk menghindari error pada parameter. berikut adalah list parameter yang perlu diperhatikan ketika membuat payload request.
Close Transaction Create
Referensi : Tripay doc
Close Transaction Detail
Referensi : Tripay doc
Open Transaction Create
Referensi : Tripay doc
Open Transaction Detail
Referensi : Tripay doc
Daftar Transaksi
Referensi : Tripay doc
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.