IPCharge

IPCharge is a form of VeriFone Payment Processing Software, which allows credit cards to be charged through a payment gateway. It is similar to PCCharge, but doesn’t require any proprietary software installed on the computer. The credit card information (name, address, zip, card data and client info) is stored in an XML document then passed to VeriFone’s server. The server then returns an XML file that must be parsed to determine if the transaction was successful or if any other transaction information is needed.

IPCharge includes a variety of methods, including but not limited to Sale, Pre-Auth, Void, Post-Auth, and Credit. Post-Auth validates the card then stores the information on the gateways server to be processed in a settlement when the items ship to the customer. Credit transfers funds to the card. Sale charges the credit card. Void cancels a transaction that has not been charged. Pre-Auth stores the credit card data, validates it, and reserves the amount on the credit card in order for it to be processed at a later time.

When I downloaded the documentation for IPCharge, they had code samples for ASP, Visual Basic 6, and C#. So I had to adapt the method for Coldfusion 6. The code below stores the XML into a variable then posts the data to the IPCharge server.

<cfsavecontent variable=”strXML”><?xml version=”1.0″ encoding=”utf-8″?><TRANSACTION>
<CLIENT_ID>XXXXXXXXXXX</CLIENT_ID>
<USER_ID>#ipchargeuser#</USER_ID>
<USER_PW>#ipchargepass#</USER_PW>
<FUNCTION_TYPE>PAYMENT</FUNCTION_TYPE>
<COMMAND>SALE</COMMAND>
<PAYMENT_TYPE>CREDIT</PAYMENT_TYPE>
<PRESENT_FLAG>1</PRESENT_FLAG>
<ACCT_NUM>#form.card#</ACCT_NUM>
<CUSTOMER_STREET>#form.street#</CUSTOMER_STREET>
<CUSTOMER_ZIP>#form.zip#</CUSTOMER_ZIP>
<EXP_MONTH>#form.expirm#</EXP_MONTH>
<EXP_YEAR>#form.expiry#</EXP_YEAR>
<INVOICE>#ticketnum#</INVOICE>
<TRANS_AMOUNT>#numberFormat(amount,.00)#</TRANS_AMOUNT>
<CARDHOLDER>#FullName#</CARDHOLDER>
<CVV2>#form.CVV2#</CVV2>
<MERCHANTKEY>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</MERCHANTKEY>
</TRANSACTION></cfsavecontent></cfoutput>

<cfhttp url=”https://IPCharge.net/IPCHAPI/rh.aspx” timeout=”1000″ port=”443″ method=”post”>
<cfhttpparam type=”body” name=”transaction” value=”#strXML.trim()#” encoded=”yes”>
<
cfhttpparamtype=”HEADER” name=”Content-Type” value=”text/xml” encoded=”yes”>
</cfhttp>