#dingkai031

1 messages · Page 1 of 1 (latest)

boreal lindenBOT
honest carbon
#

Hi there, the invoice.paid event is fired for the first invoice and also subsequence invoices.

slow stream
#

yes, but can we differentiate it?

#

I need to do something different between the first and the recurring

honest carbon
#

yes. the first invoice will have the same value for period_start and period_end

slow stream
#

ah I see, thank you

slow stream
#

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.

honest carbon
#

Can you share with me the subscription ID>

slow stream
#

here you go sub_1MivGoBBuNcFsmgMsdYkJvOH

#

I'm using test_clock in test mode

honest carbon
#

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

slow stream
#

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?