#sarita9248
1 messages · Page 1 of 1 (latest)
What source are you referring to? Can you illustrate in an example?
If my url has a parameter example.com?source='xyz' and I want to record this xyz in stripe for the transaction.
Does it make sense?
Hi
Thanks for waiting! Discord is busy now and will take time to respond
Which URL is this for? If it's for return_url, then you can add the source parameter in the link
Is there a doc link that you can share?
We don't have a specific doc for this. When you create a Payment Intent, you can add query parameter in the return_url: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-return_url
For example,
return_url: 'https://www.example.com?source=xyz'
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This is my current code, will adding the source=xyz to the thank-you page get recorded in the stripe automatically? I want the source to be recording some where in the stripe with my transaction.
async function handleSubmit(e) {
e.preventDefault();
setLoading(true);
var homepageURL = window.location.origin;
console.log(homepageURL);
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: homepageURL + "/thank-you",
},
});
if (error.type === "card_error" || error.type === "validation_error") {
showMessage(error.message);
} else {
showMessage("An unexpected error occurred.");
}
setLoading(false);
}