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

Upgrade to new API version 2019-10-08 #853

Merged
merged 3 commits into from
Oct 9, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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.67.0
- STRIPE_MOCK_VERSION=0.68.0

matrix:
include:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/Stripe.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public abstract class Stripe {
public static final int DEFAULT_CONNECT_TIMEOUT = 30 * 1000;
public static final int DEFAULT_READ_TIMEOUT = 80 * 1000;

public static final String API_VERSION = "2019-09-09";
public static final String API_VERSION = "2019-10-08";
public static final String CONNECT_API_BASE = "https://connect.stripe.com";
public static final String LIVE_API_BASE = "https://api.stripe.com";
public static final String UPLOAD_API_BASE = "https://files.stripe.com";
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,13 @@ public static class BusinessProfile extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Capabilities extends StripeObject {
/**
* The status of the card issuing capability of the account, or whether you can use Issuing to
* distribute funds on cards.
*/
@SerializedName("card_issuing")
String cardIssuing;

/**
* The status of the card payments capability of the account, or whether the account can
* directly process credit and debit card charges.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
gson.getDelegateAdapter(this, TypeToken.get(Refund.class));
final TypeAdapter<ReserveTransaction> reserveTransactionAdapter =
gson.getDelegateAdapter(this, TypeToken.get(ReserveTransaction.class));
final TypeAdapter<TaxDeductedAtSource> taxDeductedAtSourceAdapter =
gson.getDelegateAdapter(this, TypeToken.get(TaxDeductedAtSource.class));
final TypeAdapter<Topup> topupAdapter =
gson.getDelegateAdapter(this, TypeToken.get(Topup.class));
final TypeAdapter<Transfer> transferAdapter =
Expand Down Expand Up @@ -91,6 +93,8 @@ public BalanceTransactionSource read(JsonReader in) throws IOException {
objectResult = refundAdapter.fromJsonTree(object);
} else if ("reserve_transaction".equals(objectType)) {
objectResult = reserveTransactionAdapter.fromJsonTree(object);
} else if ("tax_deducted_at_source".equals(objectType)) {
objectResult = taxDeductedAtSourceAdapter.fromJsonTree(object);
} else if ("topup".equals(objectType)) {
objectResult = topupAdapter.fromJsonTree(object);
} else if ("transfer".equals(objectType)) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ final class EventDataClassLookup {
classLookup.put("subscription", Subscription.class);
classLookup.put("subscription_item", SubscriptionItem.class);
classLookup.put("subscription_schedule", SubscriptionSchedule.class);
classLookup.put("tax_deducted_at_source", TaxDeductedAtSource.class);
classLookup.put("tax_id", TaxId.class);
classLookup.put("tax_rate", TaxRate.class);
classLookup.put("three_d_secure", ThreeDSecure.class);
Expand Down
20 changes: 8 additions & 12 deletions src/main/java/com/stripe/model/PaymentSourceCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ public PaymentSource retrieve(
*
* <p>If the card’s owner has no default card, then the new card will become the default. However,
* if the owner already has a default, then it will not change. To change the default, you should
* either <a href="/docs/api#update_customer">update the customer</a> to have a new <code>
* default_source</code>, or <a href="/docs/api#update_recipient">update the recipient</a> to have
* a new <code>default_card</code>.
* <a href="/docs/api#update_customer">update the customer</a> to have a new <code>default_source
* </code>.
*/
public PaymentSource create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
Expand All @@ -90,9 +89,8 @@ public PaymentSource create(Map<String, Object> params) throws StripeException {
*
* <p>If the card’s owner has no default card, then the new card will become the default. However,
* if the owner already has a default, then it will not change. To change the default, you should
* either <a href="/docs/api#update_customer">update the customer</a> to have a new <code>
* default_source</code>, or <a href="/docs/api#update_recipient">update the recipient</a> to have
* a new <code>default_card</code>.
* <a href="/docs/api#update_customer">update the customer</a> to have a new <code>default_source
* </code>.
*/
public PaymentSource create(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand All @@ -107,9 +105,8 @@ public PaymentSource create(Map<String, Object> params, RequestOptions options)
*
* <p>If the card’s owner has no default card, then the new card will become the default. However,
* if the owner already has a default, then it will not change. To change the default, you should
* either <a href="/docs/api#update_customer">update the customer</a> to have a new <code>
* default_source</code>, or <a href="/docs/api#update_recipient">update the recipient</a> to have
* a new <code>default_card</code>.
* <a href="/docs/api#update_customer">update the customer</a> to have a new <code>default_source
* </code>.
*/
public PaymentSource create(PaymentSourceCollectionCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
Expand All @@ -121,9 +118,8 @@ public PaymentSource create(PaymentSourceCollectionCreateParams params) throws S
*
* <p>If the card’s owner has no default card, then the new card will become the default. However,
* if the owner already has a default, then it will not change. To change the default, you should
* either <a href="/docs/api#update_customer">update the customer</a> to have a new <code>
* default_source</code>, or <a href="/docs/api#update_recipient">update the recipient</a> to have
* a new <code>default_card</code>.
* <a href="/docs/api#update_customer">update the customer</a> to have a new <code>default_source
* </code>.
*/
public PaymentSource create(PaymentSourceCollectionCreateParams params, RequestOptions options)
throws StripeException {
Expand Down
17 changes: 10 additions & 7 deletions src/main/java/com/stripe/model/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,6 @@ public static class JapanAddress extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Relationship extends StripeObject {
/**
* Whether the person opened the account. This person provides information about themselves, and
* general information about the account.
*/
@SerializedName("account_opener")
Boolean accountOpener;

/**
* Whether the person is a director of the account's legal entity. Currently only required for
* accounts in the EU. Directors are typically members of the governing board of the company, or
Expand All @@ -292,6 +285,16 @@ public static class Relationship extends StripeObject {
@SerializedName("percent_ownership")
BigDecimal percentOwnership;

/**
* Whether the person is authorized as the primary representative of the account. This is the
* person nominated by the business to provide information about themselves, and general
* information about the account. There can only be one representative at any given time. At the
* time the account is created, this person should be set to the person responsible for opening
* the account.
*/
@SerializedName("representative")
Boolean representative;

/** The person's title (e.g., CEO, Support Engineer). */
@SerializedName("title")
String title;
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/com/stripe/model/TaxDeductedAtSource.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class TaxDeductedAtSource extends StripeObject implements BalanceTransactionSource {
/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/** String representing the object's type. Objects of the same type share the same value. */
@SerializedName("object")
String object;

/**
* The end of the invoicing period. This TDS applies to Stripe fees collected during this
* invoicing period.
*/
@SerializedName("period_end")
Long periodEnd;

/**
* The start of the invoicing period. This TDS applies to Stripe fees collected during this
* invoicing period.
*/
@SerializedName("period_start")
Long periodStart;

/** The TAN that was supplied to Stripe when TDS was assessed. */
@SerializedName("tax_deduction_account_number")
String taxDeductionAccountNumber;
}
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/model/issuing/Dispute.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class Dispute extends ApiResource implements HasId, MetadataStore<Dispute
@SerializedName("reason")
String reason;

/** Current status of dispute. One of `unsubmitted`, `under_review`, `won`, or `lost`. */
/** Current status of dispute. One of `lost`, `under_review`, `unsubmitted`, or `won`. */
@SerializedName("status")
String status;

Expand Down
44 changes: 22 additions & 22 deletions src/main/java/com/stripe/param/AccountPersonsParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,6 @@ public Builder setStartingAfter(String startingAfter) {
}

public static class Relationship {
/**
* A filter on the list of people returned based on whether these people are the account opener
* of the account's company.
*/
@SerializedName("account_opener")
Boolean accountOpener;

/**
* A filter on the list of people returned based on whether these people are directors of the
* account's company.
Expand Down Expand Up @@ -227,26 +220,31 @@ public static class Relationship {
@SerializedName("owner")
Boolean owner;

/**
* A filter on the list of people returned based on whether these people are the representative
* of the account's company.
*/
@SerializedName("representative")
Boolean representative;

private Relationship(
Boolean accountOpener,
Boolean director,
Boolean executive,
Map<String, Object> extraParams,
Boolean owner) {
this.accountOpener = accountOpener;
Boolean owner,
Boolean representative) {
this.director = director;
this.executive = executive;
this.extraParams = extraParams;
this.owner = owner;
this.representative = representative;
}

public static Builder builder() {
return new Builder();
}

public static class Builder {
private Boolean accountOpener;

private Boolean director;

private Boolean executive;
Expand All @@ -255,19 +253,12 @@ public static class Builder {

private Boolean owner;

private Boolean representative;

/** Finalize and obtain parameter instance from this builder. */
public Relationship build() {
return new Relationship(
this.accountOpener, this.director, this.executive, this.extraParams, this.owner);
}

/**
* A filter on the list of people returned based on whether these people are the account
* opener of the account's company.
*/
public Builder setAccountOpener(Boolean accountOpener) {
this.accountOpener = accountOpener;
return this;
this.director, this.executive, this.extraParams, this.owner, this.representative);
}

/**
Expand Down Expand Up @@ -322,6 +313,15 @@ public Builder setOwner(Boolean owner) {
this.owner = owner;
return this;
}

/**
* A filter on the list of people returned based on whether these people are the
* representative of the account's company.
*/
public Builder setRepresentative(Boolean representative) {
this.representative = representative;
return this;
}
}
}
}
10 changes: 6 additions & 4 deletions src/main/java/com/stripe/param/PayoutCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public class PayoutCreateParams extends ApiRequestParams {
Method method;

/**
* The source balance to draw this payout from. Balances for different payment sources are kept
* separately. You can find the amounts with the balances API. One of `bank_account` or `card`.
* The balance type of your Stripe balance to draw this payout from. Balances for different
* payment sources are kept separately. You can find the amounts with the balances API. One of
* `bank_account` or `card`.
*/
@SerializedName("source_type")
SourceType sourceType;
Expand Down Expand Up @@ -257,8 +258,9 @@ public Builder setMethod(Method method) {
}

/**
* The source balance to draw this payout from. Balances for different payment sources are kept
* separately. You can find the amounts with the balances API. One of `bank_account` or `card`.
* The balance type of your Stripe balance to draw this payout from. Balances for different
* payment sources are kept separately. You can find the amounts with the balances API. One of
* `bank_account` or `card`.
*/
public Builder setSourceType(SourceType sourceType) {
this.sourceType = sourceType;
Expand Down
Loading