For anyone who is interested. This (if memory serves correctly, might have dropped
some things) is a give or take a pretty literal CFML translation of what the ASP
example code did. The steps refer to the steps in the documentation/sample code you
get with the package. This is not how we work but should at least help you get going.
- James
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test CommWeb</title>
</head>
<body>
<cfset strCCNumber = "5123456789012346">
<cfset strCCExpiry = "0504">
<cfset strCCAmount = "110">
<cfset strOrderInfo = "This is a test">
<cfset strMerchantID = "TEST">
<cfset strError = "">
<cf_CreateUUID>
<cfset strMerchantTxnRef = strReturn>
<!--- STEP 1 - CREATE THE PAYMENT CLIENT --->
<cftry>
<cfobject action="CREATE"
type="COM"
class="PaymentClient.com.COMClient"
name="objCommWeb">
<cfcatch type="Any">
<cfset strError = "Object creation failed">
</cfcatch>
</cftry>
<cfif strError eq "">
<!--- We're okay we'll process the transaction then --->
<cfscript>
// STEP 2 - TEST THAT THE CLIENT WAS CONNECTED PROPERLY
// This should return the string "echo:Test" if object has been created
successfully
strResult = objCommWeb.echo("Test");
if (strResult eq "echo:Test")
{
// STEP 3 - GENERATE THE DIGITAL ORDER
// Card Number
objCommWeb.addDigitalOrderField("CardNum", strCCNumber);
// Card Expiry
objCommWeb.addDigitalOrderField("CardExp", "0504");
// Transaction reference for our own records?
objCommWeb.addDigitalOrderField("MerchTxnRef", strMerchantTxnRef);
// MOTO - this is because we are doing the transaction ourselves...
objCommWeb.addDigitalOrderField("TransSource", "MOTOCC");
// STEP 4 - SEND THE DIGITAL ORDER
intPaymentResult = objCommWeb.sendMOTODigitalOrder(strOrderInfo, strMerchantID,
strCCAmount, "en", "");
if (intPaymentResult neq 1) strError =
objCommWeb.getResultField("PaymentClient.Error");
else strResult = objCommWeb.nextResult();
// STEP 5 - CHECK THE RECEIPT FOR A VALID RESULT
if (strError eq "")
{
if (strResult neq 1) strError =
objCommWeb.getResultField("PaymentClient.Error");
else strQSIResponseCode =
objCommWeb.getResultField("DigitalReceipt.QSIResponseCode");
// STEP 6 - GET THE DATA FROM THE RECEIPT
merchantTxnRef = objCommWeb.getResultField("DigitalReceipt.MerchTxnRef");
if (Len(merchantTxnRef) eq 0) merchantTxnRef = "Unknown";
orderInfo = objCommWeb.getResultField("DigitalReceipt.OrderInfo");
if (Len(orderInfo) eq 0) orderInfo = "Unknown";
merchantID = objCommWeb.getResultField("DigitalReceipt.MerchantId");
if (Len(merchantID) eq 0) merchantID = "Unknown";
amount = objCommWeb.getResultField("DigitalReceipt.PurchaseAmountInteger");
if (Len(amount) eq 0) amount = "Unknown";
receiptNo = objCommWeb.getResultField("DigitalReceipt.ReceiptNo");
if (Len(receiptNo) eq 0) receiptNo = "Unknown";
acqResponseCode = objCommWeb.getResultField("DigitalReceipt.AcqResponseCode");
if (Len(acqResponseCode) eq 0) acqResponseCode = "Unknown";
authorizeID = objCommWeb.getResultField("DigitalReceipt.AuthorizeId");
if (Len(authorizeID) eq 0) authorizeID = "Unknown";
batchNo = objCommWeb.getResultField("DigitalReceipt.BatchNo");
if (Len(batchNo) eq 0) batchNo = "Unknown";
transactionNo = objCommWeb.getResultField("DigitalReceipt.TransactionNo");
if (Len(transactionNo) eq 0) transactionNo = "Unknown";
cardType = objCommWeb.getResultField("DigitalReceipt.CardType");
if (Len(cardType) eq 0) cardType = "Unknown";
}
}
</cfscript>
</cfif>
<cfoutput>
strResult #strResult#<br>
strError #strError#<br>
strQSIResponseCode #strQSIResponseCode#<br>
merchantTxnRef #merchantTxnRef#<br>
merchantID #merchantID#<br>
amount #amount#<br>
receiptNo #receiptNo#<br>
acqResponseCode #acqResponseCode#<br>
authorizeID #authorizeID#<br>
batchNo #batchNo#<br>
transactionNo #transactionNo#<br>
cardType #cardType#<br>
</cfoutput>
</body>
</html>
-----Original Message-----
From: Mkear [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 20 April 2004 6:21 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: CommWeb and CF
Commweb told me (and I actually did manage to talk to the GM of the developing company
after i kicked and screamed and made a fuss - one of the things I'm good at) that
they dont have any templates or other support for ColdFusion because "they only
support major technologies and ColdFusion isn't a major technology".
Translation: "we weren't asked to develop for CF, we dont know anything about it,
and we can't see how we'll get paid for it, so you guys are on your own."
But I get the impression that a well-prepared proposal from someone here to Commweb to
prepare CF support documents and templates would meet with favourable response
(translation again: they'll discuss payment!).
I reckon these guys are all .asp people and look down on CF as being 'not a real
technology' (as so many of them do) but if they were presented with an easy way to
add coldfusion to their offering, they'd take it up.
At least, that was my impression when i last went around
this loop a year ago.
Cheers
Mike Kear
AFP Webworks
Windsor, NSW, Australia.
--------- Original Message --------
From: "CFAussie Mailing List" <[EMAIL PROTECTED]>
To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
Subject: [cfaussie] RE: CommWeb and CF
Date: 20/04/04 11:40
No they still don't (I converted the ASP/COM+ code to CFSCRIPT) Noone there really
wanted to talk about the CF thing ...
My Theory:
... the bank doesn't develop the software themselves so I think it's hard to actually
talk to the developing company... meaning they won't develop CFML examples for it
because noone's telling THEM they want it :-)
- James
________________________________________________
Message sent using UebiMiau 2.7.2
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send
a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney,
Australia http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004