Omnipay: Veritrans
, (*1)
Veritrans driver for the Omnipay PHP payment processing library, (*2)
Omnipay is a framework agnostic, multi-gateway payment
processing library for PHP 5.3+. This package implements Veritrans support for Omnipay., (*3)
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., (*4)
Installation
Omnipay is installed via Composer. To install, simply run:, (*5)
$ php composer.phar require andylibrian/omnipay-veritrans
Basic Usage
The following gateways are provided by this package:, (*6)
<?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, (*7)
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., (*8)
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., (*9)
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., (*10)