I had posted following data to my paypal function in codeigniter controller
**Array
(
[firstname] => firstname
[email_id] => root@abc.com
[address] => abc phase
[select_country] => 1
[select_state] => 1
[select_city] => 1
[zipcode] => 233234
[address_same] => 0
[shipping_address] =>
[select_country3] => Select
[shipping_state] =>abc
[shipping_city] => abc
[zipcode3] => 123456
[user_id] => 41
[shipping_charge] => 50
[grand_total] => 13569
[quantity] => 1
[payment_mode] => 1
[submit] => submit
)**
i need to redirect my grand total and required data to paypal official link
https://www.paypal.com/cgi-bin/webscr
what all i need to post ..?
please guide for further procedure
Need to HTML form like this :
Example your array is $myArray
<?php
$rand=rand();
?>
<form id="paypal_<?php echo $rand;?>" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="<?php echo $myArray['email_id']; ?>">
<input type="hidden" name="item_name" value="hat">
<input type="hidden" name="item_number" value="123">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="first_name" value="<?php echo $myArray['firstname']; ?>">
<input type="hidden" name="last_name" value="Doe">
<input type="hidden" name="address1" value="9 Elm Street">
<input type="hidden" name="address2" value="Apt 5">
<input type="hidden" name="city" value="Berwyn">
<input type="hidden" name="state" value="PA">
<input type="hidden" name="zip" value="19312">
<input type="hidden" name="email" value="jdoe@zyzzyu.com">
<input type="hidden" name="notify_url" value="your_notify_url" />
<input type="hidden" name="currency_code" value="EUR">
<input type='hidden' name='return' value="your_return_url"/>
<input type="image" name="submit"
src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif"
alt="PayPal - The safer, easier way to pay online">
</form>
Script for auto submit
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#paypal_<?php echo $rand;?>").submit();
});
</script>
For details https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/