![]() <!-- Copyright (c) 2005 Cabbage Tree Creative Ltd. http://www.cabbagetree.co.nz/ This software is freely re-distributable, as long as the above copyright notice remains intact --> <cfscript> SPL=CreateObject("component", "SecurePayTech"); merchantID="YOUR_VPS_MERCHANT_ID_HERE"; merchantKey="YOUR_PASSKEY_HERE"; orderReference="testorder"; amount=5.00; currency="NZD"; cardType=SPL.getCardTypes().Visa; cardNumber="4987-6543-2109-8769"; cardExpiry="0607"; cardHolderName="Test Cardholder"; </cfscript> <html> <head> <title>SecurePayTech SOAP Demo</title> </head> <body> <h1>SecurePayTech SOAP Demo</h1> <cfscript> result=SPL.purchase(merchantID, merchantKey, orderReference, amount, currency, cardType, cardNumber, cardExpiry, cardHolderName); </cfscript> <cfdump var="#result#"> <cfif result.resultCode eq 1> <p>Transaction successful, attempting refund...</p> <cfscript> result=SPL.refund(merchantID, merchantKey, amount, result.transactionNo); </cfscript> <cfdump var="#result#"> <cfif result.resultCode eq 1> <p>Refund successful.</p> <cfelse> <p><span style="font-weight: bold; color: red;">ERROR!</span> <cfoutput>#result.resultMessage#</cfoutput></p> </cfif> <cfelse> <p><span style="font-weight: bold; color: red;">ERROR!</span> <cfoutput>#result.resultMessage#</cfoutput></p> </cfif> </body> </html> |