#sajid_code
1 messages ยท Page 1 of 1 (latest)
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.
- sajid_connect-embedded, 1 day ago, 19 messages
- sajid_code, 1 day ago, 20 messages
- sajid_embedded-onboarding, 1 day ago, 51 messages
- sajid_code, 1 day ago, 18 messages
- sajid_custom-onboarding, 2 days ago, 55 messages
- sajid_code, 2 days ago, 51 messages
๐ 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/1235503286786985984
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Which error(s) are you seeing?
const paymentIntent = await stripe.paymentIntents.create({
amount: 3000,
currency: "usd",
description: 'Software development services',
shipping: {
name: 'Jenny Rosen',
address: {
line1: '510 Townsend St',
postal_code: '98140',
city: 'San Francisco',
state: 'CA',
country: 'US',
},
},
transfer_data: {
destination: 'acct_1PA9YDR2bWiQvRfw',
},
application_fee_amount: 14,
on_behalf_of: 'acct_1PA9YDR2bWiQvRfw',
automatic_payment_methods: {
enabled: true,
},
});
Sure, seems expected. The intent needs confirming when you pass it payment method details from Stripe.js: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
Error: Not a valid URL
What's not a valid URL?
useEffect(() => {
if (!stripe) {
return;
}
const clientSecret = new URLSearchParams(window.location.search).get(
"payment_intent_client_secret"
);
if (!clientSecret) {
return;
}
stripe.retrievePaymentIntent(clientSecret).then(({ paymentIntent, error }) => {
if (error && error.type !== "validation_error") {
// Handle other errors
console.error(error.message);
setMessage(`Error: ${error.message}`);
return;
}
switch (paymentIntent.status) {
case "succeeded":
console.log("success")
setMessage("Payment succeeded!");
break;
case "processing":
console.log("processing")
setMessage("Your payment is processing.");
break;
case "requires_payment_method":
console.log("requre paymnt ethod")
setMessage("Your payment was not successful, please try again.");
break;
default:
setMessage("Something went wrong.");
break;
}
});
}, [stripe]);
const handleSubmit = async (e) => {
e.preventDefault();
if (!stripe || !elements) {
// Stripe.js hasn't yet loaded.
// Make sure to disable form submission until Stripe.js has loaded.
return;
}
setIsLoading(true);
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: `http://localhost:3000/user/checkout/${eventId}`
},
});
if (error && error.type !== "validation_error") {
// Handle other errors
console.error(error.message);
setMessage(`Error: ${error.message}`);
}
setIsLoading(false);
};
it says Error: Not a valid URL
I suspect your return_url is invalid
yes when i click on paynow it does not create new path with payment id and client sceret:
path should be like this: http://localhost:3001/?payment_intent=pi_3PBusOJ1IZg6T88p0jayHMZJ&payment_intent_client_secret=pi_3PBusOJ1IZg6T88p0jayHMZJ_secret_zFoHwiCkTy6YtT2goWzA21Q4W&redirect_status=succeeded
but my url is not chaning and giving the error : Invalid URL
Now the path i am using is same of Checkout page