curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": "1000",
"currency": "JPY",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "29",
"name": "John Doe",
"number": "4000000000001091"
},
"payment_method": {
"type": "scheme",
"store_payment_method": true
},
"merchant_id": "< Merchant ID >",
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"return_url": {
"webhook_url": "< Webhook url >",
"success_url": "http://www.successurl.com/",
"decline_url": "http://www.declineurl.com/"
},
"shipping_address": {
"country": "JP",
"email": "shipping@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"time_zone": "Asia/Kuala_Lumpur"
}
'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment"
payload = {
"amount": "1000",
"currency": "JPY",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "29",
"name": "John Doe",
"number": "4000000000001091"
},
"payment_method": {
"type": "scheme",
"store_payment_method": True
},
"merchant_id": "< Merchant ID >",
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"return_url": {
"webhook_url": "< Webhook url >",
"success_url": "http://www.successurl.com/",
"decline_url": "http://www.declineurl.com/"
},
"shipping_address": {
"country": "JP",
"email": "shipping@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"time_zone": "Asia/Kuala_Lumpur"
}
headers = {
"Authorization": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '1000',
currency: 'JPY',
card: {
cvc: '100',
expiry_month: '12',
expiry_year: '29',
name: 'John Doe',
number: '4000000000001091'
},
payment_method: {type: 'scheme', store_payment_method: true},
merchant_id: '< Merchant ID >',
billing_address: {
country: 'JP',
email: 'billing@testemail.com',
phone_number: '8112345678',
address1: '1-2-3 Shinjuku',
city: 'Shinjuku-ku',
state: 'Tokyo',
postal_code: '1600022'
},
merchant_txn_ref: 'qwe',
customer_ip: '127.0.0.1',
return_url: {
webhook_url: '< Webhook url >',
success_url: 'http://www.successurl.com/',
decline_url: 'http://www.declineurl.com/'
},
shipping_address: {
country: 'JP',
email: 'shipping@testemail.com',
phone_number: '8112345678',
address1: '1-2-3 Shinjuku',
city: 'Shinjuku-ku',
state: 'Tokyo',
postal_code: '1600022'
},
time_zone: 'Asia/Kuala_Lumpur'
})
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '1000',
'currency' => 'JPY',
'card' => [
'cvc' => '100',
'expiry_month' => '12',
'expiry_year' => '29',
'name' => 'John Doe',
'number' => '4000000000001091'
],
'payment_method' => [
'type' => 'scheme',
'store_payment_method' => true
],
'merchant_id' => '< Merchant ID >',
'billing_address' => [
'country' => 'JP',
'email' => 'billing@testemail.com',
'phone_number' => '8112345678',
'address1' => '1-2-3 Shinjuku',
'city' => 'Shinjuku-ku',
'state' => 'Tokyo',
'postal_code' => '1600022'
],
'merchant_txn_ref' => 'qwe',
'customer_ip' => '127.0.0.1',
'return_url' => [
'webhook_url' => '< Webhook url >',
'success_url' => 'http://www.successurl.com/',
'decline_url' => 'http://www.declineurl.com/'
],
'shipping_address' => [
'country' => 'JP',
'email' => 'shipping@testemail.com',
'phone_number' => '8112345678',
'address1' => '1-2-3 Shinjuku',
'city' => 'Shinjuku-ku',
'state' => 'Tokyo',
'postal_code' => '1600022'
],
'time_zone' => 'Asia/Kuala_Lumpur'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment"
payload := strings.NewReader("{\n \"amount\": \"1000\",\n \"currency\": \"JPY\",\n \"card\": {\n \"cvc\": \"100\",\n \"expiry_month\": \"12\",\n \"expiry_year\": \"29\",\n \"name\": \"John Doe\",\n \"number\": \"4000000000001091\"\n },\n \"payment_method\": {\n \"type\": \"scheme\",\n \"store_payment_method\": true\n },\n \"merchant_id\": \"< Merchant ID >\",\n \"billing_address\": {\n \"country\": \"JP\",\n \"email\": \"billing@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\n \"return_url\": {\n \"webhook_url\": \"< Webhook url >\",\n \"success_url\": \"http://www.successurl.com/\",\n \"decline_url\": \"http://www.declineurl.com/\"\n },\n \"shipping_address\": {\n \"country\": \"JP\",\n \"email\": \"shipping@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment")
.header("Authorization", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000\",\n \"currency\": \"JPY\",\n \"card\": {\n \"cvc\": \"100\",\n \"expiry_month\": \"12\",\n \"expiry_year\": \"29\",\n \"name\": \"John Doe\",\n \"number\": \"4000000000001091\"\n },\n \"payment_method\": {\n \"type\": \"scheme\",\n \"store_payment_method\": true\n },\n \"merchant_id\": \"< Merchant ID >\",\n \"billing_address\": {\n \"country\": \"JP\",\n \"email\": \"billing@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\n \"return_url\": {\n \"webhook_url\": \"< Webhook url >\",\n \"success_url\": \"http://www.successurl.com/\",\n \"decline_url\": \"http://www.declineurl.com/\"\n },\n \"shipping_address\": {\n \"country\": \"JP\",\n \"email\": \"shipping@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000\",\n \"currency\": \"JPY\",\n \"card\": {\n \"cvc\": \"100\",\n \"expiry_month\": \"12\",\n \"expiry_year\": \"29\",\n \"name\": \"John Doe\",\n \"number\": \"4000000000001091\"\n },\n \"payment_method\": {\n \"type\": \"scheme\",\n \"store_payment_method\": true\n },\n \"merchant_id\": \"< Merchant ID >\",\n \"billing_address\": {\n \"country\": \"JP\",\n \"email\": \"billing@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\n \"return_url\": {\n \"webhook_url\": \"< Webhook url >\",\n \"success_url\": \"http://www.successurl.com/\",\n \"decline_url\": \"http://www.declineurl.com/\"\n },\n \"shipping_address\": {\n \"country\": \"JP\",\n \"email\": \"shipping@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "アイベック株式会社",
"mid": "< Merchant ID >",
"merchant_txn_ref": "qwe",
"billing_details": {
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
}
},
"device_details": {
"visited_ip": "127.0.0.1",
"merchant_ip": "127.0.0.1",
"customer_ip": "127.0.0.1"
}
},
"payment_details": {
"amount": 1000,
"response_code": 0,
"auth_code": "268004",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "4000000000001091",
"exp_month": "12",
"exp_year": "29"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "fc565b43-26f5-4906-92ae-d849edc3c3a1",
"ref": 74811,
"timestamp": "2024-11-25T08:24:36.000Z",
"merchant_txn_ref": "qwe",
"stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
},
"risk-details": {
"risk_score": null
}
}トークンAPIの生成
カードトークン生成APIは、購入または認証プロセス中に敏感なカード情報をトークン化し、実際のカード詳細を公開せずに安全な取引を可能にします。
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": "1000",
"currency": "JPY",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "29",
"name": "John Doe",
"number": "4000000000001091"
},
"payment_method": {
"type": "scheme",
"store_payment_method": true
},
"merchant_id": "< Merchant ID >",
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"return_url": {
"webhook_url": "< Webhook url >",
"success_url": "http://www.successurl.com/",
"decline_url": "http://www.declineurl.com/"
},
"shipping_address": {
"country": "JP",
"email": "shipping@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"time_zone": "Asia/Kuala_Lumpur"
}
'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment"
payload = {
"amount": "1000",
"currency": "JPY",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "29",
"name": "John Doe",
"number": "4000000000001091"
},
"payment_method": {
"type": "scheme",
"store_payment_method": True
},
"merchant_id": "< Merchant ID >",
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"return_url": {
"webhook_url": "< Webhook url >",
"success_url": "http://www.successurl.com/",
"decline_url": "http://www.declineurl.com/"
},
"shipping_address": {
"country": "JP",
"email": "shipping@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"time_zone": "Asia/Kuala_Lumpur"
}
headers = {
"Authorization": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '1000',
currency: 'JPY',
card: {
cvc: '100',
expiry_month: '12',
expiry_year: '29',
name: 'John Doe',
number: '4000000000001091'
},
payment_method: {type: 'scheme', store_payment_method: true},
merchant_id: '< Merchant ID >',
billing_address: {
country: 'JP',
email: 'billing@testemail.com',
phone_number: '8112345678',
address1: '1-2-3 Shinjuku',
city: 'Shinjuku-ku',
state: 'Tokyo',
postal_code: '1600022'
},
merchant_txn_ref: 'qwe',
customer_ip: '127.0.0.1',
return_url: {
webhook_url: '< Webhook url >',
success_url: 'http://www.successurl.com/',
decline_url: 'http://www.declineurl.com/'
},
shipping_address: {
country: 'JP',
email: 'shipping@testemail.com',
phone_number: '8112345678',
address1: '1-2-3 Shinjuku',
city: 'Shinjuku-ku',
state: 'Tokyo',
postal_code: '1600022'
},
time_zone: 'Asia/Kuala_Lumpur'
})
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => '1000',
'currency' => 'JPY',
'card' => [
'cvc' => '100',
'expiry_month' => '12',
'expiry_year' => '29',
'name' => 'John Doe',
'number' => '4000000000001091'
],
'payment_method' => [
'type' => 'scheme',
'store_payment_method' => true
],
'merchant_id' => '< Merchant ID >',
'billing_address' => [
'country' => 'JP',
'email' => 'billing@testemail.com',
'phone_number' => '8112345678',
'address1' => '1-2-3 Shinjuku',
'city' => 'Shinjuku-ku',
'state' => 'Tokyo',
'postal_code' => '1600022'
],
'merchant_txn_ref' => 'qwe',
'customer_ip' => '127.0.0.1',
'return_url' => [
'webhook_url' => '< Webhook url >',
'success_url' => 'http://www.successurl.com/',
'decline_url' => 'http://www.declineurl.com/'
],
'shipping_address' => [
'country' => 'JP',
'email' => 'shipping@testemail.com',
'phone_number' => '8112345678',
'address1' => '1-2-3 Shinjuku',
'city' => 'Shinjuku-ku',
'state' => 'Tokyo',
'postal_code' => '1600022'
],
'time_zone' => 'Asia/Kuala_Lumpur'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment"
payload := strings.NewReader("{\n \"amount\": \"1000\",\n \"currency\": \"JPY\",\n \"card\": {\n \"cvc\": \"100\",\n \"expiry_month\": \"12\",\n \"expiry_year\": \"29\",\n \"name\": \"John Doe\",\n \"number\": \"4000000000001091\"\n },\n \"payment_method\": {\n \"type\": \"scheme\",\n \"store_payment_method\": true\n },\n \"merchant_id\": \"< Merchant ID >\",\n \"billing_address\": {\n \"country\": \"JP\",\n \"email\": \"billing@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\n \"return_url\": {\n \"webhook_url\": \"< Webhook url >\",\n \"success_url\": \"http://www.successurl.com/\",\n \"decline_url\": \"http://www.declineurl.com/\"\n },\n \"shipping_address\": {\n \"country\": \"JP\",\n \"email\": \"shipping@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment")
.header("Authorization", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000\",\n \"currency\": \"JPY\",\n \"card\": {\n \"cvc\": \"100\",\n \"expiry_month\": \"12\",\n \"expiry_year\": \"29\",\n \"name\": \"John Doe\",\n \"number\": \"4000000000001091\"\n },\n \"payment_method\": {\n \"type\": \"scheme\",\n \"store_payment_method\": true\n },\n \"merchant_id\": \"< Merchant ID >\",\n \"billing_address\": {\n \"country\": \"JP\",\n \"email\": \"billing@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\n \"return_url\": {\n \"webhook_url\": \"< Webhook url >\",\n \"success_url\": \"http://www.successurl.com/\",\n \"decline_url\": \"http://www.declineurl.com/\"\n },\n \"shipping_address\": {\n \"country\": \"JP\",\n \"email\": \"shipping@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000\",\n \"currency\": \"JPY\",\n \"card\": {\n \"cvc\": \"100\",\n \"expiry_month\": \"12\",\n \"expiry_year\": \"29\",\n \"name\": \"John Doe\",\n \"number\": \"4000000000001091\"\n },\n \"payment_method\": {\n \"type\": \"scheme\",\n \"store_payment_method\": true\n },\n \"merchant_id\": \"< Merchant ID >\",\n \"billing_address\": {\n \"country\": \"JP\",\n \"email\": \"billing@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\n \"return_url\": {\n \"webhook_url\": \"< Webhook url >\",\n \"success_url\": \"http://www.successurl.com/\",\n \"decline_url\": \"http://www.declineurl.com/\"\n },\n \"shipping_address\": {\n \"country\": \"JP\",\n \"email\": \"shipping@testemail.com\",\n \"phone_number\": \"8112345678\",\n \"address1\": \"1-2-3 Shinjuku\",\n \"city\": \"Shinjuku-ku\",\n \"state\": \"Tokyo\",\n \"postal_code\": \"1600022\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "アイベック株式会社",
"mid": "< Merchant ID >",
"merchant_txn_ref": "qwe",
"billing_details": {
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
}
},
"device_details": {
"visited_ip": "127.0.0.1",
"merchant_ip": "127.0.0.1",
"customer_ip": "127.0.0.1"
}
},
"payment_details": {
"amount": 1000,
"response_code": 0,
"auth_code": "268004",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "4000000000001091",
"exp_month": "12",
"exp_year": "29"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "fc565b43-26f5-4906-92ae-d849edc3c3a1",
"ref": 74811,
"timestamp": "2024-11-25T08:24:36.000Z",
"merchant_txn_ref": "qwe",
"stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
},
"risk-details": {
"risk_score": null
}
}重要なポイント
- カードをトークン化することで、カード詳細を再入力することなく繰り返し取引を行うことができ、セキュリティとユーザー体験の向上が図れます。
- 生成されたトークンは、購入と認証の両方の取引で使用でき、さまざまな支払いタイプに対応する柔軟性を提供します。
- 重要なパラメータには通常、カード番号、有効期限、CVV、顧客情報が含まれます。
フローダイアグラム
ノート
store_payment_method: 将来の使用のためにカードトークンを保存するには、ペイロードで true に設定する必要があります。
{
"payment_method": {
"type": "scheme",
"store_payment_method": true
}
store_payment_method を true に設定することで、カード詳細を再入力することなく、カードトークンが今後の取引のために保存されます。
{
"transaction_details": {
"id": "<transaction_id>",
"ref": <ref>,
"timestamp": "yyyy-mm-ddThh:mm:ss.000Z",
"merchant_txn_ref": "<string>",
"stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
}
}
stored_payment_method_id は、カード詳細を再入力することなく、今後の取引でカードトークンAPIを使用するために利用できます。
APIパラメータ
承認
認証のためのAPIキー。フォーマット: 'Basic YOUR_API_KEY_HERE'
x-api-key専用のAPIキー。
ボディ
決済取引を処理するためのリクエストペイロード。
取引の金額。
"1000"
処理通貨の略語(例: JPY)。
3"JPY"
カードの詳細を含むJSONオブジェクト。
Show child attributes
Show child attributes
決済方法を含むJSONオブジェクト。
Show child attributes
Show child attributes
加盟店ID(DASMID)。
128"< Merchant ID >"
カード所有者の請求先住所を含むJSONオブジェクト。
Show child attributes
Show child attributes
加盟店取引参照ID。
45"qwe"
カード所有者のIPアドレス。
45"127.0.0.1"
リターンURLを含むJSONオブジェクト。(このフィールドは3DS取引に必須)。
Show child attributes
Show child attributes
カード所有者の配送先住所を含むJSONオブジェクト(オプション)。
Show child attributes
Show child attributes
取引の国のタイムゾーン。
128"Asia/Kuala_Lumpur"
レスポンス
支払いが正常に処理されました。
取引が成功した場合はtrue、失敗した場合はfalse。
true
取引のステータスコード。
201
本番環境の取引の場合はtrue、テスト取引の場合はfalse。
false
取引の種類(例:CAPTURE)。
"CAPTURE"
ゲートウェイからのレスポンスを含むJSONオブジェクト。
Show child attributes
Show child attributes
加盟店の詳細情報を含むJSONオブジェクト。
Show child attributes
Show child attributes
支払いの詳細情報を含むJSONオブジェクト。
Show child attributes
Show child attributes
取引の詳細を含むJSONオブジェクト。
Show child attributes
Show child attributes
リスクの詳細を含むJSONオブジェクト。
Show child attributes
Show child attributes