<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
Related
I am using this PayPal payment method in my project and I facing one issue in currency.
I have followed this link steps(https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout-outside#methodone) and integrated PayPal, all things working fine but the currency showing wrong on the checkout page but when going to the next page it is showing properly.
I want to change the currency text from USD to EUR on the checkout page. how it is possible.
Can any help with it?
here is code
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="frmTransaction" id="frmTransaction">
<input type="hidden" name="business" value="Email">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="shipping" value="0"/>
<input type="hidden" name="item_number" value="">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="notify_url" value="">
</form>
1, Add EUR currency to your Paypal account using this link
like this screenshot
OR
Go to > Account Settings > BUSINESS PROFILE > Money, banks and cards > Currency management
2, Remove these two elements from your form
<input type="hidden" name="rm" value="2">
<input type="hidden" name="upload" value="1">
your final form code like below
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="frmTransaction" id="frmTransaction">
<input type="hidden" name="business" value="web91.siddharth#gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="shipping" value="1"/>
<input type="hidden" name="item_number" value="">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="notify_url" value="">
<input type="submit" value="Pay Now">
</form>
I am using the PayPal IPN System which works perfectly in sandbox mode. All the payments went through successfully and my site updated as required. So, being ready to go live, I change my sandbox links to live links:
$action = 'https://www.paypal.com/cgi-bin/webscr';
But now, whenever the payment form is posted to this address, it ends up at
https://www.paypal.com/webapps/hermes?token=...
which just shows a blank page. No error_log is created on my server.
Here is my form data before the link to PayPal is clicked.
<form name="frm_payment_method" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="business" value="payments#domain.com">
<input type="hidden" name="notify_url" value="http://domain.com/ipn.php">
<input type="hidden" name="cancel_return" value="http://domain.com/cancelled.php">
<input type="hidden" name="return" value="http://domain.com/success.php">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="lc" value="">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="page_style" value="paypal">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="item_name" value="1 Credit">
<input type="hidden" value="_xclick" name="cmd">
<input type="hidden" name="amount" value="1.50">
<p><button type="submit" name="submit" class="btn btn-primary">Proceed to PayPal</button>
Cancel</p></form>
Of course, replacing domain.com with my own correct domains.
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'); ?>">
It is assumed that using the form, variables are passed by post method to return page, but it is not doing that, and I don't know what I can do about it, since transit through the Paypal website is out of my control.
Any idea?
This is my button. I have the same situation with another one.
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="name#dom.com">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="item_name" value="Algo">
<input type="hidden" name="amount" value="8.00">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="item_number" value="<?php echo $_GET['id'];?>">
<input type="hidden" name="custom" value="<?php echo $_GET['sub'];?>">
<input type="hidden" name="return" value="http://www.web.com/ok.php">
<input type="hidden" name="cancel_return" value="http://www.web.com/ko.php">
<input type="image" src="http://www.paypal.com/img/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal">
</form>
You can pass the variables by setting them as url parameters in the return page. Like this:
<input type="hidden" name="return" value="http://www.web.com/ok.php?id=<?php echo $_GET['id'];?>&custom=<?php echo $_GET['sub'];?>">
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>