#.letscode
1 messages · Page 1 of 1 (latest)
Hi there!
Can you delete your message/screenshots from the main channel and past them here instead?
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
Can you share the subscription ID (sub_xxx)?
sub_1NYQ9eFG3Dh3H5V4LLvv3Hhw
"schedule":"sub_sched_1NYQEhFG3Dh3H5V4vKAqsbjj"
schedule object showing while pring subscription as json
Thanks, I confirm that this subscription has a schedule. Looking into this.
Which version of stripe-java are you using?
checking
<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>22.0.0</version>
</dependency>
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