Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Subscription Schedule APIs #673

Merged
merged 1 commit into from Feb 12, 2019

Conversation

remi-stripe
Copy link
Contributor

Add support for Subscription Schedule APIs

  • Add Subscription Schedule
  • Add Subscription Schedule Revisions
  • Add invoice_settings on the Customer

cc @stripe/api-libraries

@remi-stripe remi-stripe changed the title [WIP] Add support for Subscription Schedule APIs Add support for Subscription Schedule APIs Feb 12, 2019
@remi-stripe
Copy link
Contributor Author

This is now ready to be reviewed. r? @mickjermsurawong-stripe


// <editor-fold desc="cancel">
/**
* Pay a subscription schedule.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be cancel a subscription schedule?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn copy/paste and replace. Fixed all 8 of them.

import com.stripe.net.RequestOptions;
import java.util.Map;

public class SubscriptionScheduleRevisionCollection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. actually no other resource returns this collection, so we can never get an instance of this collection to make the API request (with the existing url)..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can go with the followings..
In SubscriptionSchedule.java we have
public SubscriptionScheduleRevisionCollection revisions()
Then, we remove the list method from the SubscriptionScheduleRevisionCollection.java..
I fixed my client metadata and the generated outcome looks like this..

public SubscriptionScheduleRevisionCollection revisions() throws StripeException {
return revisions((Map<String, Object>) null, (RequestOptions) null);
}
/** Retrieves the list of subscription schedule revisions for a subscription schedule. */
public SubscriptionScheduleRevisionCollection revisions(Map<String, Object> params)
throws StripeException {
return revisions(params, (RequestOptions) null);
}
/** Retrieves the list of subscription schedule revisions for a subscription schedule. */
public SubscriptionScheduleRevisionCollection revisions(
Map<String, Object> params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/subscription_schedules/%s/revisions", this.getId()));
return requestCollection(url, params, SubscriptionScheduleRevisionCollection.class, options);

I believe this is similar to account/person relationship

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickjermsurawong-stripe Nice catch, fixed!

@mickjermsurawong-stripe
Copy link
Contributor

ptal @remi-stripe just on the revision collection because it is currently not returned anywhere..

@mickjermsurawong-stripe
Copy link
Contributor

thank @remi-stripe
LGTM

@remi-stripe remi-stripe merged commit 7685422 into master Feb 12, 2019
@remi-stripe remi-stripe deleted the remi-add-subscription-schedule branch February 12, 2019 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants