#talon_api
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/1283855684747788340
đ 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.
- talon_api, 3 minutes ago, 20 messages
- talon_api, 22 hours ago, 36 messages
- talon_wallet-only, 23 hours ago, 10 messages
- talon_connect-dispute, 2 days ago, 6 messages
- talon_api, 3 days ago, 12 messages
const options = {
mode: 'payment',
amount: 1099,
currency: 'usd',
// Customizable with appearance API.
appearance: {/*...*/},
};
return (
<Elements stripe={stripePromise} options={options}>
<CheckoutPage />
</Elements>
i can't seem to find the possible values for mode field, i just saw this in example guide
Hello! We document the mode values you can use here: https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-mode
so if i want to select payment amount? can it be in payment intent?
const onConfirm = async (event) => {
if (!stripe) {
// Stripe.js hasn't loaded yet.
// Make sure to disable form submission until Stripe.js has loaded.
return;
}
const {error: submitError} = await elements.submit();
if (submitError) {
setErrorMessage(submitError.message);
return;
}
// Create the PaymentIntent and obtain clientSecret
const res = await fetch('/create-intent', {
method: 'POST',
});
const {client_secret: clientSecret} = await res.json();
// Confirm the PaymentIntent using the details collected by the Express Checkout Element
const {error} = await stripe.confirmPayment({
// `elements` instance used to create the Express Checkout Element
elements,
// `clientSecret` from the created PaymentIntent
clientSecret,
confirmParams: {
return_url: 'https://example.com/order/123/complete',
},
});
if (error) {
// This point is only reached if there's an immediate error when
// confirming the payment. Show the error to your customer (for example, payment details incomplete)
setErrorMessage(error.message);
} else {
// The payment UI automatically closes with a success animation.
// Your customer is redirected to your `return_url`.
}
};
return (
<div id="checkout-page">
<h1>Checkout page</h1>
<p>Please select a payment method</p>
<ExpressCheckoutElement onConfirm={onConfirm} />
{errorMessage && <div>{errorMessage}</div>}
</div>
);
};
Not sure I understand, can you provide a lot more detail about what you're trying to do?
I am wondering how to set the amout on this transction
I beleive it shouldn;t be in options
const options = {
mode: 'payment',
// Customizable with appearance API.
appearance: {/*...*/},
};
to set amount from backend i guess I can just add the amount to payment intent
Actually that is where you would provide the amount, yep: https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-amount
i see and what can be the replacement for ExpressCheckoutElement in react native