#nic.diblasi-payment

1 messages ยท Page 1 of 1 (latest)

obtuse hearth
#

hello! do you have a url which we can access to take a look?

hard coyote
#

A url to the checkout form?

obtuse hearth
#

your site, where we can try the flow end to end to see what's wrong

hard coyote
#

Unfortunately it's an internal domain and cannot be accessed publicly. Is there another option?

obtuse hearth
#

you can also share a minimal replicable sample that throws this error. Maybe use github gists or any other service to share your code. Without seeing how all of your code works together, there's no way to troubleshoot this

#

if you do share code, remember to redact sensitive information such as secret keys

hard coyote
#

I'm happy to share code although i'm not sure what exactly to share? Do you want to see the java script where i'm calling stripe.confirmPayment(), the payment intent, the data that gets keyed in the form? Will this information suffice

obtuse hearth
#

lets start off with what you mentioned - the JS code where you're calling stripe.confirm and which line of code is returning that error message

#

you can just paste it here for now

hard coyote
#

function SubmitForm() {
switch (paymentMethodType) {
case 'card':
stripe.confirmPayment({
elements,
confirmParams: {
redirect: 'if_required',
},
})
}
}

#

For now i'm not too concern about the promise returned but rather confirming the payment intent

obtuse hearth
#

why do you need to switch for paymentMethodType?

#

confirmPayment works for all payment method types for Payment Element

hard coyote
#

ok but regardless the confirmPayment is being called

obtuse hearth
#

so you mentioned the response returns an error object {error:{message:Invalid form setup}}

#

can you share the network request that returned this error object?

#

i.e. what's the URL that the request was made to that returned that response with that error object

#

and which line of code is that error being returned in?

hard coyote
#

Sorry for the misleading information I had checks prior to the ConfirmPayment() that were being satisfied which was returning the error object. The snippet i have sent is the simplest version of the function and once the ConfirmPayment call is made, obviously nothing occurs from what you can see but shouldn't i expect in my stripe developer logs that the payment intent has been confirmed after X time?

#

Or at least an errored log?

obtuse hearth
#

do you have the PaymentIntent id? I'll take a look at it

hard coyote
#

pi_3LY3WSRT9U72Anmx1oMvRGDb

exotic owl
#

๐Ÿ‘‹ Taking over this thread, catching up now

#

Thanks for sharing the payment intent

#

I take a look at the payment intent you shared and no confirmation request is made to Stripe

#

This is likely that the frontend client has an error even before reaching to actual confirmation call

#

I have taken a look at your confirmation call, redirect field is set incorrectly that it shouldn't be under confirmParams hash

#

It should look like:

stripe.confirmPayment({
  elements,
  redirect: 'if_required',
  confirmParams: {
    // Make sure to change this to your payment completion page
    return_url: window.location.href,
  },
});
#

Could you update redirect field and try again?

hard coyote
#

trying now

hard coyote
#

Have create payment intent pi_3LY4QART9U72Anmx0CzIBsIx. With the following changes to the function:

function SubmitForm(ClientSecret) {
stripe.confirmPayment({
elements,
redirect: 'if_required',
confirmParams: {
return_url: 'https://www.fenwick.com.au/',
},
});
}

#

No luck with confirming

exotic owl
#

What is the error you're receiving?

#

I don't see you handling the error for stripe.confirmPayment

hard coyote
#

Not receiving anything after the ConfirmPayment call. The callback is never triggered
function SubmitForm(ClientSecret) {
stripe.confirmPayment({
elements,
redirect: 'if_required',
confirmParams: {
return_url: 'https://www.fenwick.com.au/',
}
}).then(function (result) {
//never gets hits this line
});
}

#

Is there a way i can get any feedback from the sdk?

exotic owl
#

Can you log before stripe.confirmPayment and ensure stripe.confirmPayment is being called?

hard coyote
#

it's steps into the stripe sdk so i can confirm that

exotic owl
#

Do you have a test site to share or code snippet that is able to produce this error? The code seems right to me, but I don't have full context of your website

dense surge
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!