curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/paymentv2 \
--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": "4000002500003155"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"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"
},
"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"
},
"browser_info": {
"acceptHeader": "text/html",
"screenColorDepth": "48",
"javaEnabled": false,
"language": "en",
"screenHeight": "1200",
"screenWidth": "1600",
"challengeWindow": "4",
"userAgent": "Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)"
},
"time_zone": "Asia/Kuala_Lumpur"
}
'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/paymentv2"
payload = {
"amount": "1000",
"currency": "JPY",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "29",
"name": "John Doe",
"number": "4000002500003155"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"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"
},
"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"
},
"browser_info": {
"acceptHeader": "text/html",
"screenColorDepth": "48",
"javaEnabled": False,
"language": "en",
"screenHeight": "1200",
"screenWidth": "1600",
"challengeWindow": "4",
"userAgent": "Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)"
},
"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: '4000002500003155'
},
merchant_txn_ref: 'qwe',
customer_ip: '127.0.0.1',
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'
},
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'
},
browser_info: {
acceptHeader: 'text/html',
screenColorDepth: '48',
javaEnabled: false,
language: 'en',
screenHeight: '1200',
screenWidth: '1600',
challengeWindow: '4',
userAgent: 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)'
},
time_zone: 'Asia/Kuala_Lumpur'
})
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/paymentv2', 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/paymentv2",
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' => '4000002500003155'
],
'merchant_txn_ref' => 'qwe',
'customer_ip' => '127.0.0.1',
'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'
],
'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'
],
'browser_info' => [
'acceptHeader' => 'text/html',
'screenColorDepth' => '48',
'javaEnabled' => false,
'language' => 'en',
'screenHeight' => '1200',
'screenWidth' => '1600',
'challengeWindow' => '4',
'userAgent' => 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)'
],
'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/paymentv2"
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\": \"4000002500003155\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\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 \"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 \"browser_info\": {\n \"acceptHeader\": \"text/html\",\n \"screenColorDepth\": \"48\",\n \"javaEnabled\": false,\n \"language\": \"en\",\n \"screenHeight\": \"1200\",\n \"screenWidth\": \"1600\",\n \"challengeWindow\": \"4\",\n \"userAgent\": \"Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)\"\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/paymentv2")
.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\": \"4000002500003155\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\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 \"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 \"browser_info\": {\n \"acceptHeader\": \"text/html\",\n \"screenColorDepth\": \"48\",\n \"javaEnabled\": false,\n \"language\": \"en\",\n \"screenHeight\": \"1200\",\n \"screenWidth\": \"1600\",\n \"challengeWindow\": \"4\",\n \"userAgent\": \"Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)\"\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/paymentv2")
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\": \"4000002500003155\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\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 \"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 \"browser_info\": {\n \"acceptHeader\": \"text/html\",\n \"screenColorDepth\": \"48\",\n \"javaEnabled\": false,\n \"language\": \"en\",\n \"screenHeight\": \"1200\",\n \"screenWidth\": \"1600\",\n \"challengeWindow\": \"4\",\n \"userAgent\": \"Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw=",
"statusCode": 200,
"success": true,
"redirect_url": "https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw="
}3Dセキュア統合
トランザクションセキュリティを強化するための3Dセキュア認証統合の包括的ガイド。
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/paymentv2 \
--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": "4000002500003155"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"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"
},
"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"
},
"browser_info": {
"acceptHeader": "text/html",
"screenColorDepth": "48",
"javaEnabled": false,
"language": "en",
"screenHeight": "1200",
"screenWidth": "1600",
"challengeWindow": "4",
"userAgent": "Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)"
},
"time_zone": "Asia/Kuala_Lumpur"
}
'import requests
url = "https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/paymentv2"
payload = {
"amount": "1000",
"currency": "JPY",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "29",
"name": "John Doe",
"number": "4000002500003155"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"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"
},
"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"
},
"browser_info": {
"acceptHeader": "text/html",
"screenColorDepth": "48",
"javaEnabled": False,
"language": "en",
"screenHeight": "1200",
"screenWidth": "1600",
"challengeWindow": "4",
"userAgent": "Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)"
},
"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: '4000002500003155'
},
merchant_txn_ref: 'qwe',
customer_ip: '127.0.0.1',
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'
},
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'
},
browser_info: {
acceptHeader: 'text/html',
screenColorDepth: '48',
javaEnabled: false,
language: 'en',
screenHeight: '1200',
screenWidth: '1600',
challengeWindow: '4',
userAgent: 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)'
},
time_zone: 'Asia/Kuala_Lumpur'
})
};
fetch('https://api-dev.paymentoptions.com/api/v1/server-to-server-interface/paymentv2', 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/paymentv2",
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' => '4000002500003155'
],
'merchant_txn_ref' => 'qwe',
'customer_ip' => '127.0.0.1',
'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'
],
'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'
],
'browser_info' => [
'acceptHeader' => 'text/html',
'screenColorDepth' => '48',
'javaEnabled' => false,
'language' => 'en',
'screenHeight' => '1200',
'screenWidth' => '1600',
'challengeWindow' => '4',
'userAgent' => 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)'
],
'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/paymentv2"
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\": \"4000002500003155\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\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 \"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 \"browser_info\": {\n \"acceptHeader\": \"text/html\",\n \"screenColorDepth\": \"48\",\n \"javaEnabled\": false,\n \"language\": \"en\",\n \"screenHeight\": \"1200\",\n \"screenWidth\": \"1600\",\n \"challengeWindow\": \"4\",\n \"userAgent\": \"Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)\"\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/paymentv2")
.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\": \"4000002500003155\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\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 \"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 \"browser_info\": {\n \"acceptHeader\": \"text/html\",\n \"screenColorDepth\": \"48\",\n \"javaEnabled\": false,\n \"language\": \"en\",\n \"screenHeight\": \"1200\",\n \"screenWidth\": \"1600\",\n \"challengeWindow\": \"4\",\n \"userAgent\": \"Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)\"\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/paymentv2")
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\": \"4000002500003155\"\n },\n \"merchant_txn_ref\": \"qwe\",\n \"customer_ip\": \"127.0.0.1\",\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 \"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 \"browser_info\": {\n \"acceptHeader\": \"text/html\",\n \"screenColorDepth\": \"48\",\n \"javaEnabled\": false,\n \"language\": \"en\",\n \"screenHeight\": \"1200\",\n \"screenWidth\": \"1600\",\n \"challengeWindow\": \"4\",\n \"userAgent\": \"Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)\"\n },\n \"time_zone\": \"Asia/Kuala_Lumpur\"\n}"
response = http.request(request)
puts response.read_body{
"url": "https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw=",
"statusCode": 200,
"success": true,
"redirect_url": "https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw="
}統合手順
ステップ1: 3Dリクエストを送信
3Dセキュア認証を開始するには、サーバーからサーバーへのリクエストを3Dセキュアエンドポイントに送信します。ステップ2: リダイレクトURLを使用
レスポンスからredirect_url を使用して、ブラウザで3Dセキュアページを開きます。
ステップ3: 3Dセキュア認証完了後
カード保有者が認証を完了した後、発行者はリクエストを承認または拒否します。結果に基づいて、顧客は提供されたsuccess_url または decline_url にリダイレクトされます。
success_url
decline_url
ステップ4: Webhook通知
リダイレクトレスポンスに加えて、ゲートウェイは取引のステータスを確認するために指定したwebhook_url にWebhook通知を送信します。これにより、顧客が3DSプロセス後にウェブサイトに戻らなくても、取引結果が確実に伝達されます。
Webhookサンプルレスポンス
{
"success": true,
"status_code": 200,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "<merchant name>",
"mid": "DASMID",
"merchant_txn_ref": "<merchant_txn_ref>"
},
"payment_details": {
"amount": <amount>,
"response_code": 0,
"auth_code": null,
"currency": "<currency>",
"payment_method": "",
"scheme": "VISA",
"card": {
"name": "<cardholder’s name>",
"number": "<card number>",
"exp_month": "MM",
"exp_year": "YY"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "<transaction ref Id>",
"ref": <ref>,
"timestamp": "YYYY-MM-DDTHH:MM:SS.000Z",
"merchant_txn_ref": "<merchant_txn_ref>"
},
"risk-details": {}
}
ステップ5: 3Dセキュア取引ステータスの取得
リクエスト属性
curl --location '<base_URL>/api/v1/server-to-server-interface/transaction/status/<Transaction Ref ID>' \
--header 'Authorization: Basic <API Key>' \
--header 'x-api-key: <x-api-key>' \
--header 'Content-Type: application/json'
レスポンス属性
{
"success": true,
"status_code": 200,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "<merchant name>",
"mid": "<DASMID>",
"merchant_txn_ref": "<merchant_txn_ref>"
},
"payment_details": {
"amount": <amount>,
"response_code": 0,
"responseDescription": "The transaction was completed successfully.",
"auth_code": null,
"currency": "<currency>",
"payment_method": null,
"scheme": "<scheme>",
"card": {
"name": "<cardholder name>",
"number": "<card_number>",
"exp_month": "MM",
"exp_year": "YY"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "<Transaction Ref Id>",
"ref": <ref>,
"timestamp": "YYYY-MM-DDTHH:MM:SS.000Z",
"billing_details": {
"billing_address": {
"country": "<country code>",
"email": "<email>",
"address1": "<address1>",
"phone_number": "<phone_number>",
"city": "<city>",
"state": "<state>",
"postal_code": "<postal_code>"
},
"shipping_address": {
"country": "<country code>",
"email": "<email>",
"address1": "<address1>",
"phone_number": "<phone_number>",
"city": "<city>",
"state": "<state>",
"postal_code": "<postal_code>"
}
}
},
"risk_details": {
"risk_score": null
}
}
リクエスト属性
承認
認証のためのAPIキー。形式:'Basic YOUR_API_KEY_HERE'
x-api-key専用のAPIキー。
ボディ
3Dセキュア支払いトランザクションを処理するためのリクエストペイロード。
取引の金額。
"1000"
商品の処理通貨の略称(例:JPY)。
3"JPY"
カードの詳細を含むJSONオブジェクト。
Show child attributes
Show child attributes
加盟店の取引参照ID。
45"qwe"
カード所有者のIPアドレス。
45"127.0.0.1"
加盟店ID(DASMID)。
128"< Merchant ID >"
カード所有者の請求先住所を含むJSONオブジェクト。
Show child attributes
Show child attributes
返却URLを含むJSONオブジェクト。(このフィールドは3DS取引で必須です。)
Show child attributes
Show child attributes
カード所有者の配送先住所を含むJSONオブジェクト(オプション)。
Show child attributes
Show child attributes
カード所有者が使用するブラウザの詳細を含むJSONオブジェクト(オプション)。
Show child attributes
Show child attributes
取引の国別タイムゾーン。
128"Asia/Kuala_Lumpur"
レスポンス
3Dセキュア取引が正常に開始されました
3Dセキュア認証ページのURL。
"https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw="
応答ステータスコード。
200
取引が成功したかどうかを示します。
true
3Dセキュア認証のリダイレクトURL。
"https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw="