#gael_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/1268114311537098852
๐ 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.
- gael_code, 22 hours ago, 16 messages
Hmm did you observe (debug) that the update function was called?
Yes it is called and does not return an error. I have the impression that the .update only works if the button is not yet rendered in the view. But I need to change the amount associated with the payment in the button page
yes update only works if the sheet is not currently open. You can't update the sheet when it's open if that's what you mean. Beyond that, I do think update should just work(I'll check) so maybe there's an issue in your integration, do you have a simple repro page anywhere?
here's a simple repro that shows it works https://jsfiddle.net/297yj3pu/ (you can click the button to increase the amount, then click the PRB and see the amount is different).
I can send you the code used
In the example you add a delivery price, you do not modify the basic amount I have the impression
The label should be "Demonstration" and the initial amount should be updated. This doesn't work on the example either
what part of the example I showed you doesn't work?
no, it shouldn't?
my code doesn't change the shippingOption
my code just sets the amount to +100 itself when you click the button for it, and that way when you open the sheet you see the total amount has changed. The shipping is separate.
Ok I understand... Can we manage the update when clicking on the PaymentRequestButtonElement?
I believe so yes, but only if you're using the "custom" button approach https://docs.stripe.com/stripe-js/elements/payment-request-button?client=html#use-own-button https://jsfiddle.net/v7wL7pbu/
I don't really see how to integrate it into react
yeah we don't really have any sample code for this, and PaymentRequestButton is replaced by ExpressCheckoutElement anyway.
in any case it should be straightforward, you have a <button> and the onClick function needs to call paymentRequest.show()
This seems depreciated ๐ฆ
yes that's what I mentioned earlier ("PaymentRequestButton is replaced by ExpressCheckoutElement ")
you can still use PaymentRequestButton though
overall, to step back, the update function in general does work so I suspect there's an issue in your integration. My guess would be one of your useEffect functions is running on each render and setting the pr variable to an initial state or something, I'd try to add extensive logs to debug what's happening.