/transactions/checkcard
1 min
code examples curl request post \\ \ url https //api sandbox judopay com/transactions/checkcard \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'api version 6 23' \\ \ data '{ "cardnumber" 1234567890123456, "expirydate" "01/28", "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "phonecountrycode" "44", "threedsecure" { "methodnotificationurl" "https //api judopay com/order/3ds/methodnotification", "challengenotificationurl" "https //api judopay com/order/3ds/challengenotification" }, "threedsecurempi" { "dstransid" "41aadf4c e73f 4bd1 a0c4 acb2615a32af", "cavv" "ajkbcwuyzwaaaabugmktdaaaaaa=", "eci" "02", "threedsecureversion" "2 2 0" }, "cardaddress" { "postcode" "ab1 2cd" }, "primaryaccountdetails" { "name" "doe", "accountnumber" "12345678", "dateofbirth" "1980 01 31", "postcode" "ab1 2cd" } }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("api version", "6 23"); var raw = json stringify({ "cardnumber" 1234567890123456, "expirydate" "01/28", "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "phonecountrycode" "44", "threedsecure" { "methodnotificationurl" "https //api judopay com/order/3ds/methodnotification", "challengenotificationurl" "https //api judopay com/order/3ds/challengenotification" }, "threedsecurempi" { "dstransid" "41aadf4c e73f 4bd1 a0c4 acb2615a32af", "cavv" "ajkbcwuyzwaaaabugmktdaaaaaa=", "eci" "02", "threedsecureversion" "2 2 0" }, "cardaddress" { "postcode" "ab1 2cd" }, "primaryaccountdetails" { "name" "doe", "accountnumber" "12345678", "dateofbirth" "1980 01 31", "postcode" "ab1 2cd" } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api sandbox judopay com/transactions/checkcard", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //api sandbox judopay com/transactions/checkcard") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["api version"] = "6 23" request body = json dump({ "cardnumber" 1234567890123456, "expirydate" "01/28", "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "phonecountrycode" "44", "threedsecure" { "methodnotificationurl" "https //api judopay com/order/3ds/methodnotification", "challengenotificationurl" "https //api judopay com/order/3ds/challengenotification" }, "threedsecurempi" { "dstransid" "41aadf4c e73f 4bd1 a0c4 acb2615a32af", "cavv" "ajkbcwuyzwaaaabugmktdaaaaaa=", "eci" "02", "threedsecureversion" "2 2 0" }, "cardaddress" { "postcode" "ab1 2cd" }, "primaryaccountdetails" { "name" "doe", "accountnumber" "12345678", "dateofbirth" "1980 01 31", "postcode" "ab1 2cd" } }) response = https request(request) puts response read body import requests import json url = "https //api sandbox judopay com/transactions/checkcard" payload = json dumps({ "cardnumber" 1234567890123456, "expirydate" "01/28", "yourconsumerreference" "2b45fd3f cee5 4e7e 874f 28051db65408", "phonecountrycode" "44", "threedsecure" { "methodnotificationurl" "https //api judopay com/order/3ds/methodnotification", "challengenotificationurl" "https //api judopay com/order/3ds/challengenotification" }, "threedsecurempi" { "dstransid" "41aadf4c e73f 4bd1 a0c4 acb2615a32af", "cavv" "ajkbcwuyzwaaaabugmktdaaaaaa=", "eci" "02", "threedsecureversion" "2 2 0" }, "cardaddress" { "postcode" "ab1 2cd" }, "primaryaccountdetails" { "name" "doe", "accountnumber" "12345678", "dateofbirth" "1980 01 31", "postcode" "ab1 2cd" } }) headers = { 'accept' 'application/json', 'content type' 'application/json', 'api version' '6 23' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful response will be one of transaction receipt request for 3ds2 device details request for 3ds2 challenge {}// bad request if any of the required request parameters are not supplied // unauthorized { "requestid" "", "message" "", "code" 0, "category" 0 }// forbidden if token used does not have required permission { "requestid" "", "message" "", "code" 0, "category" 0 }