andylibrian/omnipay-veritrans

Veritrans driver for the Omnipay PHP payment processing library

v1.0.0 2015-02-18 13:12 UTC

This package is not auto-updated.

Last update: 2024-12-21 18:58:59 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

Veritrans driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Veritrans support for Omnipay.

This is a third party package maintained by the author and community. If you want to use Veritrans Payment API without Omnipay, we suggest you check out The official PHP wrapper for Veritrans Payment API.

Installation

Omnipay is installed via Composer. To install, simply run:

$ php composer.phar require andylibrian/omnipay-veritrans

Basic Usage

The following gateways are provided by this package:

  • VT-Web
<?php

require_once __DIR__ . '/vendor/autoload.php';

use Omnipay\Omnipay;
use Omnipay\Common\CreditCard;

$gateway = Omnipay::create('Veritrans_VTWeb');
$gateway->setServerKey('server-key-replace-with-yours');
$gateway->setEnvironment('sandbox'); // [production|sandbox] default to production

$data = array(
    'transactionId' => '123456',
    'amount'        => '145000.00',
    'card'          => new CreditCard(),
    'vtwebConfiguration' => array(
        'credit_card_3d_secure' => true,
    ),  
    'currency'      => 'IDR',
);

$response = $gateway->purchase($data)->send();

if ($response->isSuccessful()) {
    // payment success, update database
    // using VT-Web, you will always get redirected to offsite (veritrans page)
    // so here won't be reached.
} elseif ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect();
} else {
    echo $response->getMessage();
}

For general usage instructions, please see the main Omnipay repository. And for more information about Veritrans features, please see Veritrans Documentation

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.