#evan_09475

1 messages · Page 1 of 1 (latest)

dreamy falconBOT
red lance
sturdy rock
#

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

red lance
#

Ah I see, let me check

sturdy rock
#

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

red lance
#

gotcha, still looking..

queen escarp
#

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?

sturdy rock
#

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

queen escarp
sturdy rock
#

const { error: submitError } = await elements.submit() should cause the paypal popup to show if selected, am I correct?

queen escarp
#

And then the payment intent will have requires_action status and the next_action will be a redirect to the site

sturdy rock
#

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