- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What I am trying to achieve is to create a button on the website, style it and redirect to PayPal with predefined amount.
I found a (legacy?) way of doing this by pointing to the account with email, (see the 3. line in code).
My question is, is there a way to work with just @username instead of email?
If yes, what input name should be used in that case instead of "business"?
Appreciate your advices.
<form action="https://www.paypal.com/donate" method="post" target="_top">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="HERE-GOES-THE-EMAIL">
<!-- Specify details about the contribution -->
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_recurring" value="0">
<input type="hidden" name="item_name" value="example">
<input type="hidden" name="item_number" value="example">
<input type="hidden" name="currency_code" value="USD">
<!-- Display the payment button. -->
<input type="submit" name="submit" class="button" value="€10.00">
</form>
Solved! Go to Solution.
- Labels:
-
PayPal HTML Buttons
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
One way to create a button with a predefined amount without using your email is to use the hosted button hidden input
E.g.,
<input type="hidden" name="hosted_button_id" value="xxxxxxxxxx">
The complete HTML for the hosted button is generated for you when you create a PayPal Payments Standard payment button.
Are you trying to create buttons with dynamic amounts?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
One way to create a button with a predefined amount without using your email is to use the hosted button hidden input
E.g.,
<input type="hidden" name="hosted_button_id" value="xxxxxxxxxx">
The complete HTML for the hosted button is generated for you when you create a PayPal Payments Standard payment button.
Are you trying to create buttons with dynamic amounts?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @mhorniq,
You're welcome. Using the newer JavaScript generated PayPal buttons provides flexibility in terms of using custom amounts and other dynamic variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hey @Nexus_Software
Thanks for the snippet.
As far as I can tell, your example is not for donation but for accepting and paying order. Am I right?
I found more references here, but those all are more suitable for paying for goods.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @mhorniq ,
Using the donation SDK is different. You would first log in to paypal.com/donate/buttons with the account you want to use to make a Donate button. Then create the predefined button. After you create a button, you get code. From the code, copy:
- hosted_button_id value if you have a business account
- business value if you have a personal account.
An example for implementing the button on your page would be:
<script src="https://www.paypalobjects.com/donate/sdk/donate-sdk.js" charset="UTF-8"></script>
<script>
PayPal.Donation.Button({
env: 'production',
hosted_button_id: 'S2KMEP2EAURGY',
// business: 'PAYPAL_BUSINESS_EMAIL',
image: {
src: 'https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif',
title: 'PayPal - The safer, easier way to pay online!',
alt: 'Donate with PayPal button'
},
onComplete: function (params) {
// Your onComplete handler
},
}).render('#paypal-donate-button-container');
</script>
Thank you.
Powered by Custom Software : NexWebSites.com
PayPal Developers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hey @Nexus_Software
got it, so these are the two possibilities we have - business (aka Email) pointer and the button-id pointer.
thank you for all the answers and snippets!

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- where does paypal payments go to if there is no linked phone or email to the seller ? in PayPal Payments Standard
- Couldn't receive International payment in PayPal Payments Standard
- Sandbox account collect billing and shipping address in Sandbox Environment
- "System error. Please try again later" when connecting to paypal sandbox account with my android app in Sandbox Environment
- [WooCommerce PayPal Payments] - Required phone country code, different than the cards country code. in PayPal Payments Standard