Code Monkey home page Code Monkey logo

tripay-laravel's Introduction

teikun86/tripay-laravel

Unofficial TriPay Payment Gateway & PPOB integration for Laravel.

release languages Packagist Downloads GitHub code size in bytes GitHub License PR Welcome

~Under Development. More Docs soon~

Table Of Contents

Requirements

  • PHP v8.1+
  • PHP JSON Extension
  • PHP cURL Extension
  • Laravel v10+

Instalation

  1. Run composer require command

    composer require teikun-86/tripay-laravel
  2. Publish Configuration file

    php artisan vendor:publish --provider=Teikun86\Tripay\Providers\TripayServiceProvider --tag=tripay-config
  3. Add these config to your .env file

     TRIPAY_MERCHANT_CODE=""
     TRIPAY_API_KEY=""
     TRIPAY_PPOB_API_KEY=""
     TRIPAY_PRIVATE_KEY=""
     TRIPAY_PPOB_PIN=""
    
  4. Happy Coding~

Usage

Basic Usage

1. Creating Tripay Client

```php
<?php
...
$client = tripayClient();
```

Payment Gateway

1. Getting Payment Instruction

<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

tripay-laravel's People

Contributors

teikun-86 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.