Docs
PayPal donate pattern
Use the shared PayPal donate component plus a direct-link helper for popup/SKD failure cases.
Standard
- Render `PayPalDonateButton` as the primary donate action.
- Add a small helper link below it that opens PayPal in a new tab.
- Avoid a second full-size button fallback.
- Production pages must provide a valid hosted button ID (`hostedButtonId` prop or `VITE_PAYPAL_DONATE_HOSTED_BUTTON_ID`).
- Template/example pages may use a clearly labeled dummy ID only for visual documentation.
- `env="sandbox"` switches the PayPal SDK to sandbox mode for testing; default is `"production"`.
- `onComplete`/`onError` callbacks are available for analytics/tracking hooks around the donation flow.
- `imageSrc`/`imageAlt`/`imageTitle` override the default PayPal button graphic if a custom donate button image is needed.
Reference
- Live example: PayPal donate example page
- Component: `template/src/components/patterns/PayPalDonateButton.tsx`