#nikolakg80
1 messages · Page 1 of 1 (latest)
yes you can use the update function:
https://stripe.com/docs/js/elements_object/update
I'm sometimes getting this error: "You cannot update Payment Request options while the payment sheet is showing"
On my checkout page, I can change the order, therefore the amount...
The fucntion I shared is for js integration. You are using mobile SDK ?
No, I am using the js integration, and I use elements.update({ amount: 1000 })
This works when I'm not logged in into link
Could you share your code ?
Sorry, I can't recreate this...
Might be it's something with Vue
const { stripeAmount, showStripeForm } = this;
const stripePaymentForm = $('#stripe-payment-form');
stripePaymentForm.toggle(showStripeForm);
if (elements) {
elements.update({ amount: stripeAmount });
}
},
What is the exact need when are you updating the element amount ?
I'm working on online food ordering. And the user is allowed to change the quantity of ordered food
So I click on a plus sign next to the item, and the amount changes
"You cannot update Payment Request options while the payment sheet is showing"
Can't recreate it anymore, which is great
Well, happy to hear that, don't hesitate to come back if you will be facing this again.
Hopefully it won't happen again.
Thank you, I'm so glad that you have this support channel, it makes life easier when you have an expert to talk to