The @paypal/react-paypal-js/sdk-v6 entry provides components and hooks for over 45 regional Local Payment Methods (e.g., iDEAL, Bancontact, BLIK, Pix, Klarna).
Integration Patterns
Every LPM provides three primary integration points:
<MethodName>OneTimePaymentButton: A self-contained component that renders both required buyer fields (like full name) and the payment button.use<MethodName>OneTimePaymentSession: A hook for full control over the click handler, pending/error states, and custom button UI.<MethodName>PaymentButton: A standalone button that reads its session from context, useful when required fields need to be laid out separately from the button.
Important Constraints
- Presentation Mode: LPMs only support
presentationMode="popup". Other modes like "auto" or "modal" are not supported and will cause type errors. - Dynamic Selection: If you need to select an LPM dynamically (e.g., via an
lpm string), use the generic exports: LPMOneTimePaymentButton, useLPMOneTimePaymentSession, LPM_REGISTRY, and LPMName.
import {
PayPalProvider,
IdealOneTimePaymentButton,
} from "@paypal/react-paypal-js/sdk-v6";
// ... createOrder and onApprove logic ...
export default function App() {
return (
<PayPalProvider
clientId="YOUR_CLIENT_ID"
environment="sandbox"
components={["ideal-payments"]}
pageType="checkout"
>
<IdealOneTimePaymentButton
presentationMode="popup"
createOrder={createOrder}
onApprove={onApprove}
onCancel={() => console.log("Payment cancelled")}
/>
</PayPalProvider>
);
}