#Dooing-webhooks
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
yes
the status on the subscription will be trialing instead of active
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
for that I've answer yes
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();
when the next cycle comes you will get another invoice.paid event with a subscription_cycle and the subscription will then be in a status active
that's correct
I think this would only get you the id if I'm not mistaken and then you'd have to retrieve the subscription with an API call
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());
}
}
๐
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?
if that works for you then yes it's a good approach
yes ๐
ok thanks