Classic ASP
Classic ASP
Adyen Verify Payment Result
See more Adyen Examples
Once a payment has completed, this verifies the result from your server with a /payments/result request.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set http = Server.CreateObject("Chilkat.Http")
' Use this online tool to generate the code from sample JSON:
' Generate Code to Create JSON
' The following JSON is sent in the request body.
' {
' "payload": "2he28Ddhwj242he28Ddhwj..."
' }
set json = Server.CreateObject("Chilkat.JsonObject")
success = json.UpdateString("payload","2he28Ddhwj242he28Ddhwj...")
http.SetRequestHeader "X-API-Key","Your_API_key"
set resp = Server.CreateObject("Chilkat.HttpResponse")
success = http.HttpJson("POST","https://checkout-test.adyen.com/v41/payments/result",json,"application/json",resp)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
set sbResponseBody = Server.CreateObject("Chilkat.StringBuilder")
success = resp.GetBodySb(sbResponseBody)
set jResp = Server.CreateObject("Chilkat.JsonObject")
success = jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = 0
respStatusCode = resp.StatusCode
Response.Write "<pre>" & Server.HTMLEncode( "Status Code = " & respStatusCode) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Response Body:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( jResp.Emit()) & "</pre>"
If (respStatusCode >= 400) Then
Response.Write "<pre>" & Server.HTMLEncode( "Response Header:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( resp.Header) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( "Failed.") & "</pre>"
Response.End
End If
' Sample JSON response:
' {
' "pspReference": "851559480052382F",
' "resultCode": "Authorised",
' "merchantReference": "123",
' "paymentMethod": "ideal",
' "shopperLocale": "nl_NL"
' }
' Sample code for parsing the JSON response...
' Use the following online tool to generate parsing code from sample JSON:
' Generate Parsing Code from JSON
pspReference = jResp.StringOf("pspReference")
resultCode = jResp.StringOf("resultCode")
merchantReference = jResp.StringOf("merchantReference")
paymentMethod = jResp.StringOf("paymentMethod")
shopperLocale = jResp.StringOf("shopperLocale")
%>
</body>
</html>