#Srujan

1 messages ยท Page 1 of 1 (latest)

livid onyxBOT
alpine thorn
#

Hello! I'm not familiar with that drawer component, but I'm wondering if it uses an <iframe> under the hood that might be causing the issue? Do you have a URL where I can see the problem and debug?

red ravine
#

There isn't a iframe, I did look into that attribute that stripe mentions. I do have a url, here it is

alpine thorn
#

The demo on that page you linked to doesn't seem to use an <iframe>, so maybe that's not ti...

#

Looking...

#

Google Pay shows up for me just fine on that page:

red ravine
#

Try placing an order

#

It shows up fine, but completing payment is where the issue is

alpine thorn
#

Ah, I see. It looks like the Payment Element might get destroyed when the panel goes away. Let me see...

red ravine
#

Oh I totally think thats what it is, but the drawer stays mounted in the dom by default

#

restarting the server, one sec. will send you another link

alpine thorn
#

I was just about to ask what happened. ๐Ÿ˜…

red ravine
#

sorry hehe

#

okay yup you were right though

#

I just commented out closing the drawer and its working

#

SO! Thank you ๐Ÿ™‚ issue resolved

alpine thorn
#

Okay, cool!

red ravine
#

wait one sec though

#

I am not able to get any of my console logs to display, even though the payment is going through successfully. I do have manual capture setup, does calling confirmPayment with redirect: 'if_required' give me back a paymentIntent from google pay?

#

I basically have other APIS as part of the food menu I need to call to verify and process the user's cart, and if that comes back as a failure I want to cancel the payment, or capture if succeeded

alpine thorn
#

I don't believe so. You should avoid using redirect: 'if_required' if possible.

red ravine
#

But if I don't have it, then I'm automatically redirected to the return url without the rest of my code executed, so in a manual capture scenario like I described above, what would you do instead?

#

I guess I can manually retrieve the paymentIntent and check the status that way? Like for requires_capture and etc?

alpine thorn
#

The Payment Element is designed to do a full redirect by default, and you need to be able to handle that flow. To clarify, are you trying to avoid client side confirmation?

red ravine
#

I'm trying to call confirmPayment and at that point, I want to check if there's an error, but if there's not one, I need to check the status of other external API calls before I capturePayment. If the external API calls come back unsuccessful, I want to cancel payment and avoid a redirect.

#

This flow works for credit card and apple pay, so I'm not sure what the difference is for google pay?

alpine thorn
red ravine
#

Oh damn I see. So the confirmation would be setup to be on the server side instead of calling confirmPayment on the frontend?

alpine thorn
#

It sounds like that's what you want, right? Or am I misunderstanding?

red ravine
#

That is definitely a solution, but kind of an overhaul for what I've been working with just to make google pay work. Is there no way to stop the redirect on google pay once confirmPayment has been called? If not then I guess this is my only options, but I'm wondering why google pay ignores the manual capture that we set on the server when we create the paymentIntent?

#

No you're correct

alpine thorn
#

I'm not sure, honestly. It shouldn't be ignoring it. Do you have a Payment Intent ID I can look at?

red ravine
#

Sure, pm_1MHtm9Qo4ogIFLACGU9C860R

alpine thorn
#

That's a Payment Method. Can you give me a Payment Intent ID (starts with pi_)?

red ravine
#

pi_3MHtkxQo4ogIFLAC1ybRclcc

#

it looks like capture method is automatic for this one for some reason

#

OH

alpine thorn
#

Yeah, when that one was created you didn't set it to manual.

red ravine
#

when I created it I used curl...how do I set manual capture on the curl manual command?

#

Sorry about that confusion

#

I'm creating them manually til we refactor the backend to use a test mode connect account to create payment intents, right now we're using live mode accounts to test and that doesn't work with google pay, so this was the workaround

#

I'm using this command curl https://api.stripe.com/v1/payment_intents \ -u sk_test_51L6JVvJlV60ASTL6kimW71XnHuW3GgHpwBocJyzAqLWmuW5KHNlAn7PbPuF0PEIRGhq7M2Jpc1zrcJI5yDBzCtmS00xcag2S40: \ -d amount=100 \ -d currency=usd \ -d "payment_method_types[]"=card \ -H Stripe-Account:acct_1LT8QGQo4ogIFLAC

#

How would I add manual capture to that? -d flag with manual capture?

alpine thorn
#

Add a -d capture_method=manual \ line.

#

Err.

red ravine
#

Thank you!

alpine thorn
#

No.

#

capture_method ๐Ÿ˜…

red ravine
#

Am I missing something? so it would be ``` curl https://api.stripe.com/v1/payment_intents
-u sk_test_51L6JVvJlV60ASTL6kimW71XnHuW3GgHpwBocJyzAqLWmuW5KHNlAn7PbPuF0PEIRGhq7M2Jpc1zrcJI5yDBzCtmS00xcag2S40:
-d amount=100
-d currency=usd
-d capture_method="manual"
-d "payment_method_types[]"=card
-H Stripe-Account:acct_1LT8QGQo4ogIFLAC

#

with or without quotes?

#

looks like that worked ๐Ÿ™‚

alpine thorn
#

You don't need quotes for that one because it's just lowercase letters, but they don't hurt if you include them.

red ravine
#

okay sweet. Thank you so much!!!

#

Order flow is working now ๐Ÿ™‚

alpine thorn
#

Awesome!

red ravine
#

Can you check why these payments might be uncaptured?pi_3MHuEyQo4ogIFLAC02WqeiGK

alpine thorn
#

That one was created with capture_method set to manual, then it was confirmed, but it was never captured.

red ravine
#

Hmm...I think I realize the issue. Internal server issues...But I think everything is working as intended

#

Thank you for your help Rubeus!