Skip to content

Instantly share code, notes, and snippets.

@rafeequl
Last active August 29, 2015 14:06
Show Gist options
  • Save rafeequl/2554457b505858e2d757 to your computer and use it in GitHub Desktop.
Save rafeequl/2554457b505858e2d757 to your computer and use it in GitHub Desktop.
vt-web sample get redirection url request for ALL payment method
<?php
require_once(dirname(__FILE__) . '/../../Veritrans.php');
Veritrans_Config::$serverKey = 'change_with_your_server_key';
// Uncomment for production environment
// Veritrans_Config::$isProduction = true;
// Uncomment to enable sanitization
// Veritrans_Config::$isSanitized = true;
// Uncomment to enable 3D-Secure
// Veritrans_Config::$is3ds = true;
$params =
array(
'transaction_details' => array(
'order_id' => rand(),
'gross_amount' => 10000
),
'item_details' => array(
array(
'id' => '123',
'price' => 10000,
'quantity' => 1,
'name' => 'tiket jakarta - bali'
)
),
'customer_details' => array(
'first_name' => "John",
'last_name' => "Doe",
'email' => 'john@mail.com',
'phone' => '01929292'
),
"vtweb" => array(
// coming soon : bca_klikbca, bri_epay
// "enabled_payments" => array("mandiri_clickpay", "bca_klikbca", "bri_epay")
)
);
try {
// Redirect to Veritrans VTWeb page
header('Location: ' . Veritrans_Vtweb::getRedirectionUrl($params));
}
catch (Exception $e) {
echo $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment