Page 1 of 1

PayPal data delivery problem

Posted: Fri Sep 23, 2005 11:17 am
by waqas_punjabian
Hi all,

i have products on a web page that is static , there is a buy button along with product . i m sending item no, and item name in following code to paypal.


Code: Select all

<form name="frm_prod1" action="https://www.paypal.com/cgi-bin/webscr" method="post">

   <input type="hidden" name="cmd" value="_xclick">
   <input type="hidden" name="business" value="waqasnisar@gmail.com">
   <input type="hidden" name="item_name" value="Bio Neo FS (First Stage)">
   <input type="hidden" name="item_number" value="1">
   <input type="hidden" name="amount" value="40">
   <input type="hidden" name="return" value="http://www.bioneo.com/quote_thanks.htm">
   <input type="hidden" name="cancel_return" value="http://www.bioneo.com/quote_cancel.htm">
   <input type="hidden" name="no_note" value="1">
   <input type="hidden" name="currency_code" value="USD">
									
   <input name="Submit" type="submit" class="blue11" value="  Buy Now  ">
                                    	
</form>


when user will click it he will be redirected to paypal account.

up to this level its going perfect.

Now the
Problem:

how can i recieve this item name or item number from paypal after completion of transaction.

because i want to email the sold product name to admin . how can i do that , kindly give me the code or help me.
i don't have any database involved in this project
take care of that

Thanks in Advance,
regards

Waqas

Posted: Fri Sep 23, 2005 11:25 am
by phpdevuk
paypal should pass back item_number as a $_POST varaible I believe

Posted: Fri Sep 23, 2005 4:53 pm
by qads
paypal allows you input a redirect url in a hidden field, which i see you have in the form :) .

Code: Select all

<input type="hidden" name="return" value="http://mysite.com/thanks.php?item_number=bla&other_var=bla">
above is just a sample, you need to adjust it your own needs, after payment, paypal will redirect the user to this page and then you can do whatever you like with the info in _GET.

you will need this hidden field with all the products, make it so when a product is added to the basket, the id gets added to the return url, i.e. "itemn=1&itemn2=2" etc, might wanna use a php page for that.

Plz tell me one more thing,

Posted: Sat Sep 24, 2005 1:50 am
by waqas_punjabian
Thanks,

Plz tell me one more thing,


how can i test my transaction , i 've made a sand box account. But its the account of seller.

is there any test account for buyer or is there any test credit card number to check the transaction.

or i 'll have to pay for testing ?


waiting 4 ur reply,

Waqas

Posted: Sat Sep 24, 2005 9:44 am
by qads
you have to make an account for buyer in the sandbox too, login your sandbox and have a look, there is a button.link for making accounts i think, when you have both accounts:

1. on your payment page it self, use:

Code: Select all

<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
2. login into the sandbox in IE, it doest really work in FF atm

3. while you are logged in SB, you can test your own site, if you dont login to sandbox first, you will get an error.

4. after payment testing etc, check the emails in sandbox to make sure its working.

5. when you are sure everythig is ok. change your form to:

Code: Select all

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

------------------
testing is free with paypal, use this credit card (its not reall =P but it works)

Type: Visa
number: 4111 1111 1111 1111

and any valid from and expiry date.

good luck.