For checking out process while redirecting the user https://www.sandbox.paypal.com the paypal does not show more than one type item and only the last (with its quantity) i.e, if user add two types product in his cart and click for checking out process the paypal show only the second type with its quantity but not the first type in billing process. how can i solve the problem?
here is my api code in view file
<form style=" padding:0px;margin:0px;" name="frmOrderAutoSubmit" method="post" >
<input type="hidden" name="upload" value="1">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="sunymegh#gmail.com">
<?php $cdata = $this->cart->contents() ?>
<?php foreach ($cdata as $items) { ?>
<input type="hidden" name="quantity" value="<?php echo $items['qty']; ?>" />
<input type="hidden" name="item_name" value=" <?php echo $items['name']; ?>"/>
<input type="hidden" name="amount" value="<?php echo $items['price']; ?>"/>
<input type="hidden" name="rm" value="2" />
<input TYPE="hidden" name="address_override" value="0">
<?php } ?>
</form>
You only have one name attribute submitted name="quantity" for example. PayPal uses a format of name="quantity_1".
Related
I create a function for admin of my website send money back to users using Paypal. I created a button with Paypal. My problem is: when Admin login Paypal with business account then he send money to personal account, Paypal do not redirect to my website.
Here is my code
<form target="myWindowPayment" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="payPalForm">
<input type="hidden" name="item_number" value="<?php echo $idProject ?>">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="business" value="charly#zondertag.net">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="<?php echo base_url() ?>crowdpp/backingProject/3">
<input type="hidden" name="cancel" value="<?php echo base_url() ?>crowdpp/backingProject/3">
<input name="item_name" type="hidden" id="item_name" value="Pledging for <?php echo $result->title ?> project" size="45">
<input name="amount" type="hidden" id="amount" value="<?php echo $pledgeAmount ?>" size="45">
</form>
In payment integration,we get two results.
1.successful payment
2.unsuccessful payment
put success page name in return url if successful payment.put failure page name in cancelurl if unsuccessful payment.example.
$setExpressCheckoutRequestDetails->ReturnURL = "http://localhost:8080/success.php";
$setExpressCheckoutRequestDetails->CancelURL = "http://localhost:8080/cancel.php";
<input type="hidden" name="return_url" value="<?php echo urlencode(base_url().'crowdpp/backingProject/3'); ?>">
<input type="hidden" name="return" value="<?php echo urlencode(base_url().'crowdpp/backingProject/3'); ?>">
I have no any idea about it. I serched my sites but i can't find solutions.
My requirement is that, my query fetches bank account number from database,
For example, there r one record given by my query then i want to send money to this bank account.
what should i do??? Which api use for me??
My code is given below:
$queryOperator = "SELECT * FROM operatortransaction AS ot LEFT JOIN paymenttransaction AS pt ON
ot.OperatorID != pt.OperatorID WHERE ot.IsPaymentRequest = 1 AND ot.Amount != pt.Amount ";
$arrOperator = $obj->select($queryOperator);
$count = 0;
if(!empty($dataOperator))
{
foreach($arrOperator as $operator)
{
if($arrOperator[$count]['Amount'] >= $arrOperator[$count]['RequestAmount'])
{
$queryDetail = "SELECT * FROM operatorprofile WHERE UserID = '$arrOperator[$count]['OperatorID']' ";
$Data = $obj->select($queryDetail);
// i want to put api code here......//
}
}
}
Thanks.
Hi you can try to use PayPal Xclick
<form action="https://secure.paypal.com/uk/cgi-bin/webscr" method="post" name="paypal" id="paypal">
<!-- Pre Populate the Paypal Checkout Page With Customer Details, -->
<input type="hidden" name="first_name" value="<?php echo Firstname?>">
<input type="hidden" name="last_name" value="<?php echo Lastname?>">
<input type="hidden" name="email" value="<?php echo Email?>">
<input type="hidden" name="address1" value="<?php echo Address?>">
<input type="hidden" name="address2" value="<?php echo Address2?>">
<input type="hidden" name="city" value="<?php echo City?>">
<input type="hidden" name="zip" value="<?php echo Postcode?>">
<input type="hidden" name="day_phone_a" value="">
<input type="hidden" name="day_phone_b" value="<?php echo Mobile?>">
<!-- We dont need to use _ext-enter anymore to prepopulate pages -->
<!-- cmd = _xclick will automatically pre populate pages -->
<!-- More Info: https://www.x.com/docs/DOC-1332 -->
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="paypal#email.com" />
<input type="hidden" name="cbt" value="Return to Your Business Name" />
<input type="hidden" name="currency_code" value="GBP" />
<!-- Allow customer to enter desired quantity -->
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="item_name" value="Name of Item" />
<!-- Custom Value You want to send and process back in the IPN -->
<input type="hidden" name="custom" value="<?php echo session_id().?>" />
<input type="hidden" name="shipping" value="<?php echo $shipping_price; ?>" />
<input type="hidden" name="invoice" value="<?php echo $invoice_id ?>" />
<input type="hidden" name="amount" value="<?php echo $total_order_price; ?>" />
<input type="hidden" name="return" value="http://<?php echo $_SERVER['SERVER_NAME']?>/shop/paypal/thankyou"/>
<input type="hidden" name="cancel_return" value="http://<?php echo $_SERVER['SERVER_NAME']?>/shop/paypal/cancelled" />
<!-- Where to send the paypal IPN to. -->
<input type="hidden" name="notify_url" value="http://<?php echo $_SERVER['SERVER_NAME']?>/shop/paypal/process" />
NOTICE
Do remember to make a very strong VALIDATION!!!
Am going to implement the paypal in the form of user subscription...
Bellow code runs fine...
Transaction also works fine...
But am not getting back the 'custom parameters' which i have send(as shown in following code of form)...
<form name="_xclick" id="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="xxx#xxx.com">
<!-- Specify a Subscribe button. -->
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<!-- Identify the subscription. -->
<input type="hidden" name="item_name" value="<?php echo $description; ?>">
<!-- Set the terms of the regular subscription. -->
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="a3" value="<?php echo $amount; ?>">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="<?php echo $trial_period; ?>">
<!-- Set recurring payments until canceled. -->
<input type="hidden" name="src" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="notify_url" value="<?php echo $return_domain;?>">
<input type="hidden" name="cancel_return" value="<?php echo $cancel_return;?>">
<input type="hidden" name="return" id="return" value="<?php echo $return_domain;?>" />
<input type="hidden" name="custom" value="<?php echo $serialized_cust_par;?>" />
</form>
Where am I going wrong? the company email is correct I tried using the merchant Id but still no joy.....??
<?php $items = unserialize($_SESSION['items']); ?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="business" value="cherished4ever#hotmail.co.uk">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="return" value="http://www.cherished4ever.com/">
<?php
$suffix = 1;
foreach($items as $item):
?>
<input type="hidden" name="item_name_<?php echo $suffix; ?>" value="<?php echo $item['name']; ?>">
<input type="hidden" name="amount_<?php echo $suffix; ?>" value="<?php echo $item['price']; ?>">
<?php
$suffix++;
endforeach;
?>
Ok so i have got it working now however I just need some help with the checkout page showing the option name and not the item_name value set as the hidden output:
<select name="amount" style="width:150px;font:9px;margin-top:4px">
<option value="35.00">10 x 10</option>
<option value="55.00">20 x 20</option>
<option value="75.00">30 x 30</option>
</select><br>
Be sure to remember your session_start(); at the top of each page that uses the $_SESSION variable.
For more information, take a look at: http://www.php.net/session_start
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="invoice" id="" value="<?php echo $pay_data['order_id']; ?>" />
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="mymail#gmail.com">
<input type="hidden" name="item_name" value="suite number">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="<?php echo $pay_data['amount']; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="return" value="<?php echo base_url()."/home/paypal_subscripton"; ?>">
<input type="hidden" name="cancel_return" value="<?php echo base_url(); ?>">
<input type="hidden" name="notify_url" value="<?php echo base_url(); ?>" />
<input type="submit" value="Donate!" />
</form>
i payed successfully with this code. but page is not redirecting to my website? what is the problem with my code?
amount: 1
bn: PP-BuyNowBF
business: mymail#gmail.com
cancel_return: http://localhost/ebin/Spacelance/
cmd: _xclick
currency_code: USD
invoice: 50d04dd5ab186
item_name: suite number
item_number: 1
lc: US
no_note: 1
no_shipping: 1
notify_url: http://mydomain/ebin/Spacelance/
return: http://mydomain/ebin/Spacelance/home/paypal_subscripton
this is post params to paypal(from firebug)
If you're using the button as it looks like you are, Paypal only redirects users who have a Paypal account. This is what their documentation says:
Note: If you have turned on Auto Return and have chosen to turn on PayPal Account Optional for new users, a new user will not be automatically directed back to your website, but will be given the option to return.
So what I did, was create a page where the I would display instructions to click on the "return to website" link after the transaction is done. Though this is a very inefficient way of taking care of it.
source: www.sandbox.paypal.com/?cmd=p/pop/express_return_learn_more