This code should be enough to get you started. You will of course need the 
Cybersource tag installed for this to work. This would typically be part of a 
custom tag called from your application.

Request:

<cfscript>
oICS = CreateObject("COM", "CyberSource.ICS");
//test server
oICS.ServerHost = "#attributes.server#";
oICS.Merchant = "#attributes.merchant#";
oICS.Log = True;
oICS.LogPath = "D:\TEMP\";
oICS.LogSize = 10;
oICS.SetValue("ics_applications", "ics_auth");

oICS.SetValue("bill_address1", "#attributes.billing_address#");
oICS.SetValue("bill_city", "#attributes.billing_city#");
oICS.SetValue("bill_state", "#attributes.billing_state#");
oICS.SetValue("bill_country", "#attributes.billing_country#");
oICS.SetValue("bill_zip", "#attributes.billing_zip#");
oICS.SetValue("currency", "#attributes.currency#");
oICS.SetValue("customer_cc_expmo", "#attributes.customer_cc_expmo#");
oICS.SetValue("customer_cc_expyr", "#attributes.customer_cc_expyr#");
oICS.SetValue("customer_cc_number", "#attributes.customer_cc_number#");
oICS.SetValue("customer_email", "#attributes.customer_email#");
oICS.SetValue("customer_firstname", "#attributes.customer_firstname#");
oICS.SetValue("customer_lastname", "#attributes.customer_lastname#");
oICS.SetValue("customer_phone", "#attributes.customer_phone#");
oICS.SetValue("ignore_avs", "#attributes.ignore_avs#");
oICS.SetValue("merchant_ref_number", "#attributes.order_id#");
oICS.SetValue("offer0", "quantity:1^amount:#attributes.ordertotal#");
oICS.SetValue("ship_to_zip", "#attributes.shipping_zip#");
        
//  Sent the Authorization request to Cybersource
oICS.Send();


<cfoutput>
Rcode: #oICS.GetResponseValue("ics_rcode")#<br/>
Rflag: #oICS.GetResponseValue("ics_rflag")#<br/>
Rmsg: #oICS.GetResponseValue("ics_rmsg")#<br/>

 auth_auth_amount: #oICS.GetResponseValue("auth_auth_amount")#<br/>
 auth_auth_code: #oICS.GetResponseValue("auth_auth_code")#<br/>
 auth_auth_response: #oICS.GetResponseValue("auth_auth_response")#<br/>
 auth_auth_time: #oICS.GetResponseValue("auth_auth_time")#<br/>
 auth_factor_code: #oICS.GetResponseValue("auth_factor_code")#<br/>
 auth_rcode: #oICS.GetResponseValue("auth_rcode")#<br/>
 auth_rflag: #oICS.GetResponseValue("auth_rflag")#<br/>
 auth_rmsg: #oICS.GetResponseValue("auth_rmsg")#<br/>
 auth_auth_amount: #oICS.GetResponseValue("auth_auth_amount")#<br/>
 auth_trans_ref_no: #oICS.GetResponseValue("auth_trans_ref_no")#<br/>

request_id: #oICS.GetResponseValue("request_id")#<br/>
<cfif val(oics.getresponsevalue("ics_rcode")) lte 0>
        Error: #oICS.GetResponseValue("ics_rmsg")#<br/>
</cfif>
</cfoutput>
</cfscript>


--------------------
Mary Jo Sminkey
http://www.cfwebstore.com
CFWebstore, ColdFusion E-commerce

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274683
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to