GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - zerosdev/tripay-sdk-php: Unofficial TriPay.co.id Integration Kit for PHP

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
examples
examples
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.php-cs-fixer.dist.php
.php-cs-fixer.dist.php
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

tripay-sdk-php

Unofficial TriPay.co.id Integration Kit for PHP

release language license size downloads pulls

Requirements

  • PHP v7.2.5+
  • PHP JSON Extension
  • PHP cURL Extension

Installation

  1. Run command
composer require zerosdev/tripay-sdk-php

Usage

<?php

require 'path/to/your/vendor/autoload.php';

use ZerosDev\TriPay\Client as TriPayClient;
use ZerosDev\TriPay\Support\Constant;
use ZerosDev\TriPay\Support\Helper;
use ZerosDev\TriPay\Transaction;

$merchantCode = 'T12345';
$apiKey = 'd1cfd***********888ed3';
$privateKey = 'd1cfd***********888ed3';
$mode = Constant::MODE_DEVELOPMENT;
$guzzleOptions = []; // Your additional Guzzle options (https://docs.guzzlephp.org/en/stable/request-options.html)

$client = new TriPayClient($merchantCode, $apiKey, $privateKey, $mode, $guzzleOptions);
$transaction = new Transaction($client);

/**
 * `amount` will be calculated automatically from order items
 * so you don't have to enter it
 * In this example, amount will be 40.000
 */
$result = $transaction
    ->addOrderItem('Gula', 10000, 1)
    ->addOrderItem('Kopi', 6000, 5)
    ->create([
        'method' => 'BRIVA',
        'merchant_ref' => 'INV123',
        'customer_name' => 'Nama Pelanggan',
        'customer_email' => '[email protected]',
        'customer_phone' => '081234567890',
        'expired_time' => Helper::makeTimestamp('6 HOUR'), // see Supported Time Units
    ]);

echo $result->getBody()->getContents();

/**
* For debugging purpose
*/
$debugs = $client->debugs();
echo json_encode($debugs, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);

Please check the /examples for the other examples

Supported Time Units

❗ All time units are in a singular noun

  • SECOND
  • MINUTE
  • HOUR
  • DAY

About

Unofficial TriPay.co.id Integration Kit for PHP

Resources

Readme
MIT license
Activity

Stars

15 stars

Watchers

1 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.