I'm trying to use the PayPalCardFieldsProvider and PayPalCardFieldsForm to have more control than simply using PayPalButtons. I don't want to collect the billing and shipping information in the checkout component, because when a user signs up, they already provide all the information ahead of time and this information is available in the shopping cart. This is the main problem I have with PayPalButtons, I found no way to disable the billing address form when selecting Credit/debit card in the checkout. While PayPalButtons works in so far as rendering the checkout options, the CardFields component doesn't: it renders an empty <div>:
🔬 Minimal Reproduction
I'm writing a Next.js app, here is the client component that should render the checkout section below the shopping cart. My goal is to show both the PayPal button, optionally processors like MyBank and Giropay, but also credit card.
When using PayPalCardFieldsProvider and PayPalCardFieldsForm, the Checkout form is not rendered (see below). I tried using PayPalCardFieldsForm and the individual form fields (PayPalNameField, PayPalNumberField, ...) but the result is the same.
Library used
react-paypal-js
🐞 Describe the Bug
I'm trying to use the
PayPalCardFieldsProvider
andPayPalCardFieldsForm
to have more control than simply usingPayPalButtons
. I don't want to collect the billing and shipping information in the checkout component, because when a user signs up, they already provide all the information ahead of time and this information is available in the shopping cart. This is the main problem I have with PayPalButtons, I found no way to disable the billing address form when selecting Credit/debit card in the checkout. While PayPalButtons works in so far as rendering the checkout options, the CardFields component doesn't: it renders an empty<div>
:🔬 Minimal Reproduction
I'm writing a Next.js app, here is the client component that should render the checkout section below the shopping cart. My goal is to show both the PayPal button, optionally processors like MyBank and Giropay, but also credit card.
😕 Actual Behavior
When using PayPalCardFieldsProvider and PayPalCardFieldsForm, the Checkout form is not rendered (see below). I tried using
PayPalCardFieldsForm
and the individual form fields (PayPalNameField
,PayPalNumberField
, ...) but the result is the same.🤔 Expected Behavior
The Checkout form should be rendered.
🌍 Environment
➕ Additional Context
├── @paypal/paypal-js@8.1.0 ├── @paypal/react-paypal-js@8.5.0 ├── next@14.1.1 ├── react@18.2.0