#jonas_payment-links-promocode
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/1242142917766811850
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Did you create the payment link with promotion codes enabled?
Well i wasnt sure the feature works all together since the example in the demo didnt do
How did you create the Payment Link
Right now it's like this in Google Appscript:
const flattenedLineItems = Object.assign({}, ...lineItems);
//flattenedLineItems["success_url"] = "https://mymun.com"
//flattenedLineItems[metadata[discounts[0][coupon]]] = discount["id"].toString();
flattenedLineItems[metadata[description]] = "Payment for "+interfaceSheet.getRange("I9").getValue();
flattenedLineItems[payment_intent_data[description]] = "Payment for "+interfaceSheet.getRange("I9").getValue();
const { url } = this.postData("https://api.stripe.com/v1/payment_links", flattenedLineItems);
How would I enable the promotion codes?
You are going to need to create the Payment LInk with the allow_promotion_codes parameter set to true
https://docs.stripe.com/api/payment_links/payment_links/create#create_payment_link-allow_promotion_codes
awesome. That did the trick
Great ๐ Happy to help
thanks