#dingkai031
1 messages · Page 1 of 1 (latest)
Hi there, the invoice.paid event is fired for the first invoice and also subsequence invoices.
yes, but can we differentiate it?
I need to do something different between the first and the recurring
yes. the first invoice will have the same value for period_start and period_end
ah I see, thank you
Hi I have try it, and inside the invoice.paid event.. I fetch data from $event->data->object->period_start and $event->data->object->period_end. For the first and second invoice has still the same value.
Can you share with me the subscription ID>
I saw you've updated your subscription to a new price.
and that's why the 2nd invoice 's period_start and period_end are the same
yes, I was updating the subscription into subscription schedule when the first invoice is paid. Is there a way to check if the current subscription is on subscription schedule or not? because I also realize that everytime invoice.paid triggered it try to update the subscription schedule into another subscription schedule, thus giving a migration error message
Uncaught (Status 400) (Request req_4JJJJi1bhw4Xvn) You cannot migrate a subscription that is already attached to a schedule: `sub_sched_1MivP1BBuNcFsmgMLlb0Tuap
how to check if the subscription is attached to a schedule or not?