I am using "buy it now" PayPal buttons but I DO NOT want to use the previously saved buttons on my PayPal account, I want to create a custom form that has a submit button. However, I need to know which fields are the minimum required ones for a form. I thought it would be something like this
<input type="hidden" name="cmd" value="_s-xclick" >
<input type="hidden" name="business" value="me#myemail.com" >
<input type="hidden" name="item_name" value="some item name" >
<input type="hidden" name="item_number" value="some item number" >
<input type="hidden" name="amount" value="10.00" >
But this keeps on kicking back as an unpecified error on PP. Any thoughts?
The following link has a minimal example: https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_techview_outside . The most important parts are making sure the action is correct and the cmd field is correct. (I'm not familiar with _s-xclick as a command – I always use _xclick myself – but my knowledge in the area is admittedly a bit dated.)
For more tips on making the form just right, I recommend poking around on the PayPal Developer network: https://www.x.com/index.jspa
Also, please note: PayPal IPN is a feature that does callback posts from PayPal to you, the merchant, after a purchase is made, and doesn't quite seem to be what you're working with here, which is the button's form posted from the user's browser to PayPal. This form submission in a buy-now button is just considered part of the buy-now button feature.
Related
I'm building a website and want to add "Paypal" payment method
so I add this Html Form to site page
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="business" value="paypalemail#gmail.com">
<input type="hidden" name="item_name" value="My Cart Item 1">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="shopping_url" value="http://localhost:2718/school/paymeant.aspx">
<input type="hidden" name="return" value="http://localhost:2718/school/paymeant.aspx?sucess=1">
<input type="hidden" name="cancel_return" value="http://localhost:2718/school/paymeant.aspx?faile=1">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
all is going ok expect when user want to pay me throw credit or master or visa card
then paypal ask them to create account to pay throw that card how can i remove
create account option in debit or credit card section
The method you are using for adding a PayPal button to your is called Payments Standard. This integration method is quick and easy, but it has some limitations.
What you're after, where users can just pay with a credit card without logging in or creating an account, is called "guest checkout". Unfortunately, with Payments Standard guest checkout relies on browser based cookies. As such, if anybody has ever signed in to a PayPal account with that particular browser the system is going to assume you'll be using PayPal, so it sort of hides away the guest checkout option. You should still see a link that allows you to get there, but it's very easy to miss.
If you were to try that in a fresh browser or clear the cache/cookies in your current browser you would probably see the guest checkout experience.
If you want to force the guest checkout experience at all times regardless of browser cookies you'll need to use the Express Checkout API instead of Payments Standard. This will require the use of a programming language like PHP.
Assuming you are familiar with that, you could use this PHP PayPal SDK to easily integrate Express Checkout. It comes with free samples that would probably be enough to get you going.
Alternatively, if you are using a CMS of some kind there is probably a plugin available that would make Express Checkout integration easy for you. For example, if you're using WooCommerce, by chance, I would recommend taking a look at PayPal for WooCommerce.
A client requested that I set the Subsribe button to have reattempts at failed payments quite specifically. The account used is a Paypal Standard (not paypal pro) and from my research there's only the SRA variable that only toggles the pre-set 3-attempts in 5 days setting by Paypal, which is giving up on a subsriber too easily from my client's perspective. He'd want a total of 30 billing re-attempts, done every 3 days for the next 90 days.
I have only found other people wondering the same thing, but haven't found a solution. My current code on the page is this:
<form id='frmPayPalYearly' action="https://www.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="xxxxxxxx">
<input type="hidden" name="custom" value="Standard Annual Member with id:<?php echo $user_id;?>">
<input type="hidden" name="invoice" value="03/2013/<?php echo $user_id;?>/12/<?php echo uniqid()?>">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_SM.gif" width="0" height="1">
</form>
If I add the SRA like so:
<input type="hidden" name="sra" value="1">
Correct me if I'm wrong, but this will tell Paypal to reattempt 3 times. Any way I can make Paypal reattempt 30 times?
Anyone has any ideas?
Unfortunately, there isn't much you can do.
The API products actually provide parameters to specify this sort of thing, but they're ignored. It's a known issue that I've been hoping to see fixed for years now. I'm not holding my breath. Everything falls to the default of 3 attempts 5 days apart and then suspends.
If you were using the API's then you could at least automate the process of re-activating the plugin when it becomes suspended on that 3rd attempt so that it falls right back into a fresh 3-attempt cycle, and just keep doing that as many times as you want your application to allow.
With Payments Standard, though, there isn't an API that will let you do this. You would need to switch to Express Checkout API's in order to do that, and then you would handle the auto-re-activate within an IPN solution.
I have a Donate button set up for the user to enter the donation amount. I am trying to send an amount with the button. I can enter amount=1.00 in the Add Advanced Variables in the button setup - that works fine. However, I have had no success sending the amount as part of the URL. I have added the following line to the PayPal button form:
<input type="hidden" name="amount" value="9.99" />
but the amount field is blank when I get to PayPal. Any thoughts what I am doing wrong?
If you're creating a so called 'hosted button' (that is, a button where the button details are stored on the PayPal side), then the 'amount' POST parameter is ignored for requests to https://www.paypal.com/cgi-bin/webscr.
This is a security feature to prevent people from being able to manipulate the amount passed to PayPal for checkout.
You can identify whether you're using a hosted button by the following data;
Hosted buttons will have a value for cmd of _s-xclick and include the hosted_button_id parameter.
If this is the case, you cannot update the amount by passing in an extra amount POST parameter.
However, because you're dealing with donations and the amount is flexible by definition, you don't in fact need a 'hosted button'.
In the button creation form, turn off 'Host button with PayPal', or write your own to point to PayPal.
If you do this, you can set the amount via the amount POST parameter.
For example, the below works fine;
<form method="POST" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_donations">
<label for="amount">Amount: </label><input type="text" name="amount" value="">
<input type="submit" name="submit" value="Pay with PayPal">
</form>
Robert's solution is on the right track, however a non-hosted PayPal form will not work without the hidden "business" field (which should have a value of the email address associated with your PayPal account.)
Other fields should be included for thoroughness:
<input type="hidden" name="business" value="myemail#here.com">
<input type="hidden" name="item_name" value="Donation Description">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
I must be going crazy, or I'm completely lost when it comes to understanding what is doable when it comes to PayPal buttons on my site - either way I must apologise if this seems obtuse.
I'm building a custom CMS for my clients, and I'm trying to let them utilize PayPal on their sites by simply entering in either their merchant ID, or their PayPal e-mail address, and then let CMS will do the rest. Ideally:
Client enters merchant ID / PayPal e-mail address into CMS backend
CMS generates "Buy Now" button for client's buyers to click on
Buyer pays on PayPal's site
Buyer gets redirected to client's site
My headache disappears
This seems to be easier said than done. I've read the developer documentation on generating your own buttons, and used that Javascript-based button generator to create a button with an IPN callback, but that's not going to redirect the buyers back to my clients' websites.
Thus my questions: is it at all possible to achieve what I'm looking to do with just my clients' merchant ID's? Is it possible to do it without them having to configure anything additional in their PayPal account settings to avoid set-up issues? Should I be looking at a different PayPal processing mechanism instead of the "Buy Now" button?
I should probably mention that I have a free PayPal account, not a Premium or Business account, but that should be irrelevant to this situation as it's not me that's trying to get paid.
Thanks in advance, and any help is GREATLY appreciated!
create a hidden field named 'return' in your form and put your return URL as the 'value'
A thank you to Billy for his answer, and while researching this topic some more, I've discovered that what I'm looking to do CANNOT be done with the current payment standards buttons on a standard free PayPal account. You can't achieve automatic redirection back to your site from PayPal with the Buy Now button.
As Billy mentioned, you can add return URLs that will give the user the option to click on a link that will return them to your site afterwards (PayPal will add these links to their side of operations themselves). To do this you would need to add the appropriate hidden fields to your PayPal form.
This worked for me:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="button" value="buynow">
<input type="hidden" name="item_name" value="Item 1">
<input type="hidden" name="amount" value="1234.56">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="env" value="www">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="return" value="http://www.site.com/success">
<input type="hidden" name="cancel_return" value="http://www.site.com/error">
<input type="hidden" name="business" value="your#email.com">
</form>
I hope this helps someone avoid headache and unnecessary documentation scouring!
I'm trying to setup a registration form for some workshops that last a week. Basically, they can sign up for the workshops individually or the whole week. Depending on what they select, the price will change. I get how to send this information to paypal, however I also want to submit information to my own DB. How would I submit to paypal and file the info into my DB at the same time?
I also want to have a variable that is returned that verifies they have paid so I can mark it in my DB.
Would I just have another page that would put all this info into the DB (once submitted) then also put the info into hidden form fields and then automatically submit to paypal?
Thanks in advance! :)
"When payment is successful your user is returned to your self which is when you can record the payment in the db."
That's exactly what you shouldn't be doing.
Depending on a buyer to return to your website in order to update an order status is the worst thing you can do.
PayPal IPN was designed with especially this use case in mind.
Simply add in
This will ensure PayPal will POST to you whenever the payment has completed. Even if your buyer has already closed his/her browser.
You can use the 'custom' fields to link an IPN POST to a transaction made on your site. For example:
will ensure you get an IPN POST with $_POST['custom'] of '1122334455'. From there, it's simply a matter of making a db call to update the order status to 'paid', or whatever you use to mark it as payment received.
Oh, and don't forget to post the data back to https://www.paypal.com/cgi-bin/webscr?cmd=_notify-validate to validate the IPN POST. More info is available at https://www.paypal.com/ipn/
So I guess you are probably using Website payment standard.
If so the process is like this:.
Users signs up for a particular workshop using your form (select prices, time etc etc)
On submit you process the form (check validation etc)
If you happy with this then you generate a from that is automatically posted to paypal that looks like this:
<body onLoad="document.forms['paypal_auto_form'].submit();">
<p>Please wait</p>
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" name="paypal_auto_form"/>
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="currency_code" value="AUD" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="business" value="PAYPAL#EMAIL.COM" />
<input type="hidden" name="return" value="http://domain.com/paypal/success" />
<input type="hidden" name="cancel_return" value="http://domain.com/paypal/cancel" />
<input type="hidden" name="notify_url" value="http://domain.com/paypal/ipn" />
<input type="hidden" name="custom" value="1234567890" />
<input type="hidden" name="item_name" value="Paypal Test Transaction" />
<input type="hidden" name="item_number" value="6941" />
<input type="hidden" name="amount" value="197" />
<p><input type="submit" name="pp_submit" value="Pay Now!" /></p></form>
</body>
The values you of course customize to what you want. Look at Appendix A of the paypal documentation for the variables. You can also add your own log with cpp_header_image or something like that.
The users is taken to paypal to process payments
When payment is successful your user is returned to your self which is when you can record the payment in the db. You might use some for of key or cookie variable to track the payment they have made.
You probably want to use the IPN to double check that it was successfully paid.
If all this is too hard just use http://wufoo.com/ and add the payment module to the form.