I am using an html form to create a buy now button on a webpage. I would like the buy now button to lead to a paypal page which the user can enter their information. If the information is validated, the user should be able to download the file they requested to buy. The button is working and the price is being set correctly but I am not sure how to upload the file to paypal so it can be downloaded directly once the payment is processed.
Here is the code for the current html form i am using:
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" class="paypal">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="$bandEmail">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="item_name" value="$song1Name">
<input type="hidden" name="amount" value="$song1Price">
<input type="image" src="http://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
Related
I have a Paypal form that stopped working, seemingly of its own accord, with no changes made to the site or to the products on sale. We've tried PayPal support but they were of zero help, so I'm hoping somebody here will know what's going on.
This is the form:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="image_url" value="http://www.example.com/images/logo.jpg">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="invoice" value="coins_RqQC0rdyH87RlYt7bkZI3GXS">
<input type="hidden" name="business" value="paypalaccountemail#example.com">
<input type="hidden" name="return" value="http://www.example.com/en/thankyou.php?order_code=seriea_RqQC0rdyH87RlYt7bkZI3GXS">
<input type="hidden" name="cancel_return" value="http://www.example.com/en/choose-account-type">
<input type="hidden" name="currency_code" value="US">
<input type="hidden" name="item_name_1" value="50 coins">
<input type="hidden" name="amount_1" value="16.99">
<input type="image" src="/images/paypal-button3.png" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
As I said, the code or products haven't changed, so I'm stuck. If you're wondering why "item_name_1" etc, it's because we have a shopping cart which allows multiple things to be purchased in the same checkout process. I have some ideas which I've been unable to verify:
1) PayPal changed things on their end without letting us know, making the code obsolete?
2) Hosting company changed the server's IP, new SSL certificate - perhaps additional action needed in our PayPal account for this reason?
3) I'm missing something obvious and will feel stupid following the first comment on this question.
I am trying to integrate PayPal to my website. My requirement is that I want to pass a computer generated amount to PayPal to make payment of that amount.
But when I make payment using button , I am taken to website for payment, Where I login using sandbox account and make payment. But when I make payment I get a message saying
We’re sorry Things don’t appear to be working at the moment.
I searched about the possible problem's from similar questions asked and implemented the suggested fix's which is Hosting a button in a server and providing different parameters , But no luck. Here's the code I am using
<form
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="**********#gmail.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Product1">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="rm" value="2" />
<!--in custom field add user id-->
<input type="hidden" name="custom" value="102">
<!-- Specify URLs -->
<input type='hidden' name='cancel_return' value='http://www.shreyash.tech'>
<input type='hidden' name='return' value='http://www.google.co.in'>
<input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>
I have no idea what I am doing wrong here.
It looks the issue with your sandbox account. Would you please create your new sandbox seller and buyer test accounts and try again.
Here is the link for your reference to create PayPal sandbox account.
What I want to do is to store payments via paypal in MySQL database using php. But there are always chances of fail. I mean if customer enters amount and press "pay now" it doesn't mean that customer successfully paid this amount. Customer may simply exit or fail.
This code below is customizable and works like a charm, but there is a problem. The thing is, I can't set callback url with custom variables in following form to get success or fail and store this transaction in my own database.
Any suggestions?
<form name="_xclick" action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me#mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="hidden" name="amount" value="12.99">
<input type="image" src="http://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
I am having a peculiar problem implementing recurring payment for a webapp that I am developing. I could not use a hosted paypal subscription button, because the payment sum would be variable. So, I used a non hosted solution something like this :
<form action="https://www.sandbox.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="business#email.com">
<input type="hidden" name="item_name" value="Some item"/>
<input type="hidden" name="return" value="return_url">
<input type="hidden" name="cancel_return" value="cancel_url">
<input type="hidden" name="notify_url" value="notification_url">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="variable_amount">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="custom" value="planid1,planid2"/>
</form>
Now, I need to check every month using a cron that who has paid, and generate content according to that.
From the discussions all over the internet, it is clear that paypal doesn't send txn_id for the subscription. So, how am I supposed to check if user has paid in the next month or not?
One thing that comes to my mind is an IPN listener, but will that work with a non-hosted button? Totally confused with this. Could someone point me to the right direction?
IPN would be the way to go. With IPN, your system would be notified when the profile is created, when the profile bills the user again, when the profile is canceld, or when it fails to bill. You would also get the transaction id back in the IPN each thim the profile is charged.
I am creating a website where there will be a lot of digital products with variety of product prices. I went to paypal and created a button.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="W6HILXXVHKYZBY">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
They price is predefined when creating the button. And also I want the users to be redirected to a success in my website after the payment is complete. The above code works in live environment but in sandbox it gives error. PLUS it is not what I require.
I want something like this
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="accounts#mydomain.com">
<strong>How much do you want to pay?</strong><br />
$ <input type="text" name="amount" value="30" readonly="readonly">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="AU">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="return" value="http://net.mydomain.com/payment-complete/">
<br /><br />
<input type="submit" value="Pay with PayPal!">
</form>
Everything in this code works, but it wont redirect to my success page automatically.
There are some conditions for it to work correctly. you can read them here on the PayPal Developers website.
Here is the Note from PayPal about Auto Return:
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.
The Return URL will be applied to all of your Auto Return payments unless otherwise specified within the button or link for that Website Payment. You may specify a different Return URL by changing it in your profile settings; otherwise, you may add or edit the HTML (variable: return) associated with a button or link. In this case, the Return URL that is associated with the button or link will override what was specified in the profile settings.
Firstly, your live account credentials are different from sandbox credentials. Check that you are using the right account email.
Secondly, as Prakash-GPz said, you should enable auto return in your sandbox account also in order to be redirected to success page.