#surajpatidar

1 messages · Page 1 of 1 (latest)

clear sinewBOT
normal vortex
#

how to set coupon use customer once time only

#

how to apply promotion code on subscription create time ?

nimble barn
#

Hi, I believe you have asked the same question before. The answer is you would want to implement in your own system to restricts the coupon one time per customer, and you can't specify Promotion code on Subscription start

normal vortex
#

so which code i will share with customer

#

coupon id ?

nimble barn
#

You share the Promotion Code to the customer, that's correct. But customer will be the one to input that code into an UI

#

ie. into Checkout Session page

normal vortex
#

okay means promotion code only use in checkout right ?

#

in my checkout ui Promotion Code UI Not showing

nimble barn
#

Did you pass allow_promotion_codes when you create the Checkout Session?

normal vortex
#
            expires_at=int(time.time()) + settings.STRIPE_CHECKOUT_SESSION_EXPIRE,
            payment_method_types=["card"],
            customer=stripe_customer.id,
            line_items=[
                {
                    "price_data": {
                        "currency": "usd",
                        "unit_amount": int(total * 100),
                        "product_data": {
                            "name": product.title,
                            "description": product.description,
                        },
                    },
                    "quantity": 1,
                }
            ],
            invoice_creation={
                "enabled": True,
            },
            metadata={"order_id": order.id, "type": "order"},
            mode="payment",
            success_url=f"{prefix}{settings.HOST_NAME}/order/checkout/success",
            cancel_url=f"{prefix}{settings.HOST_NAME}/order/checkout/cancel/",
        )```
#

where i can add this ?

nimble barn
#
mode="payment",
allow_promotion_codes=True,
...
normal vortex
#

XOW54FMZ
i have this promotion code but it show invalied

nimble barn
normal vortex
#

PROMO1NFCK1ECJUF37LWXJZVYI99S

normal vortex
#

PROMO1NFCK1ECJUF37LWXJZVYI99S

Apply
This code is invalid.

#

i have apply promotion code and coupon code but both show invalid

nimble barn
#

No I mean the request log which you created the promotion code. req_xxx

#

Not the actual value

#

Can you share you account id? acct_xxx

normal vortex
#

acct_1MxqqUECJUF37lWX

nimble barn
#

Can you try to input 67HA1ZL3 instead?

normal vortex
#

all show invalid

nimble barn
#

Can you share the Checkout URL here?

nimble barn
#

Can't access it anymore. Can you create another page?

nimble barn
#

This CheckoutSession, you created with cus_NjZVa9XGxohLC6 which has a lot of successful payment before

#

You can create Promotion Code but without the first_time_transaction restriction above

#

Uncheck the first checkbox here

normal vortex
#

okay

#

so in stripe checkout page how to check customer reedme code or not ?

#

i want like that if customer XYZ code use then second time he can't use

nimble barn
#

Like I said, that's a different thing we don't currently support right now, in Checkout Session, unfortunately

normal vortex
#

it imp things

#

i think you need to add this features

#

it possible to create my customer model under the stripe and work on that model ?

nimble barn
#

I will forward your feedback! But sorry if you really want it you would want to implement your own system to check the coupon usage per customer, and then build your own UI to accept the coupon code (aka move away from Checkout)