#Chaithedesigner
1 messages · Page 1 of 1 (latest)
Hi, let me help you with this.
I need its urgent my some customer are waiting for payment
I have added promotion code in my dashboard but its showing wrong promotion code
I see that it's your own website, I don't know how it works. What is your code doing exactly?
no its sending promotion code to the stripe api to create checkout link
const discounts: Array<Stripe.Checkout.SessionCreateParams.Discount> = [];
if (paymentRedirectDto.coupon_code || paymentRedirectDto.promo_code) {
// Add the coupon to discounts array
const couponDiscount: Stripe.Checkout.SessionCreateParams.Discount = {};
if (paymentRedirectDto.coupon_code) {
couponDiscount.coupon = paymentRedirectDto.coupon_code;
}
if (paymentRedirectDto.promo_code) {
couponDiscount.promotion_code = paymentRedirectDto.promo_code;
}
discounts.push(couponDiscount);
}
const session = await stripe.checkout.sessions.create({
line_items: line_items,
mode: paymentRedirectDto.mode,
customer_email: paymentRedirectDto.customer_email,
success_url: paymentRedirectDto.success_url,
cancel_url: paymentRedirectDto.cancel_url,
discounts: discounts,
metadata: {
organizationId: paymentRedirectDto.workspaceId,
subscriptionType: paymentRedirectDto.subsribtionType,
editors: paymentRedirectDto.NumberOfEditor,
viewers: paymentRedirectDto.NumberOfViewers,
email: user.email,
companyName: user.companyName,
userId: user.id,
},
});
we are stripe paid customer actaully , I am their developer. We are introducing promo code in our payment now
Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Do you have the ID of this Promo Code?
promo_1ONBJQE67rQ5743AUZsQSMwq
You will have to use the ID there.
You can find it by the code, and then apply to Subscription using ID: https://stripe.com/docs/api/promotion_codes/list#list_promotion_code-code