Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 1.39 KB

File metadata and controls

44 lines (29 loc) · 1.39 KB

Getting Started Guide: PayPal Buy Button

With PayPal's Buy Button accept payments without building your own payment workflow.

Open the code in the web IDE now using GitHub Codespaces... Open in GitHub Codespaces

Preview

PayPal Buy Button example

Explanation

Step 1

In your html <head> tag add the following: (this has your unique client-id).

<script src="https://www.paypal.com/sdk/js?client-id=BAAY5EAkskLsBGeYrYpHm9PzA-KkgOiOx1J0fwKCo_YkS3f81HiV-Ze9QzwmGHyf4S2cZjRtpTRc6pDekA&components=hosted-buttons&disable-funding=venmo&currency=USD"></script>

Important

This should be included only once per page.

Step 2

In your html <body> tag add the following:

<div id="paypal-container-ZGT7S2VPTE4D4"></div>
<script>
  paypal
    .HostedButtons({
      hostedButtonId: "ZGT7S2VPTE4D4",
    })
    .render("#paypal-container-ZGT7S2VPTE4D4");
</script>

Tip

You can create as many buttons as you need for different products or services. Just make sure to use the specific hostedButtonId for each button you create, which you can find in your PayPal dashboard under the details of each button you create.

How to create your PayPal Buy Button

Demo on how to create your PayPal Buy Button