Integrating Air-Direct

Step1.Get the Token Id

This is the first step of the payment process using Air-Direct. In this step, you will get Token Id by sending credit card information to Air-Direct Tokens API through veritrans.min.js.
  • veritrans.min.js:JavaScript program with the method to send credit card information to Air-Direct.
  • Token Id:is one time token used to identify customer's credit card information.
To use veritrans.min.js, add the script tag with following src in the HTML head

Token To get the token Id, there are very few mandatory parameters that you would need to send:
Parameter Description
client_key Please use client key mentioned here.
card_number Specify the credit 14~16 digits card number without hyphen.
card_exp_year Specify the card expire year with 4 digit numbers.
card_exp_month Specify the card expire month with 2 digit numbers.
card_cvv Specify the security code.

For further details of veritrans.min.js please refer here.

Step2.Request for payment

The next step in the process is to request a credit card payment to Air-Direct with Token Id.
There are very few mandatory parameters that you would need to send for authorization or authorization and capture:
Parameter Description
server_key Please use server key mentioned here.
token_id Specify the Token Id obtained (In step1) from customer's browser to merchant website.
order_id Order Identifier set by the merchant.
gross_amount Total price amount in Japanese Yen.
with_capture Please specify whether it authorization and capture at the same time
test_mode Please specify if you want to perform dummy transaction.

Sample Code

$setting = new \VtDirect\Client\Setting();
$input = new \VtDirect\Client\Request\ChargesParameter();
$input->order_id = "TEST0001";
$input->token_id = "1c0cc4c0-9973-40db-bf81-8caf5349037d-411111-1111";
$input->gross_amount = 1980;
$charges = new \VtDirect\Client\Charges($setting);
$response = $charges->ChargeWithToken($input);
ClientConfiguration clientConfiguration = new ClientConfiguration();
ChargeRequest input = new ChargeRequest();
Charges api = new Charges(clientConfiguration);
ChargeResponse response = api.ChargeWithToken(input);
setting =
setting.server_key = 'aaaaaaaa-1111-ffff-bbbb-000000000000'
input =
api = setting
input.order_id = 'TEST0001'
input.token_id = 'c4a94573-3b03-4289-be1a-bb4d8dbcce04-411111-1111'
input.gross_amount = 1980
response = api.charge_with_token input