#bhanu365
1 messages · Page 1 of 1 (latest)
I have tested with new customer as well but getting same issue
in_1M4tDEFmM52WOkSoLW38ZMlM
Hi there, did you pass in the coupon when you create the subscription?
Yes but it's applied on upcoming invoice not the purchase one
As you can see in the screenshot
https://dashboard.stripe.com/test/logs/req_qiXJxGW1wWWdpM I don't see a coupon in this subscription creation request.
https://dashboard.stripe.com/test/logs/req_hQVzLkhgTnmfVy You only added the coupon a few seconds later. But at this moment the first invoice is already generated(without coupon discounts)
I have used the coupon on subscription update
Because we are validating the coupon code on our side
Then that subscription is paid using the payment element
Like this
You applied the coupon after the first invoice, and that's why it's only effective in the upcoming invoice.
Can I update the coupon in the subscription that I selected before the invoice is paid?
When a customer applies the coupon code in the input field and do validate it then we are calling the stripe request of subscription update.
\Stripe\Subscription::update(
$this->temp_subscription_id,
[
'coupon' => $this->voucher->voucher_code,
]
);
You should pass in the coupon when creating the subscription, so that it can be effective in the first invoice it generates https://stripe.com/docs/api/subscriptions/create?lang=ruby#create_subscription-coupon
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is this a question?
https://dashboard.stripe.com/test/logs/req_qiXJxGW1wWWdpM Based on the log, you didn't pass in the coupon when creating the subscription.
And that's why it's not applied to the first invoice.