Paypal Automation !!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rahul.pache
Forum Newbie
Posts: 9
Joined: Thu Apr 10, 2008 4:07 am

Paypal Automation !!!!

Post by rahul.pache »

Hello Everybody!!!

I want to automate some paypal process.
I am writing code in PHP. BUT dont know anything about Paypal. And I cant understand their Documentation... Its all Greek Language for me.

What I know till now is adding pay now button. And adding add to cart button. But I am trying this. I have made a manual cart of my own....

What i want to do is simple >>>
I have a list of products in array. And on click of "checkout" I want to redirect visitor to PAYPAL Cart or Paying Page... along with the products and ovoiusly their prices.

Please someone suggest me the procedure... I will be very very thankfulll,,,
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Paypal Automation !!!!

Post by s.dot »

Sounds like you just want to dynamically create a paypal form? (just use PHP to fill in the forms values)
Or are you talking an IPN solution?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
rahul.pache
Forum Newbie
Posts: 9
Joined: Thu Apr 10, 2008 4:07 am

Re: Paypal Automation !!!!

Post by rahul.pache »

What is IPN solution ?
alxsss
Forum Newbie
Posts: 5
Joined: Sat Apr 26, 2008 7:39 pm

Re: Paypal Automation !!!!

Post by alxsss »

In order to redirect to a page with product detailes in addition to the total amount you must use paypal pro. The simple paypal pay now button will only show total amount.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: Paypal Automation !!!!

Post by yacahuma »

paypal already has a cart. You dont want to use theirs?


If you already have a cart. You can use php to loop through your cart and create the cart for paypal

Code: Select all

 
foreach($mycart as $obj)
{
 $paypalCart.= "<input type=\"hidden\" name=\"item_name_{$i}\" value=\"$obj->product_name\">\n"
               ."<input type=\"hidden\" name=\"amount_{$i}\" value=\"{$amount}\">\n"
               ."<input type=\"hidden\" name=\"quantity_{$i}\" value=\"{$obj->basket_quantity}\">\n"
               ."<input type=\"hidden\" name=\"on0_{$i}\" value=\"product_id\">\n"
               ."<input type=\"hidden\" name=\"os0_{$i}\" value=\"{$obj->product_id}\">\n";
}
 
then

Code: Select all

 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   put other paypal html vars here
   <?=$paypalCart?>   
   <input type="submit" value="PayPal">
</form>  
 


I am not sure if thats what you want since I really did not understand the question :mrgreen:
rahul.pache
Forum Newbie
Posts: 9
Joined: Thu Apr 10, 2008 4:07 am

Re: Paypal Automation !!!!

Post by rahul.pache »

yacahuma wrote:paypal already has a cart. You dont want to use theirs?


If you already have a cart. You can use php to loop through your cart and create the cart for paypal

Code: Select all

 
foreach($mycart as $obj)
{
 $paypalCart.= "<input type=\"hidden\" name=\"item_name_{$i}\" value=\"$obj->product_name\">\n"
               ."<input type=\"hidden\" name=\"amount_{$i}\" value=\"{$amount}\">\n"
               ."<input type=\"hidden\" name=\"quantity_{$i}\" value=\"{$obj->basket_quantity}\">\n"
               ."<input type=\"hidden\" name=\"on0_{$i}\" value=\"product_id\">\n"
               ."<input type=\"hidden\" name=\"os0_{$i}\" value=\"{$obj->product_id}\">\n";
}
 


Thanx Dude this code that you have given is exteremely usefull for me....

Thanx a lot. !!!
then

Code: Select all

 
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
   put other paypal html vars here
   <?=$paypalCart?>   
   <input type="submit" value="PayPal">
</form>  
 


I am not sure if thats what you want since I really did not understand the question :mrgreen:
Post Reply