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

Multiple breaking API changes while removing deprecated Issuing features #1009

Merged
merged 2 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ before_install:
env:
global:
# If changing this number, please also change it in `BaseStripeTest.java`.
- STRIPE_MOCK_VERSION=0.83.0
- STRIPE_MOCK_VERSION=0.87.0

matrix:
include:
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -1130,10 +1130,6 @@ public static class AchDebit extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AcssDebit extends StripeObject {
/** Two-letter ISO code representing the country the bank account is located in. */
@SerializedName("country")
String country;

/**
* Uniquely identifies this particular bank account. You can use this attribute to check
* whether two bank accounts are the same.
Expand All @@ -1144,10 +1140,6 @@ public static class AcssDebit extends StripeObject {
/** Last four digits of the bank account number. */
@SerializedName("last4")
String last4;

/** Routing transit number of the bank account. */
@SerializedName("routing_number")
String routingNumber;
}

@Getter
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ final class EventDataClassLookup {

classLookup.put("issuing.authorization", com.stripe.model.issuing.Authorization.class);
classLookup.put("issuing.card", com.stripe.model.issuing.Card.class);
classLookup.put("issuing.card_details", com.stripe.model.issuing.CardDetails.class);
classLookup.put("issuing.cardholder", com.stripe.model.issuing.Cardholder.class);
classLookup.put("issuing.dispute", com.stripe.model.issuing.Dispute.class);
classLookup.put("issuing.transaction", com.stripe.model.issuing.Transaction.class);
Expand Down
31 changes: 30 additions & 1 deletion src/main/java/com/stripe/model/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public class Subscription extends ApiResource implements HasId, MetadataStore<Su
* and the ID of the resulting transfers will be found on the resulting charges.
*/
@SerializedName("transfer_data")
Invoice.TransferData transferData;
TransferData transferData;

/** If the subscription has a trial, the end of that trial. */
@SerializedName("trial_end")
Expand Down Expand Up @@ -818,4 +818,33 @@ public static class PendingUpdate extends StripeObject {
@SerializedName("trial_from_plan")
Boolean trialFromPlan;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class TransferData extends StripeObject {
/** The account where funds from the payment will be transferred to upon payment success. */
@SerializedName("destination")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Account> destination;

/** Get ID of expandable {@code destination} object. */
public String getDestination() {
return (this.destination != null) ? this.destination.getId() : null;
}

public void setDestination(String id) {
this.destination = ApiResource.setExpandableFieldId(id, this.destination);
}

/** Get expanded {@code destination}. */
public Account getDestinationObject() {
return (this.destination != null) ? this.destination.getExpanded() : null;
}

public void setDestinationObject(Account expandableObject) {
this.destination = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
}
}
}
24 changes: 0 additions & 24 deletions src/main/java/com/stripe/model/SubscriptionSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ public class SubscriptionSchedule extends ApiResource
@SerializedName("released_subscription")
String releasedSubscription;

/**
* This field has been deprecated. Interval and duration at which the subscription schedule renews
* for when it ends if {@code renewal_behavior} is {@code renew}.
*/
@SerializedName("renewal_interval")
RenewalInterval renewalInterval;

/**
* The present status of the subscription schedule. Possible values are {@code not_started},
* {@code active}, {@code completed}, {@code released}, and {@code canceled}. You can read more
Expand Down Expand Up @@ -728,21 +721,4 @@ public void setPlanObject(Plan expandableObject) {
this.plan = new ExpandableField<Plan>(expandableObject.getId(), expandableObject);
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class RenewalInterval extends StripeObject {
/**
* Interval at which to renew the subscription schedule for when it ends.
*
* <p>One of {@code day}, {@code month}, {@code week}, or {@code year}.
*/
@SerializedName("interval")
String interval;

/** Number of intervals to renew the subscription schedule for when it ends. */
@SerializedName("length")
Long length;
}
}
7 changes: 0 additions & 7 deletions src/main/java/com/stripe/model/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ public class Token extends ApiResource implements HasId {
@SerializedName("created")
Long created;

/**
* Email of the user, whose token is created during Stripe Checkout. This field is non-standard,
* and maybe removed in the future.
*/
@SerializedName("email")
String email;

/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
Expand Down