# Google Pay On Web

# Accept web payments using Google Pay, process with GoDaddy Payments

Google Pay Terms

By integrating GooglePay™, you and your business adhere to

Google Pay™ lets your customers pay with the press of a button — using payment methods saved to their Google Account.

Google Pay is available out-of-the-box with GoDaddy payment products, such as

  • Paylinks
  • Online Store Checkout
  • Online Appointment
  • Online Ordering Page
  • WordPress and WooCommerce plugin

Alternatively, you can build your own web payment form and accept Google Pay using Poynt Collect, with minimum code changes. Your backend needs to follow-up and process payments.

# Poynt Collect Integration

Build your own Pay button within your website by following 3 steps:

  1. Setup GoDaddy Payments business and obtain Poynt Collect API credentials via Poynt HQ
  2. Implement Google Pay button via Poynt Collect iframe on your client side
  3. Implement Payments API call on your server side

Google Brand Guideline

When you build your own Pay button, make sure that your website complies to Google Brand Guidelines (opens new window)

# Client-side Code sample

Use code below to render simple Google Pay button with Poynt Collect iframe. You just need to update the following code with your GoDaddy Payments business_id and application_id obtained from step (1)

<html>
  <head>
  </head>
  <body>
    <div id="poynt-collect-iframe"></div>
    <script>
      const iframe = document.createElement("script");
      iframe.src = "https://cdn.poynt.net/collect.js";
      iframe.async = true;

      iframe.onload = () => {
        const collect = new TokenizeJs("<business_id>", "<application_id>");

        collect.supportWalletPayments()
            .then((result) => {
            const paymentMethods = [];
        
            if (result.googlePay) {
                paymentMethods.push("google_pay");
            }
        
            if (paymentMethods.length) {
                collect.mount("poynt-collect-iframe", document, {
                    paymentMethods,
                });
            }
            })
            .catch((error) => {
            console.error(error);
            });

        collect.on("nonce", event => {
          console.log("collect nonce", event);
        });

        collect.on("error", event => {
          console.log("collect error", event);
        });
      };

      document.head?.appendChild(iframe);
    </script>
  </body>
</html>

# References

Last Updated: 8/12/2024, 10:01:45 AM