DEV Community

Gurpinder Singh
Gurpinder Singh

Posted on

How to create buy now button of paypal?

To create a PayPal button for a $450 USD purchase, you can use PayPal's button creation tool. Here's how you can do it:

  1. Go to the PayPal button creation page: PayPal Button Creation.
  2. Select "Buy Now" as the button type.
  3. Enter the item name and price. For example, you can enter "Product Name" for the item name and "$450.00" for the price.
  4. Select the currency as USD (United States Dollar).
  5. Click on "Create Button".
  6. Copy the generated button code.
  7. Paste the button code into your HTML where you want the button to appear.

Here's an example of how you can integrate the PayPal button code into your HTML:

`<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="example@gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Product Name">
<input type="hidden" name="amount" value="450.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_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>

`

Replace "example@gmail.com" with your actual PayPal ID.

Read More Coding Related Articles

Difference between in Index and Foreign Key

How to set a cron job by using the terminal in Ubuntu Server

For more updates Follow on linkedIn

This code will generate a "Buy Now" button that redirects users to PayPal to complete the payment of $450 USD.

Thanks for reading,
DGi Host.com

Top comments (0)