Integrating Air-Direct
Step1.Get the Token Id
- 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.
https://air.veritrans.co.jp/vtdirect/v1/veritrans.min.js
| 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
| 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();
$setting->SetServerKey("aaaaaaaa-1111-ffff-bbbb-000000000000");
$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();
clientConfiguration.setServerKey("aaaaaaaa-1111-ffff-bbbb-000000000000");
ChargeRequest input = new ChargeRequest();
Charges api = new Charges(clientConfiguration);
input.setOrderId("TEST0001");
input.setTokenId("3d499de5-b009-47b2-a331-2d9b2a00b288-411111-1111");
input.setGrossAmount(1980);
ChargeResponse response = api.ChargeWithToken(input);
setting = Setting.new setting.server_key = 'aaaaaaaa-1111-ffff-bbbb-000000000000' input = Request::ChargesParameter.new api = Charges.new 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
- Prev:< [Getting Started]
- Next:[Testing Air-Direct] >