#nick_code

1 messages ¡ Page 1 of 1 (latest)

lethal quarryBOT
#

👋 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/1276391403525505095

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

lime oracleBOT
#

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.

leaden gorge
#

Hi there, can you share with me the code you wrote?

tight rampart
# leaden gorge Hi there, can you share with me the code you wrote?

Sure thing.

    try {
      const successUrl = 'www.mywebsite.come/successpage.html?status=success';
      const cancelUrl = 'www.mywebsite.come/failpage.html?status=failed';
      let bodyData = selectedItems.map((item, index) => {
        return `line_items[${index}][price]=${encodeURIComponent(item.price)}&line_items[${index}][quantity]=${item.quantity}`;
      }).join('&');
        const response = await fetch("https://api.stripe.com/v1/payment_links", {
          method: "POST",
          headers: {
            Authorization: `Bearer SECRET KEY`,
            "Content-Type": "application/x-www-form-urlencoded",
          },
          body: `allow_promotion_codes=true&${bodyData}&success_url=${encodeURIComponent(successUrl)}&cancel_url=${encodeURIComponent(cancelUrl)}`,
        });

leaden gorge
#

And what error did you get?

tight rampart
leaden gorge
tight rampart
# leaden gorge Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://...

parameter_unknown - success_url
Received unknown parameters: success_url, cancel_url

Was this useful?

Yes

No
{
"allow_promotion_codes": "true",
"cancel_url": "https://x822fj.csb.app/logindashboard.html?status=failed",
"line_items": {
"0": {
"price": "price_1Pq4fGBz5J8GQjjcNKL3jppK",
"quantity": "1"
}
},
"success_url": "https://x822fj.csb.app/loadingpage.html?status=success"
}
Response body
{
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameters: success_url, cancel_url",
"param": "success_url",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_C4HsOuR8lNjSCL?t=1724385645",
"type": "invalid_request_error"
}
}
Request POST body
{
"allow_promotion_codes": "true",
"cancel_url": "https://x822fj.csb.app/logindashboard.html?status=failed",
"line_items": {
"0": {
"price": "price_1Pq4fGBz5J8GQjjcNKL3jppK",
"quantity": "1"
}
},
"success_url": "https://x822fj.csb.app/loadingpage.html?status=success"
}

Learn more about error codes and how to resolve them.

#

idk if thats what u need

leaden gorge
tight rampart
leaden gorge
#

Can you tell me what you want to achieve so that I can advise most suitable solution for you?