#sajid_code

1 messages ยท Page 1 of 1 (latest)

terse zincBOT
odd lavaBOT
#

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.

terse zincBOT
#

๐Ÿ‘‹ 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.

odd lavaBOT
tulip gazelle
#

Which error(s) are you seeing?

faint pumice
#

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,
  },

});

tulip gazelle
faint pumice
#

Error: Not a valid URL

tulip gazelle
#

What's not a valid URL?

faint pumice
#

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

tulip gazelle
#

I suspect your return_url is invalid

faint pumice
#

Now the path i am using is same of Checkout page