YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

ipn conflict, form processes money to paypal- HELP Options
freakytechie
#1 Posted : Monday, September 20, 2004 6:12:44 PM
Rank: Starting Member

Groups: Registered

Joined: 2/11/2004
Posts: 3
Location: ,
Hello. I have created several e-commerce apps, with Paypal serving as the secure access portal for transactions. Subsequently, I am using the IPN concept so that I can have data inserted into various tables of my database. So far, I have several types of donations apps and have recently programmed shopping carts. All of the donation applications works fine. There are no issues with the IPN. However, my shopping carts don't work. Payments are being correctly processed, but none of the IPNs work. Could the problem be that I have several IPNs, all in different locations? I am pretty stumped as to why this works for everything else except my shopping carts. Thanks in advance.... ================================ Here's a sample IPN for one of my 3 shopping carts: ================================= <!-- read post from PayPal system and add 'cmd' Board of Governors Posting --> <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> <!-- 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 --> <cfoutput> <cfset #payment_status#=#FORM.payment_status#> <cfset #payment_currency#=#FORM.mc_currency#> <cfset #txn_id#=#FORM.txn_id#> <cfset #receiver_email#=#FORM.receiver_email#> <cfset #regisAmt# = #FORM.mc_gross#> <cfset #program# = #FORM.item_name#> <cfset #fname# = #FORM.first_name#> <cfset #lname# = #FORM.last_name#> <cfset #stno# = #FORM.address_street#> <cfset #city# = #FORM.address_city#> <cfset #state# = #FORM.address_state#> <cfset #zip# = #FORM.address_zip#> <cfset #email# = #FORM.payer_email#> </cfoutput> <cfoutput> variables: #regisAmt#, #program#, #fname#<br> </cfoutput> <!-- check notification validation --> <CFIF #CFHTTP.FileContent# is "VERIFIED"> <br>status is VERIFIED <!-- check that payment_status=Completed --> <cfif #payment_status# eq "Completed"> <br>status is COMPLETED <!-- check that receiver_email is your email address --> <cfif #receiver_email# eq "website@bnaibrith.org"> <br>email is correct <!-- process payment --> <cftry> <cfquery name="InsertCustomer" datasource="#application.dsn#"> INSERT INTO Customers (fname, lname, stno, city, state, zip, country, email, guests, program, IsShopper, DateAdded) VALUES ('#fname#', '#lname#', '#stno1#', '#city#', '#state#', '#zip#', '#country#', '#email#', '#guests#', '#program#', 'y', GETDATE()) </cfquery> <cfquery name="getCustomerID" datasource="#application.dsn#"> SELECT MAX(CustomerID) as LastPost FROM Customers </cfquery> <cfquery name="insertOrder" datasource="#application.dsn#"> INSERT INTO Orders (CustomerID, ProductID, TotalPrice, Comments, Quantity, OrderDate) VALUES ('#getCustomerID.LastPost#', '#ProductID#', '#regisAmt#', '#Comments#', '#Quantity#', GETDATE()) </cfquery> <cfquery name="InsertRegistrant" datasource="#application.dsn#"> INSERT INTO ConventionInfo (CustomerId, guestTotal, guestNames, CustMeals, GuestsMeals, txnId, regisAmt, postingDate) VALUES ('#getCustomerID.LastPost#', '#guestTotal#', '#guestNames#', '#CustMeals#', '#GuestsMeals#', '#txn_id#', '#regisAmt#', GETDATE() ) </cfquery> <cfcatch> <!--- let's log all errors ---> <cffile action="append" file="D:\WEB\bnaibrith\paypal\paypal_log.txt" output="Error order info & after written to DB"> </cfcatch> <cfquery name="logErrors" datasource="#application.dsn#"> INSERT INTO txnsError (customerID, memberID, program, fname, lname, email, errorDate) VALUES (#Form.customerID#, #Form.memberID#, '#Form.program#', '#Form.fname#', '#Form.lname#', '#Form.email#', GETDATE()) </cfquery> </cftry> <!--- <CFELSE> ---> <!--- Send Customer Email thanking them for their purchase ---> <cftry> <cfoutput> <cfmail from="website@bnaibrith.org" to="#email#" subject="BOG Registration"> Thank you for registering for the Board of Governors Conference. Name: #fname# #lname# Amount: #regisAmt# Event: #program# Thank you again! Signature </cfmail> </cfoutput> <!--- Send Bnai Brith an Email alerting that there was a registration ---> <cfoutput> <cfmail from="website@bnaibrith.org" to="website@bnaibrith.org" cc="" subject="New BOG Registration"> #fname# #lname# registered for the BOG on #OrderDate#. ========================================================= Meals for Registrant: #CustMeals# Total Guests: #guestTotal# Names of Guests: #guestNames# Meals for Guests and Quantity: #GuestsMeals# Order Date: #postingDate# Total Registration Amount: #DOLLARFORMAT(FORM.regisAmt)# PayPal Fee: ========================================================= Net Registration: #DOLLARFORMAT(Evaluate("#Form.RegisAmt#-#FORM.Payment_fee#"))# </cfmail> </cfoutput> </cftry> </cfif> </cfif> <!-- errors, log for investigation --> <CFELSEIF #CFHTTP.FileContent# is "INVALID"> <cfquery name="logErrors" datasource="#application.dsn#"> INSERT INTO txnsError (customerID, program, fname, lname, email, errorDate) VALUES (#Form.customerID#, #Form.memberID#, '#Form.program#', '#Form.fname#', '#Form.lname#', '#Form.email#', GETDATE()) </cfquery> </CFIF> ======================================================= This is a sample of what I have on my confirm.cfm page: ======================================================= **Do I need to change: <input type="hidden" name="cmd" value="_ext-enter"> to <input type="hidden" name="cmd" value="_cart">?? <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="item_name" value="Board of Governor's Registration- October 2004"> <input type="hidden" name="cmd" value="_ext-enter"> <input type="hidden" name="redirect_cmd" value="_xclick"> <input type="hidden" name="business" value="website@bnaibrith.org"> <input type="hidden" name="amount" value="#DOLLARFORMAT(regisAmt)#"> <input type="hidden" name="first_name" value="#SESSION.fname#"> <input type="hidden" name="last_name" value="#SESSION.lname#"> <input type="hidden" name="address_street" value="#SESSION.stno#"> <input type="hidden" name="address_city" value="#SESSION.city#"> <input type="hidden" name="address_state" value="#SESSION.state#"> <input type="hidden" name="address_zip" value="#SESSION.zip#"> <input type="hidden" name="payer_email" value="#SESSION.email#"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="tax" value="0"> <input type="hidden" name="return" value="http://216.119.115.20/bog/bogSuccess.cfm"> <input type="hidden" name="notify_url" value="http://216.119.115.20/bog/ipn.cfm"> <input type="submit" value="Confirm"> </form> Laughter cures so much and it is easier than a frown... Go ahead try it...
Sponsor  
 
Users browsing this topic
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.NET
This page was generated in 0.119 seconds.