#khushboo

1 messages · Page 1 of 1 (latest)

muted starBOT
topaz garnet
#

Hi there!

#

How are you creating the coupon? With the dashboard or the API?

tacit moth
#

dashboard

topaz garnet
#

In the dashboard I see this when creating a new coupon:

tacit moth
#

Yes , I have added from here but it is not working properly, This is working for all products.

topaz garnet
#

Can you share an example where it's not working?

tacit moth
#

Sure

tacit moth
# topaz garnet Can you share an example where it's not working?

We have two product membership product and strorage product
and i have created coupon for membership product.

The problem we are facing that we are able to use that coupon for storage product as well , While we have created coupon only membership product.

topaz garnet
#

The problem we are facing that we are able to use that coupon for storage product as well
Can you give me a concrete example? Like a Checkout Session ID or Subscription ID where you used a coupon and it was applied to two products?

tacit moth
topaz garnet
#

Thanks! Give me a few minutes to look into this.

topaz garnet
tacit moth
topaz garnet
#

There's no error message. Stripe just ignored the promo code you passed since it doesn't apply to the product.

tacit moth
#

Okay, Thank you for your help!

#

Is there any way to know which coupon is applicable on that product ?

topaz garnet
tacit moth
# topaz garnet What do you mean? If you retrieve the coupon with the API, you can see the produ...

I mean how do i know how many products are there on this coupon.

I tried this-
$couponCheck = Stripe\Coupon::retrieve($couponCode,['expand' => ['applies_to.products']]);

Stripe\Coupon Object
(
[id] => Discount23
[object] => coupon
[amount_off] =>
[created] => 1672319227
[currency] =>
[duration] => forever
[duration_in_months] =>
[livemode] =>
[max_redemptions] => 100
[metadata] => Stripe\StripeObject Object
(
)

[name] => 100%DiscountCoupon
[percent_off] => 100
[redeem_by] => 
[times_redeemed] => 1
[valid] => 1

)

undone kraken
#

Can you send me your account ID so I can check in to this coupon?

tacit moth
undone kraken
#

Account ID, (acct_123)

#

Unfortunately I can't look up that coupon by its user facing code

tacit moth
#

I just want to know is there any way that i can know how many product are applied on this coupons ?

undone kraken
#

The call that you are making looks like it should work, because it isn't I am wondering if this has something to do with how the coupon is configured

tacit moth
tacit moth
undone kraken
#

In the API or the dashboard?

tacit moth
#

API

tacit moth
# undone kraken In the API or the dashboard?

Getting this response -

Stripe\Coupon Object
(
[id] => Discount23
[object] => coupon
[amount_off] =>
[created] => 1672319227
[currency] =>
[duration] => forever
[duration_in_months] =>
[livemode] =>
[max_redemptions] => 100
[metadata] => Stripe\StripeObject Object
(
)

[name] => 100%DiscountCoupon
[percent_off] => 100
[redeem_by] => 
[times_redeemed] => 1
[valid] => 1

)

could not find the details of the product in it

undone kraken
#

Sorry the server got really busy and I got pulled away from looking in to this one. Checking now

undone kraken
tacit moth
undone kraken
#

I hope this isn't the issue but can you try passing 'applies_to' without .products?

#

Just to see if that returns things and the API is being finnicky?

tacit moth
# undone kraken I hope this isn't the issue but can you try passing `'applies_to'` without `.pro...

Yes i did
Stripe\Coupon::retrieve('Discount23',['expand' => ['applies_to']]);

But still getting same response . Where is going wrong please guide us .

Stripe\Coupon Object
(
[id] => Discount23
[object] => coupon
[amount_off] =>
[created] => 1672319227
[currency] =>
[duration] => forever
[duration_in_months] =>
[livemode] =>
[max_redemptions] => 100
[metadata] => Stripe\StripeObject Object
(
)

[name] => 100%DiscountCoupon
[percent_off] => 100
[redeem_by] => 
[times_redeemed] => 1
[valid] => 1

)

undone kraken
#

I wonder if it is the version of the PHP library you are using though that shouldn't affect this as far as I know. Checking in to that

tacit moth
#

Ok

undone kraken
#

Looks like you should be fine there.

Can you try the cURL command and see if this info comes back in the raw response?

  -u sk_test_1234: \
  -d "expand[]"="applies_to" \