purwantaraid/purwantara-php

PHP Wrapper for Purwantara API.

v0.0.1 2023-10-05 15:29 UTC

README

Latest Version on Packagist Tests Total Downloads

PHP Wrapper for Purwantara API.

Installation

You can install the package via composer:

composer require purwantaraid/purwantara-php

Usage

$config = [
    'is_sandbox' => false, 
    'token' => 'XXXXXXXX'
];

Virtual Account

use Purwantara\Purwantara\Collect\VirtualAccount;


$request = new VirtualAccount($config);

// Create transaction
$response = $request->create($data);

// Get all transactions
$response = $request->get();

// Get transaction by UUID
$response = $request->get($uuid);

// Cancel transaction by UUID
$response = $request->cancel($uuid);

QRIS

use Purwantara\Purwantara\Collect\Qris;

$request = new Qris($config);

// Create transaction
$response = $request->create($data);

// Get all transactions
$response = $request->get();

// Get transaction by UUID
$response = $request->get($uuid);

Over the Counter

use Purwantara\Purwantara\Collect\Otc;

$request = new Otc($config);

// Create transaction
$response = $request->create($data);

// Get all transactions
$response = $request->get();

// Get transaction by UUID
$response = $request->get($uuid);

Payment Link

use Purwantara\Purwantara\Collect\PaymentLink;


$request = new PaymentLink($config);

// Create transaction
$response = $request->create($data);

// Get transaction
$response = $request->get($uuid);

Testing

PPN_TOKEN="XXXX" composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.