PHP code example of yumaeda / veritrans
1. Go to this page and download the library: Download yumaeda/veritrans library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yumaeda / veritrans example snippets
use Yumaeda\Payment\Veritrans\Veritrans;
use Yumaeda\Payment\Veritrans\CreditCard;
$order_id = <Order ID>; // Unique order ID for your veritrans
$client_key = <ClientKey>; // Your veritrans client key
$server_key = <ServerKey>; // Your veritrans server key
$total = <Total in JPY>; // e.g. 9999
$card_number = <CardNumber>; // e.g. '111111111111111'
$cvv = <CVV>; // e.g. '1234'
$expire_month = <Exp Month>; // e.g. 9
$expire_year = <Exp Year>; // e.g. 2022
$veritrans = new Veritrans($client_key, $server_key);
$credit_card = new CreditCard($card_number, $expire_month, $expire_year, $cvv);
$veritrans->setCreditCard($credit_card);
$veritrans->charge($order_id, $total, true);