#evan_09475
1 messages · Page 1 of 1 (latest)
👋 I don't think we have a specific guide for this but you should be able to use it similar to other wallets in the defer intent flow
https://stripe.com/docs/payments/accept-a-payment-deferred
Have you tried it already and are seeing any errors?
getting
IntegrationError: To use createPaymentMethod with the Payment Element, your elements instance must be created with paymentMethodCreation: 'manual'.
when I set paymentMethodCreation: to manual.
googlePay and normal card forms work
But Paypal does not work
Ah I see, let me check
this is my handleSubmit handler
const handleSubmit = async () => {
if (!stripe) {
return
}
// Trigger form validation and wallet collection
const { error: submitError } = await elements.submit()
const { error, paymentMethod } = await stripe.createPaymentMethod({
elements,
params: {
billing_details: {
name: 'Jenny Rosen'
}
}
})
if (paymentMethod && paymentMethod.billing_details.name) {
dispatch(setCheckoutViewToLoading())
dispatch(
sendToStripeCheckout({
payeeName: paymentMethod.billing_details.name,
subscriptionPlanId: selectedPlan.id,
paymentMethodId: paymentMethod.id
})
)
}
}
When I choose paypal in the payment element in the UI. I get paypal selected.
After submission, you will be redirected to securely complete next steps.
but nothing really happens
gotcha, still looking..
My test page is letting me create a Paypal payment method with very similar code. Trying to figure out what the difference is...
Is your createPaymentMethod call not returning at all?
checking
when I click on pay when Paypal is selected, i get a result back from the createPaymentMethod . but the popup is not showing at all
I mean paypal popup
and also the payment method information does not have billing info, but I recieve the object back
Ah, that is expected. For that flow you need to create a payment intent with the PaymentMethod attached and confirm the intent
https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=web&type=payment#submit-payment
const { error: submitError } = await elements.submit() should cause the paypal popup to show if selected, am I correct?
And then the payment intent will have requires_action status and the next_action will be a redirect to the site
I see i haven't worked with intents before, my implementation is that my server handles creating the stripe customer and the subscription by getting the payment method id