Linking a Custom Buy Now Button to my Paypal Account for Client's Orders

jampearl
Contributor
Contributor

Hi!

 

 

I'm new to this and I'll try to be brief:

 

1. I have a wordpress website and a plugin which generates pricing tables with a custom BUY NOW button - I don't have the possibility of replacing that button with the paypal's button.

 

2. Can I link that custom button to my paypal account? For example, when a client decides to buy something at 10$ and clicks on the BUY NOW button, he/she will be redirected to paypal to complete the order.

 

 

PS:

Is it working or legit to use this link to a button + ID: www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=

 

Thank you in advance!

Hope my English is not too bad.

Login to Me Too
1 REPLY 1

PayPal_RobG
PayPal Employee
PayPal Employee

Hi jampearl,

 

If your website already generates a (generic) 'Buy now' button, some logic would need to modified to ensure it generates a button which links to PayPal.

Whether or not this is possible with the plugin you're using is something you'd need to find out first.

Or alternatively, if you some coding experience, you may be able to modify the plugin's core files to do this directly.

 

Yes, it's perfectly fine to use the link you included above.

 

If you're going to start modifying the button, you may want to take a look at PayPal HTML Variables.

This page includes are required and optional HTML variables you would need to use in case you want to submit a <form> (a transaction request) to PayPal.

 

For example, you can modify the existing button to create the following form:

<form method="POST" action="https://www.paypal.com/cgi-bin/webscr">

<input type="hidden" name="amount" value="xx.xx">

<input type="hidden" name="business" value="xxxxxxx">

<input type="submit" name="submit" value="Buy now">

</form>

 

This is the most basic example of a PayPal button.

 

1. <form method="POST" action="https://www.paypal.com/cgi-bin/webscr">

This indicates we're going to POST this form data to https://www.paypal.com/cgi-bin/webscr -- this is the URL on which we want to receive all data.

 

2. <input type="hidden" name="amount" value="xx.xx">

The value of this field indicates the amount you wish to charge

 

3. <input type="hidden" name="business" value="xxxxxxx">

The value of this field indicates the recipient of the funds. Typically you would enter your PayPal account email address or secure merchant ID in here.

 

4. <input type="submit" name="submit" value="Buy now">

This will display a standard button with 'Buy now' written on it

 

5. </form>

This closes the form.

----
For technical assistance with PayPal merchant product offerings, please file a ticket at https://www.paypal.com/mts/
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.