Description
**Fix PayPal Smart Buttons Integration on Trade Spray Ireland PWA (Dynamic Pricing)** We run a Progressive Web App (PWA) for **Trade Spray Ireland** (tradesprayireland.com) — an instant quote calculator for trade customers (joiners, builders, fit-out contractors) that calculates spray-finishing prices based on cutting list dimensions, then lets the customer accept the quote, add to cart, and pay. **The problem:** We're trying to integrate PayPal's **Smart Payment Buttons (JS SDK)** — not Hosted Buttons, since our prices are dynamically calculated per order and can't use a fixed price. The button currently fails to load on the live site with a "failed to load" error. We suspect the issue relates to an SDK script parameter (`&components=hosted-buttons`) that may be conflicting with `paypal.Buttons` loading correctly. We've added some debug logging to help identify whether it's an SDK load failure or a missing Buttons component, but haven't been able to fully diagnose or resolve it. **What we need:** - Review and fix our existing PayPal Smart Payment Buttons integration so it reliably loads and processes payment for a dynamically calculated cart total - Correctly wire up our real PayPal Client ID (currently a placeholder) - Test end-to-end: calculator → quote → cart → PayPal payment → confirmation - Advise on any other issues found in the integration along the way **Tech stack:** - Single-file HTML/JS PWA (no framework), with manifest.json and service-worker.js - Hosted at site