#pawan_code

1 messages ยท Page 1 of 1 (latest)

brazen flickerBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1290291420099252224

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

inner basalt
#

Hi @burnt thunder

burnt thunder
#

hi there!

#

you want to detect that on the frontend or on the backend after the payment is successful?

inner basalt
#

One Quick Question I want to Detect weather customer has checked the checkbox or not in that case how can i

#

Can you please Have a look once

burnt thunder
#

you want to detect that on the frontend or on the backend after the payment is successful?

inner basalt
#

While Doing Payment i want to detect so that i can restrict some unnessary calls in react

#

i am using payment elements for this

#

I am using elementsOptions as manual

#

for more clarity you can refer earlier chat

#

Are you there @burnt thunder

brazen flickerBOT
burnt thunder
#

yes I'm here, please be patient. looking into this.

inner basalt
#

Sure

burnt thunder
#

so it might not possible to know that information from the frontend.

inner basalt
#

Then how Can Detect

#

because Suppose Customer Didn't Checked the Checbox that time also code will execute if want to restrict it if customer didn't checked the box

verbal salmon
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away. You'll want to check the Payment Intent and Payment Method that are created when the customer steps through your flow.

The Payment Intent's setup_future_usage field will be set:
https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage
and the allow_redisplay field on the Payment Method will also be set to always:
https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay

https://docs.stripe.com/payments/save-customer-payment-methods#save-a-payment-method-for-a-subscription-or-recurring-transaction
https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#enable-saving-the-payment-method-in-the-payment-element

Securely accept payments online.

Learn more about saved payment methods in the Payment Element.

inner basalt
#

In My case Its Not Happening

#

The Payment Intent's setup_future_usage field will be set:
and the allow_redisplay field on the Payment Method will also be set to always:

verbal salmon
#

Can you elaborate on what you mean when you it's not happening? Do you have example objects from your testing that you can share IDs for that I can take a closer look at?

inner basalt
#

I am Doing Explicitly

verbal salmon
#

Sorry, I'm not sure I understand, what are you doing explicitly?

inner basalt
#

Updating Payment Method and Payment Intent for setup_future_uage & Allow_redisplay as always

verbal salmon
#

Wait, if you're explicitly setting those, why even give your customers the choice to save their payment methods? Are you always saving payment methods for future usage?

#

We set those fields automatically if you surface the checkbox for saving to your customers, so if you overwrite what we set (I'm not actually sure you can on the Payment Intent), then you're overwriting the signal we give about whether the customer wanted to save their payment method details.

verbal salmon
#

I don't understand the flow you're describing then. I don't understand what fields you're setting and which ones you're letting us set based on customer input.

#

Please share the ID of successful Payment Intents from your testing so I can try to get a better understanding of what you're trying to describe.

inner basalt
verbal salmon
#

That thread says you aren't creating Payment Intents, but are doing manual payment method creation?

inner basalt
#

I am Creating the Payment Intent as well It Might Missed there

verbal salmon
#

Can you share the ID of a completed Payment Intent from your testing?

inner basalt
#

POST
/v1/payment_intents/pi_3Q4h3kHBIoGyEgRJ015hz4Zi

#

POST
/v1/payment_intents/pi_3Q4gr4HBIoGyEgRJ03kKYA09

verbal salmon
#

You're setting setup_future_usage on your own, so there doesn't seem to be any point in surfacing our checkbox to your customers.
https://dashboard.stripe.com/test/logs/req_BKwYwxTwjlrHlI

I'd suggest setting components.payment_element.features.payment_method_save in your Customer Session creation request to disabled to remove the checkbox from the flow since you seem to be setting setup_future_usage on your own.

inner basalt
#

I want the Checkbox and if user checks the checkbox then Only save the Payment

verbal salmon
#

Okay, then don't set setup_future_usage on the intent, and don't set allow_redisplay on the Payment Method. Let us set those.

inner basalt
#

Yaa Its Was Not Happing in my Case Automatically then I went through this approach

#

I Already Shared Everything in Above Thread

#

That's Why I Came to this Solution

verbal salmon
#

Maybe I skimmed too quickly (it was a really long thread) but I didn't see any mention of those not being set as expected.

#

Can you share a Payment Intent from your testing where you didn't set those fields manually, checked the checkbox, and still didn't see the fields set as expected?