#Dooing-webhooks

1 messages ยท Page 1 of 1 (latest)

zealous nova
#

๐Ÿ‘‹ happy to help

split adder
#

subscription_cycle
subscription_create
subscription_update
subscription
manual
upcoming
subscription_threshold

#

so which of these values will be set when a TRIAL is started? Also subscription create?

zealous nova
#

yes

#

the status on the subscription will be trialing instead of active

split adder
#

wait. My question was - so I for a trial that is started, I will also receive a "subscription_create" event?

#

will this only ever happen once / subscriptuon, or will this happen again wehn the subscription switches from trial to paid?

split adder
#

and for the invoice_paid event - I can get the stripe customer id, no problem. But can I also get the stripe subscription id, or will that be set to null?

#

Invoice stripeInvoice = (Invoice) stripeObject;
stripeInvoice.getSubscription();

zealous nova
zealous nova
split adder
#

the ip is all I want

#

I want to look up the subscription on our end, and the stripe subscription id would be the direct match

#

so I can set the subscription, on our end, from PENDING, to active, to give the customer ACESS to the platform

#

public void handle(StripeObject stripeObject) {
Invoice stripeInvoice = (Invoice) stripeObject;
if("subscription_create".equals(stripeInvoice.getBillingReason())){
subscriptionService.activateSubscription(stripeInvoice.getSubscription());
}
}

zealous nova
#

๐Ÿ‘

split adder
#

so this way, the subscription is active, as soon as the payment was 3D secure confirmed, I assume.
And the trial end does not need to be actively managed - when the customer wants to see the status of the their subscription, I would just in time retrieve the status - trial / paid.. price, name and so on, from stripe.

#

so then only I need to listen when stripe sends a cancel for the subscription, and close the subscription in a similar way then I activated it earlier, right?

zealous nova
split adder
#

ok thanks