~Under Development. More Docs soon~
- PHP v8.1+
- PHP JSON Extension
- PHP cURL Extension
- Laravel v10+
-
Run composer require command
composer require teikun-86/tripay-laravel
-
Publish Configuration file
php artisan vendor:publish --provider=Teikun86\Tripay\Providers\TripayServiceProvider --tag=tripay-config
-
Add these config to your
.env
fileTRIPAY_MERCHANT_CODE="" TRIPAY_API_KEY="" TRIPAY_PPOB_API_KEY="" TRIPAY_PRIVATE_KEY="" TRIPAY_PPOB_PIN=""
-
Happy Coding~
```php
<?php
...
$client = tripayClient();
```
<b>Parameters<b>
| Parameter | Example | Type | Required | Description |
| -------------- | ---------- | ------- | -------- | ----------------------------------------------------------------------------------- |
| `code` | BRIVA | string | YES | Payment Method Code ([See more](https://tripay.co.id/developer?tab=channels)) |
| `payment_code` | 1234567890 | string | NO | Payment Code, example for VA code |
| `amount` | 10000 | int | NO | Amount to pay |
| `allowHtml` | false | boolean | NO | To allow HTML tag insertions on the instruction. Allow = 1, Disallow = 0, Default 0 |
```php
<?php
... // rest of your codes
$code = "BRIVA"; // Payment method code
$payment_code = "1234567890"; // optional
$amount = 10000; // optional
$allowHtml = false;
$instructions = $client->createPayment()->instruction($code, $payment_code, $amount, $allowHtml);
```
The code above will return:
```
Illuminate\Support\Collection {#6396
all: [
Teikun86\Tripay\Entities\PaymentInstruction {#6384},
Teikun86\Tripay\Entities\PaymentInstruction {#6411},
Teikun86\Tripay\Entities\PaymentInstruction {#6410},
],
}
```
Made with ๐ by teikun-86