Connecting Tech Pros Worldwide Help | Site Map

Pay Pal Functionality

Newbie
 
Join Date: Jul 2006
Posts: 9
#1: Aug 3 '06
Hi All,
i want to add a Pay feature with PayPal Function pls Help me in that i m doing this work for the first time having no idea at all.

A typical Paypal integration would also involve redirecting to the site's Thank you page after the payment is successfully made. Till then the data is kept in a temporary table and the moved to live table or a status flag is updated. An email is triggered.

This fuctionalilty is required Pls help me

geetu
rameshsambu's Avatar
Newbie
 
Join Date: Oct 2006
Posts: 15
#2: Oct 17 '06

re: Pay Pal Functionality


hi geetu,

first you need a paypal account. if you have one they you will have the
email which you used to register as the business email. eg. "abcd@efgh.com"

use the following script to send data to paypal

Expand|Select|Wrap|Line Numbers
  1. <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
  2.   <input type="hidden" name="cmd" value="_xclick" /> <!--- required, dont change --->
  3.   <input type="hidden" name="business" value="abcd@efgh.com" /> <!--- the email registered with paypal --->
  4.   <input type="hidden" name="item_name" value="#unique_transaction_identifier#" /><!--- the unique transaction identifier --->
  5.   <input type="hidden" name="currency_code" value="USD" /> <!--- the currency --->
  6.   <input type="hidden" name="amount" value="#amount_in_transaction#" /><!--- the final amount for paypal --->
  7.    <input type="hidden" name="return" value="http://www.yoursite.com/success.cfm" /> <!--- page having code to take care of success condition --->
  8.   <input type="hidden" name="cancel_return" value="http://www.yoursite.com/failure.cfm" /> <!--- page having code to take care of failure condition --->
  9.     <input type="image" name="submit" src="paypal_buynow.jpg" border="0" alt="Make payments with PayPal, it's fast, free, and secure!">
  10. <!--- any good paypal image would be fine --->
  11. </form>
that is all you need to send transaction data to paypal. you have to track every transaction
through the unique transaction identifier

good luck
Newbie
 
Join Date: Oct 2006
Posts: 2
#3: Jan 26 '07

re: Pay Pal Functionality


In what cases I use this 2 options??
<input type="hidden" name="return" value="http://www.yoursite.com/success.cfm" /> <!--- page having code to take care of success condition --->
after the user pays?? like "congratulations your order succed or something???

if the customer decide to cancel the order?? I do not understand because we are using a valid email or not????
<input type="hidden" name="cancel_return" value="http://www.yoursite.com/failure.cfm" /> <!--- page having code to take care of failure condition --->
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Jan 27 '07

re: Pay Pal Functionality


Quote:

Originally Posted by Kgirl

In what cases I use this 2 options??
<input type="hidden" name="return" value="http://www.yoursite.com/success.cfm" /> <!--- page having code to take care of success condition --->
after the user pays?? like "congratulations your order succed or something???

if the customer decide to cancel the order?? I do not understand because we are using a valid email or not????
<input type="hidden" name="cancel_return" value="http://www.yoursite.com/failure.cfm" /> <!--- page having code to take care of failure condition --->

The code was suggested by someone else, but I'll try explaining it.

I'm not sure exactly what fields Paypal requires in a post request, but yes, the return field is for dealing with a successful transaction, whereas the cancel_return deals with a failed transaction (e.g. user cancels, or details not accepted, etc.).

The code is just an example, you should of course real values including a valid business email.

One other thing is that I personally don't approve of this method because of security reasons. I suggest you use a HTTP POST request using cfhttp.
Newbie
 
Join Date: Nov 2007
Posts: 1
#5: Nov 19 '07

re: Pay Pal Functionality


Can I use the code above within Payflow Pro?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Nov 19 '07

re: Pay Pal Functionality


Depends on what fields are required.

Can you describe what information is needed for Payflow Pro?
Reply


Similar ColdFusion bytes