Page 1 of 1

Paypal Automation !!!!

Posted: Wed Apr 30, 2008 10:26 pm
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,,,

Re: Paypal Automation !!!!

Posted: Thu May 01, 2008 1:21 am
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?

Re: Paypal Automation !!!!

Posted: Thu May 01, 2008 1:58 am
by rahul.pache
What is IPN solution ?

Re: Paypal Automation !!!!

Posted: Thu May 01, 2008 12:35 pm
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.

Re: Paypal Automation !!!!

Posted: Fri May 02, 2008 3:11 pm
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:

Re: Paypal Automation !!!!

Posted: Sun May 04, 2008 8:22 am
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: