AlwaysWilling
Programmer
Hi all, this is my first post here, so apologies for any mistakes I make.
I am developing a site using coldfusion and want to use paypal as one of the payment methods. But I need some help in setting up my site with paypal and IPN.
I have my own shopping cart, and have already been able to add products to the basket, but now I want to do the actual checkout process. How do I do that?
I have been to the PayPal site and looked at their sample cf code sample and also looked at the paypal ipn tutorial from easycfm.com but I am still lost.
I am using this sample CF code from PayPal's "IPN Code Samples":
But I am totally lost on what I need to do implement my cart to PayPal.
Any help is appreciated?
Thank you very much.
I am developing a site using coldfusion and want to use paypal as one of the payment methods. But I need some help in setting up my site with paypal and IPN.
I have my own shopping cart, and have already been able to add products to the basket, but now I want to do the actual checkout process. How do I do that?
I have been to the PayPal site and looked at their sample cf code sample and also looked at the paypal ipn tutorial from easycfm.com but I am still lost.
I am using this sample CF code from PayPal's "IPN Code Samples":
Code:
<!-- read post from PayPal system and add 'cmd' -->
<CFSET str="cmd=_notify-validate">
<CFLOOP INDEX="TheField" list="#Form.FieldNames#">
<CFSET str = str & "&#LCase(TheField)#=#URLEncodedFormat(Form[TheField])#">
</CFLOOP>
<CFIF IsDefined("FORM.payment_date")>
<CFSET str = str & "&payment_date=#URLEncodedFormat(Form.payment_date)#">
</CFIF>
<CFIF IsDefined("FORM.subscr_date")>
<CFSET str = str & "&subscr_date=#URLEncodedFormat(Form.subscr_date)#">
</CFIF>
<CFIF IsDefined("FORM.auction_closing_date")>
<CFSET str = str & "&subscr_date=#URLEncodedFormat(Form.auction_closing_date)#">
</CFIF>
<!-- post back to PayPal system to validate -->
<CFHTTP URL="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr?#str#"[/URL] METHOD="GET" RESOLVEURL="false">
</CFHTTP>
<!-- assign posted variables to local variables -->
<CFSET item_name=FORM.item_name>
<CFSET payment_status=FORM.payment_status>
<CFSET payment_amount=FORM.mc_gross>
<CFSET payment_currency=FORM.mc_currency>
<CFSET txn_id=FORM.txn_id>
<CFSET receiver_email=FORM.receiver_email>
<CFSET payer_email=FORM.payer_email>
<CFIF IsDefined("FORM.item_number")>
<CFSET item_number=FORM.item_number>
</CFIF>
<!-- check notification validation -->
<CFIF #CFHTTP.FileContent# is "VERIFIED">
<!-- check that payment_status=Completed -->
<!-- check that txn_id has not been previously processed -->
<!-- check that receiver_email is your Primary PayPal email -->
<!-- check that payment_amount/payment_currency are correct -->
<!-- process payment -->
<CFELSEIF #CFHTTP.FileContent# is "INVALID">
<!-- log for investigation -->
<CFELSE>
<!-- error -->
</CFIF>
But I am totally lost on what I need to do implement my cart to PayPal.
Any help is appreciated?
Thank you very much.