PXPOST via SSL Sample Code
ASP/VBScript
The Sample Code will not work without the following:
* Development Account setup with DPS
If you do not have access to a Development account please click here to request it.
<%@ Language=VBScript %>
<%
If Request.Form("Username") <> "" Then
sXmlAction = sXmlAction & "<Txn><PostUsername>" & Request.Form("Username") & "</PostUsername>"
sXmlAction = sXmlAction & "<PostPassword>" & Request.Form("Password") & "</PostPassword>"
sXmlAction = sXmlAction & "<TxnType>" & Request.Form("TxnType") & "</TxnType>"
sXmlAction = sXmlAction & "<CardHolderName>" & Request.Form("CardHolderName") & "</CardHolderName>"
sXmlAction = sXmlAction & "<CardNumber>" & Request.Form("CardNumber") & "</CardNumber>"
sXmlAction = sXmlAction & "<Amount>" & Request.Form("AmountInput") & "</Amount>"
sXmlAction = sXmlAction & "<DateExpiry>" & Request.Form("ExpiryDate") & "</DateExpiry>"
sXmlAction = sXmlAction & "<Cvc2>" & Request.Form("Cvc2") & "</Cvc2>"
sXmlAction = sXmlAction & "<Cvc2Presence>1</Cvc2Presence>"
sXmlAction = sXmlAction & "<MerchantReference>" & Request.Form("MerchantRef") & "</MerchantReference>"
sXmlAction = sXmlAction & "<ReceiptEmail>" & Request.form("Email") & "</ReceiptEmail></Txn>"
Dim objXMLhttp
Set objXMLhttp = server.Createobject("MSXML2.XMLHTTP")
objXMLhttp.Open "POST", "https://sec.paymentexpress.com/pxpost.aspx" ,False
objXMLhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXMLhttp.send sXmlAction
response.write objXMLhttp.responsetext
Set objXMLhttp = nothing
End If
%>
<html>
<head></head>
<body>
<form action="pxpostsample.asp" method="post">
Username<input name="Username" value="Username1"><br>
Password<input name="Password" value="Password1"><br>
TxnType<input name="TxnType" value="Purchase"><br>
CardHolderName<input name="CardHolderName" value="test"><br>
CardNumber<input name="CardNumber" value="4111111111111111"><br>
AmountInput<input name="AmountInput" value="1.00"><br>
ExpiryDate<input name="ExpiryDate" value="0102"><br>
Cvc2<input name="Cvc2" value="123"><br>
MerchantRef<input name="MerchantRef" value="post test"><br>
Email<input name="Email" value="richard@dps.co.nz">
<input type="submit">
</form>
</body>
</html>