#.letscode

1 messages · Page 1 of 1 (latest)

zinc tartanBOT
lofty bay
#

Hi there!

#

Can you delete your message/screenshots from the main channel and past them here instead?

rugged bridge
#

Subscription sub= Subscription.retrieve(subscriptionID);
if(Objects.nonNull(sub)) {
log.info("Subscription found");
log.info(""+sub.getRawJsonObject());
log.info("find SubscriptionSchedule");
SubscriptionSchedule sch = sub.getScheduleObject();
if(Objects.nonNull(sch)) {
log.info("Schedule found: "+sch.getId());
log.info(""+sch.getRawJsonObject().getAsJsonArray());
}else {
log.info("SubscriptionSchedule not found");
}
}else {
log.info("Subscription not found");
}

#

basically SubscriptionSchedule sch = sub.getScheduleObject(); retriving null even subscription is there

lofty bay
#

Can you share the subscription ID (sub_xxx)?

rugged bridge
#

sub_1NYQ9eFG3Dh3H5V4LLvv3Hhw

#

"schedule":"sub_sched_1NYQEhFG3Dh3H5V4vKAqsbjj"

#

schedule object showing while pring subscription as json

lofty bay
#

Thanks, I confirm that this subscription has a schedule. Looking into this.

#

Which version of stripe-java are you using?

zinc tartanBOT
rugged bridge
#

checking

#

<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>22.0.0</version>
</dependency>

spring ravine
#

its' expected that it's null

#

that field is null unless you use expand

#

.getSchedule() is the ID, and getScheduleObject() is the object, but only if you expanded it in the call

rugged bridge
#

what is expand? can you specify object or link or sample code

#

let me try

spring ravine
rugged bridge
#

Great.. thank you

#

it's working

#

one last question:

#

if my schedule is completed, which event will trigger in webhook

#

because i need to close, payment fully completed