|
|
|
Rank: Starting Member
Groups: Registered
Joined: 6/29/2004 Posts: 1 Location: ,
|
I am trying to set up IPN using ColdFusion cut and paste code from PayPal. My first try in SANDBOX used only their basic code and one query. My IPN settings are OK but nothing happend. Can anyone tell me what is wrong?
Button code:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="test_paypal@avarte.net">
<input type="hidden" name="item_name" value="BarCity">
<input type="hidden" name="item_number" value="43">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.avarte.com/city.cfm?id=43">
<input type="hidden" name="cancel_return" value="http://www.avarte.com/city.cfm?id=43">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="a3" value="9.60">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="Y">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>
PayPal ColdFusion Sample code: (with my query in it)
<cfoutput>
<!-- 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>
<!-- post back to PayPal system to validate -->
<CFHTTP URL="https://www.paypal.com/cgi-bin/webscr?#str#" 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 -->
<!--- MY QUERY IS HERE --->
<cfquery datasource="aaaaaa" username="eeeeee" password="dddddd" dbserver="localhost" dbname="cccccc" dbtype="ODBC">
UPDATE bars SET paid=1,WHERE id=#item_number#
</cfquery>
<CFELSEIF #CFHTTP.FileContent# is "INVALID">
<!-- log for investigation -->
<CFELSE>
<!-- error -->
</CFIF>
</cfoutput>
Keith
|
|
|
|
|
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 7/2/2004 Posts: 5 Location: ,
|
I did my first test today and it sort of worked. The CFHTTP.filecontent always showed INVALID but the payment was processed.
1. Try to debug by sending yourself an email with the body = #str#, for the invalid case. 2. Also make sure that your site is accessible from paypal
-Ritesh
|
|
|
|
Guest
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
YAFVision Theme by Jaben Cargman (Tiny Gecko)Powered by YAF |
YAF © 2003-2009, Yet Another Forum.NETThis page was generated in 0.156 seconds.