#Chaithedesigner

1 messages · Page 1 of 1 (latest)

weak scarabBOT
torn inlet
#

Hi, let me help you with this.

#

I need its urgent my some customer are waiting for payment

red sparrow
#

I have added promotion code in my dashboard but its showing wrong promotion code

torn inlet
#

I see that it's your own website, I don't know how it works. What is your code doing exactly?

red sparrow
#

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

torn inlet
red sparrow
#

req_JRUqN7f7WIRdcN

#

??

torn inlet
#

Do you have the ID of this Promo Code?

red sparrow
#

promo_1ONBJQE67rQ5743AUZsQSMwq

torn inlet
#

You will have to use the ID there.