Hi all,
I am integrating the HSBC CPI to a site at the moment, and am having some difficulty in getting the value of the CPI hash. I am attempting to use CFHTTP to post form variables to a page to get the variables converted to a hash then returned to my page to submit.
I am using the following code:
<!--- GET ORDER --->
<cfinvoke component="cfc.shoppingCart" method="getSavedOrder" returnvariable="getSavedOrder">
<cfhttp method="get" redirect="yes" url="OrderHash.cfm">
<cfhttpparam type="formfield" name="OrderId" value="#getSavedOrder.orderRef#">
<cfhttpparam type="formfield" name="TimeStamp" value="">
<cfhttpparam type="formfield" name="CpiReturnUrl" value="https://www.mysite.com/results.cfm">
<cfhttpparam type="formfield" name="CpiDirectResultUrl" value="https://www.mysite.com/results.cfm">
<cfhttpparam type="formfield" name="StorefrontId" value="UK12345678GBP">
<cfhttpparam type="formfield" name="OrderDesc" value="Online Shop">
<cfhttpparam type="formfield" name="PurchaseAmount" value="#replace(decimalFormat(getSavedOrder.orderTotal), ".", "", "All")#">
<cfhttpparam type="formfield" name="PurchaseCurrency" value="826">
<cfhttpparam type="formfield" name="TransactionType" value="Auth">
<cfhttpparam type="formfield" name="UserId" value="">
<cfhttpparam type="formfield" name="Mode" value="T">
<cfhttpparam type="formfield" name="MerchantData" value="">
<cfhttpparam type="formfield" name="BillingFirstName" value="#getSavedOrder.uFirstName#">
<cfhttpparam type="formfield" name="BillingLastName" value="#getSavedOrder.uLastName#">
<cfhttpparam type="formfield" name="ShopperEmail" value="">
<cfhttpparam type="formfield" name="BillingAddress1" value="#getSavedOrder.billAddr1#">
<cfhttpparam type="formfield" name="BillingAddress2" value="#getSavedOrder.billAddr2#">
<cfhttpparam type="formfield" name="BillingCity" value="#getSavedOrder.billAddr3#">
<cfhttpparam type="formfield" name="BillingCounty" value="">
<cfhttpparam type="formfield" name="BillingPostal" value="#getSavedOrder.billPoco#">
<cfhttpparam type="formfield" name="BillingCountry" value="826">
<cfhttpparam type="formfield" name="ShippingFirstName" value="#getSavedOrder.delFirstName#">
<cfhttpparam type="formfield" name="ShippingLastName" value="#getSavedOrder.delLastName#">
<cfhttpparam type="formfield" name="ShippingAddress1" value="#getSavedOrder.delAddr1#">
<cfhttpparam type="formfield" name="ShippingAddress2" value="#getSavedOrder.delAddr2#">
<cfhttpparam type="formfield" name="ShippingCity" value="#getSavedOrder.delAddr3#">
<cfhttpparam type="formfield" name="ShippingCounty" value="">
<cfhttpparam type="formfield" name="ShippingPostal" value="#getSavedOrder.delPoco#">
<cfhttpparam type="formfield" name="ShippingCountry" value="826">
</cfhttp>
To post to a page that consumes tyhose fields to create a hash.
How can I return the hash to my page using cfhttp? Is it possible?
TIA,
Paul
I am integrating the HSBC CPI to a site at the moment, and am having some difficulty in getting the value of the CPI hash. I am attempting to use CFHTTP to post form variables to a page to get the variables converted to a hash then returned to my page to submit.
I am using the following code:
<!--- GET ORDER --->
<cfinvoke component="cfc.shoppingCart" method="getSavedOrder" returnvariable="getSavedOrder">
<cfhttp method="get" redirect="yes" url="OrderHash.cfm">
<cfhttpparam type="formfield" name="OrderId" value="#getSavedOrder.orderRef#">
<cfhttpparam type="formfield" name="TimeStamp" value="">
<cfhttpparam type="formfield" name="CpiReturnUrl" value="https://www.mysite.com/results.cfm">
<cfhttpparam type="formfield" name="CpiDirectResultUrl" value="https://www.mysite.com/results.cfm">
<cfhttpparam type="formfield" name="StorefrontId" value="UK12345678GBP">
<cfhttpparam type="formfield" name="OrderDesc" value="Online Shop">
<cfhttpparam type="formfield" name="PurchaseAmount" value="#replace(decimalFormat(getSavedOrder.orderTotal), ".", "", "All")#">
<cfhttpparam type="formfield" name="PurchaseCurrency" value="826">
<cfhttpparam type="formfield" name="TransactionType" value="Auth">
<cfhttpparam type="formfield" name="UserId" value="">
<cfhttpparam type="formfield" name="Mode" value="T">
<cfhttpparam type="formfield" name="MerchantData" value="">
<cfhttpparam type="formfield" name="BillingFirstName" value="#getSavedOrder.uFirstName#">
<cfhttpparam type="formfield" name="BillingLastName" value="#getSavedOrder.uLastName#">
<cfhttpparam type="formfield" name="ShopperEmail" value="">
<cfhttpparam type="formfield" name="BillingAddress1" value="#getSavedOrder.billAddr1#">
<cfhttpparam type="formfield" name="BillingAddress2" value="#getSavedOrder.billAddr2#">
<cfhttpparam type="formfield" name="BillingCity" value="#getSavedOrder.billAddr3#">
<cfhttpparam type="formfield" name="BillingCounty" value="">
<cfhttpparam type="formfield" name="BillingPostal" value="#getSavedOrder.billPoco#">
<cfhttpparam type="formfield" name="BillingCountry" value="826">
<cfhttpparam type="formfield" name="ShippingFirstName" value="#getSavedOrder.delFirstName#">
<cfhttpparam type="formfield" name="ShippingLastName" value="#getSavedOrder.delLastName#">
<cfhttpparam type="formfield" name="ShippingAddress1" value="#getSavedOrder.delAddr1#">
<cfhttpparam type="formfield" name="ShippingAddress2" value="#getSavedOrder.delAddr2#">
<cfhttpparam type="formfield" name="ShippingCity" value="#getSavedOrder.delAddr3#">
<cfhttpparam type="formfield" name="ShippingCounty" value="">
<cfhttpparam type="formfield" name="ShippingPostal" value="#getSavedOrder.delPoco#">
<cfhttpparam type="formfield" name="ShippingCountry" value="826">
</cfhttp>
To post to a page that consumes tyhose fields to create a hash.
How can I return the hash to my page using cfhttp? Is it possible?
TIA,
Paul