#aminos20220
1 messages · Page 1 of 1 (latest)
Hi there!
You can disable wallets here: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-wallets
Sure!
what do you mean?
You should already have a code to create the Element on your page elements.create(...). Update this code to disable wallets.
i tried this : const elements = useElements();
var paymentElement = elements.create("payment");
Wait, did you create the Payment Element in the screenshot you shared above?
I used this code :
var elements = useElements();
const stripe = useStripe();
stripe
.confirmPayment({
elements,
redirect: "if_required",
confirmParams: {
payment_method_data: {
billing_details: {
name: user.firstName.toUpperCase() + " " + user.lastName,
email: user.email,
phone: user.phone.number,
},
},
},
})
This is the code to confirm the PaymentIntent. You don't need to change this
ok
You need to find the code that creates the Payment Element on your page
I just imported PaymentElement from "@stripe/react-stripe-js"
import {
PaymentElement,
useStripe,
useElements,
} from "@stripe/react-stripe-js";
is this the right way ?
I don't understand your question, sorry.
This code is not creating the Payment Element on the page
Are you a software developer?
yes I am, i am a beginner
You already have a code like this on your page: elements.create('payment') to create the Payment Element
You need to edit it to something like this: elements.create('payment', {wallets: {applePay: 'never', googlePay: 'never'}})
No I don't have a code like this
Oh you are using React?
can you please redirect me to an example using this code ?
Next js
I create a payment intent using stripe.paymentIntents.create
then I use : const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_API_KEY);
call the API
Okay, so you probably have a code like this: <PaymentElement />
yes <Elements options={options} stripe={stripePromise}>
<CheckoutForm
booking={booking}
setBooking={setBooking}
availableRooms={availableRooms}
amountToPay={amountToPay}
bookingData={bookingData}
clientStripeID={clientStripeID}
user={user}
/>
</Elements>
in the checkout form
And you want tot change it like this: ``<PaymentElement options={...} />`
<PaymentElement id="payment-element" />
And in ... you remove the wallets
how do I use options to do that ?
<PaymentElement id="payment-element" options={{ wallets: null }} />
is this correct
Something like this (I haven't tested this code): `<PaymentElement options={{wallets: {applePay: 'never', googlePay: 'never'}}} />
You can check all the props available here: https://stripe.com/docs/stripe-js/react#element-components