#pawan_code
1 messages ยท Page 1 of 1 (latest)
๐ 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.
- pawan_code, 4 days ago, 14 messages
- pawan_code, 4 days ago, 16 messages
- pawan_docs, 5 days ago, 110 messages
Hi @burnt thunder
hi there!
you want to detect that on the frontend or on the backend after the payment is successful?
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
you want to detect that on the frontend or on the backend after the payment is successful?
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
yes I'm here, please be patient. looking into this.
Sure
there's this method to be notified of changes on the Payment Element https://docs.stripe.com/js/element/events/on_change?type=paymentElement but I don't think it will include information about this checkbox.
so it might not possible to know that information from the frontend.
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
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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:
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?
I am Doing Explicitly
Sorry, I'm not sure I understand, what are you doing explicitly?
Updating Payment Method and Payment Intent for setup_future_uage & Allow_redisplay as always
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.
No
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.
https://discordapp.com/channels/841573134531821608/1288093408593969152
Could you please refer this thread then you will have the context what i am trying to say and what approach i am doing
That thread says you aren't creating Payment Intents, but are doing manual payment method creation?
Can you share the ID of a completed Payment Intent from your testing?
POST
/v1/payment_intents/pi_3Q4h3kHBIoGyEgRJ015hz4Zi
POST
/v1/payment_intents/pi_3Q4gr4HBIoGyEgRJ03kKYA09
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.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I want the Checkbox and if user checks the checkbox then Only save the Payment
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.
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
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?