Mobile app version of vmapp.org
Login or Join
Gonzalez347

: How do I generate a PayPal payment/donation page without using the PayPal button? I want to ask people to donate to my website. Right now, I have a big, friendly "Donate via PayPal" button

@Gonzalez347

Posted in: #PaymentGateway #Payments #Paypal

I want to ask people to donate to my website. Right now, I have a big, friendly "Donate via PayPal" button on my site, and when someone clicks on it, it takes them to PayPal, and they can enter the amount they want to donate and whatnot.

Is there any way I can just get them directly to the PayPal page, without having to click the "Donate" button on my website?

Ideally, I want to be able to tell people "just go to mywebsite.com/donate" and when they type that web address in their browser (or click a link to that URL), they get taken directly to the PayPal page where they can enter all their payment details and such.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gonzalez347

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gloria169

On your mywebsite.com/donate page, you will need to construct a form and then automatically submit it using JavaScript. A basic example:

<form id="my_form" action="http://paypal.com" method="post">
<input type="hidden" name="name" value="Example">
<input type="hidden" name="email" value="test@test.com">
<input type="hidden" name="etc" value="etc, etc">
</form>

<script type="text/javascript">
//Our form submission function.
function submitForm() {
document.getElementById('my_form').submit();
}
//Call the function submitForm() as soon as the page has loaded.
window.onload = submitForm;
</script>


Obviously, you will need to provide the form variables that PayPal requires.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme