Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Shopping cart online validation i.e. how can we configure
Paypal, etc.?



Shopping cart online validation i.e. how can we configure Paypal, etc.?..

Answer / abinash grahacharya ..

first w ehave to create a test marchentaccount in paypal to
use that in test mode

in shopping cart we have to put every items in the cokie, we
can use the session also but good to go with cookie.

in test mode basically we are giving some information and
the price, the currency type and post the form to paypal.

just an example : you have to cretate this form dynamically
and have to post it to the sandbox.paypal for test mode and
if you will go for lkive you have to post the for to paypal
directly
============================================================


<form name="xxx"
action="https://www.sandbox.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo
$MARCHENT_ID;?>">
<input type="hidden" name="item_name" value="<?php echo
$ORDER_REQUEST;?>">
<input type="hidden" name="item_number" value="5">
<input type="hidden" name="<?php echo $item_name;?>"
value="<?php echo $rst['title'];?>">
<input type="hidden" name="<?php echo $amount;?>"
value="<?php echo $rate*$rst['cost'];?>">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="return" value="<?php echo
$RETURN_ADDRESS;?>">
<input type="hidden" name="cpp_header_image" value="<?php
echo $HEADERIMAGE;?>">
<input type="hidden" name="cancel_return" value="<?php echo
$CANCEL_RETURN;?>">

</form>
<script>
document.xxx.submit();
</script>

The difference between the return address and the cancel
address is that you have to specify the path of the cancel
address : where user will be back if he/she will cancel the
transaction and in the return address you have the specify
the path of your page where the user have to return after
the successful transaction

In the test mode the form action is
https://www.sandbox.paypal.com/cgi-bin/webscr
as it is a secure site so the https is there

if you will ghio for live mode
you have to give this address
https://www.paypal.com/cgi-bin/webscr


we are using

<script>
document.xxx.submit();
</script>

to automatically subm,it the form..



thanks
i hope it will help all :)

Is This Answer Correct ?    17 Yes 1 No

Post New Answer

More PHP Interview Questions

What is the function of mysql_real_escape_string in php?

0 Answers  


Why are sessions used?

0 Answers  


What is good average session duration?

0 Answers  


Name some of the popular frameworks in php.

0 Answers  


What is composer used for?

0 Answers  


How can you create a session in php?

0 Answers  


Is php a backend?

0 Answers  


How would you impletement download and upload a file in php

2 Answers   A1 Technology,


Do you know design patterns. List few?

0 Answers  


What is get and post method in php?

0 Answers  


Can we use php variable in javascript?

0 Answers  


What is basename php?

0 Answers  


Categories