Skip to content

Multiple API changes #1143

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

Merged
merged 1 commit into from
Oct 26, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/com/stripe/model/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public class Subscription extends ApiResource implements HasId, MetadataStore<Su

/**
* If the subscription has been canceled, the date of that cancellation. If the subscription was
* canceled with {@code cancel_at_period_end}, {@code canceled_at} will still reflect the date of
* the initial cancellation request, not the end of the subscription period when the subscription
* is automatically moved to a canceled state.
* canceled with {@code cancel_at_period_end}, {@code canceled_at} will reflect the time of the
* most recent update request, not the end of the subscription period when the subscription is
* automatically moved to a canceled state.
*/
@SerializedName("canceled_at")
Long canceledAt;
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/com/stripe/param/PaymentIntentConfirmParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -2990,6 +2990,14 @@ public enum PreferredLanguage implements ApiRequestParams.EnumParam {

@Getter
public static class Card {
/**
* A single-use {@code cvc_update} Token that represents a card CVC value. When provided, the
* CVC value will be verified during the card payment attempt. This parameter can only be
* provided during confirmation.
*/
@SerializedName("cvc_token")
String cvcToken;

/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
Expand Down Expand Up @@ -3038,11 +3046,13 @@ public static class Card {
RequestThreeDSecure requestThreeDSecure;

private Card(
String cvcToken,
Map<String, Object> extraParams,
Installments installments,
Boolean moto,
Network network,
RequestThreeDSecure requestThreeDSecure) {
this.cvcToken = cvcToken;
this.extraParams = extraParams;
this.installments = installments;
this.moto = moto;
Expand All @@ -3055,6 +3065,8 @@ public static Builder builder() {
}

public static class Builder {
private String cvcToken;

private Map<String, Object> extraParams;

private Installments installments;
Expand All @@ -3068,13 +3080,24 @@ public static class Builder {
/** Finalize and obtain parameter instance from this builder. */
public Card build() {
return new Card(
this.cvcToken,
this.extraParams,
this.installments,
this.moto,
this.network,
this.requestThreeDSecure);
}

/**
* A single-use {@code cvc_update} Token that represents a card CVC value. When provided,
* the CVC value will be verified during the card payment attempt. This parameter can only
* be provided during confirmation.
*/
public Builder setCvcToken(String cvcToken) {
this.cvcToken = cvcToken;
return this;
}

/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/com/stripe/param/PaymentIntentCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -3363,6 +3363,14 @@ public enum PreferredLanguage implements ApiRequestParams.EnumParam {

@Getter
public static class Card {
/**
* A single-use {@code cvc_update} Token that represents a card CVC value. When provided, the
* CVC value will be verified during the card payment attempt. This parameter can only be
* provided during confirmation.
*/
@SerializedName("cvc_token")
String cvcToken;

/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
Expand Down Expand Up @@ -3411,11 +3419,13 @@ public static class Card {
RequestThreeDSecure requestThreeDSecure;

private Card(
String cvcToken,
Map<String, Object> extraParams,
Installments installments,
Boolean moto,
Network network,
RequestThreeDSecure requestThreeDSecure) {
this.cvcToken = cvcToken;
this.extraParams = extraParams;
this.installments = installments;
this.moto = moto;
Expand All @@ -3428,6 +3438,8 @@ public static Builder builder() {
}

public static class Builder {
private String cvcToken;

private Map<String, Object> extraParams;

private Installments installments;
Expand All @@ -3441,13 +3453,24 @@ public static class Builder {
/** Finalize and obtain parameter instance from this builder. */
public Card build() {
return new Card(
this.cvcToken,
this.extraParams,
this.installments,
this.moto,
this.network,
this.requestThreeDSecure);
}

/**
* A single-use {@code cvc_update} Token that represents a card CVC value. When provided,
* the CVC value will be verified during the card payment attempt. This parameter can only
* be provided during confirmation.
*/
public Builder setCvcToken(String cvcToken) {
this.cvcToken = cvcToken;
return this;
}

/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/stripe/param/PaymentIntentUpdateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -2981,6 +2981,14 @@ public enum PreferredLanguage implements ApiRequestParams.EnumParam {

@Getter
public static class Card {
/**
* A single-use {@code cvc_update} Token that represents a card CVC value. When provided, the
* CVC value will be verified during the card payment attempt. This parameter can only be
* provided during confirmation.
*/
@SerializedName("cvc_token")
Object cvcToken;

/**
* Map of extra parameters for custom features not available in this client library. The
* content in this map is not serialized under this field's {@code @SerializedName} value.
Expand Down Expand Up @@ -3029,11 +3037,13 @@ public static class Card {
RequestThreeDSecure requestThreeDSecure;

private Card(
Object cvcToken,
Map<String, Object> extraParams,
Installments installments,
Boolean moto,
Network network,
RequestThreeDSecure requestThreeDSecure) {
this.cvcToken = cvcToken;
this.extraParams = extraParams;
this.installments = installments;
this.moto = moto;
Expand All @@ -3046,6 +3056,8 @@ public static Builder builder() {
}

public static class Builder {
private Object cvcToken;

private Map<String, Object> extraParams;

private Installments installments;
Expand All @@ -3059,13 +3071,34 @@ public static class Builder {
/** Finalize and obtain parameter instance from this builder. */
public Card build() {
return new Card(
this.cvcToken,
this.extraParams,
this.installments,
this.moto,
this.network,
this.requestThreeDSecure);
}

/**
* A single-use {@code cvc_update} Token that represents a card CVC value. When provided,
* the CVC value will be verified during the card payment attempt. This parameter can only
* be provided during confirmation.
*/
public Builder setCvcToken(String cvcToken) {
this.cvcToken = cvcToken;
return this;
}

/**
* A single-use {@code cvc_update} Token that represents a card CVC value. When provided,
* the CVC value will be verified during the card payment attempt. This parameter can only
* be provided during confirmation.
*/
public Builder setCvcToken(EmptyParam cvcToken) {
this.cvcToken = cvcToken;
return this;
}

/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
Expand Down
83 changes: 83 additions & 0 deletions src/main/java/com/stripe/param/TokenCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public class TokenCreateParams extends ApiRequestParams {
@SerializedName("customer")
String customer;

/** The updated CVC value this token will represent. */
@SerializedName("cvc_update")
CvcUpdate cvcUpdate;

/** Specifies which fields in the response should be expanded. */
@SerializedName("expand")
List<String> expand;
Expand All @@ -61,6 +65,7 @@ private TokenCreateParams(
BankAccount bankAccount,
Object card,
String customer,
CvcUpdate cvcUpdate,
List<String> expand,
Map<String, Object> extraParams,
Person person,
Expand All @@ -69,6 +74,7 @@ private TokenCreateParams(
this.bankAccount = bankAccount;
this.card = card;
this.customer = customer;
this.cvcUpdate = cvcUpdate;
this.expand = expand;
this.extraParams = extraParams;
this.person = person;
Expand All @@ -88,6 +94,8 @@ public static class Builder {

private String customer;

private CvcUpdate cvcUpdate;

private List<String> expand;

private Map<String, Object> extraParams;
Expand All @@ -103,6 +111,7 @@ public TokenCreateParams build() {
this.bankAccount,
this.card,
this.customer,
this.cvcUpdate,
this.expand,
this.extraParams,
this.person,
Expand Down Expand Up @@ -144,6 +153,12 @@ public Builder setCustomer(String customer) {
return this;
}

/** The updated CVC value this token will represent. */
public Builder setCvcUpdate(CvcUpdate cvcUpdate) {
this.cvcUpdate = cvcUpdate;
return this;
}

/**
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
Expand Down Expand Up @@ -3184,6 +3199,74 @@ public Builder setNumber(String number) {
}
}

@Getter
public static class CvcUpdate {
/** The CVC value, in string form. */
@SerializedName("cvc")
String cvc;

/**
* Map of extra parameters for custom features not available in this client library. The content
* in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
* key/value pair is serialized as if the key is a root-level field (serialized) name in this
* param object. Effectively, this map is flattened to its parent instance.
*/
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map<String, Object> extraParams;

private CvcUpdate(String cvc, Map<String, Object> extraParams) {
this.cvc = cvc;
this.extraParams = extraParams;
}

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

public static class Builder {
private String cvc;

private Map<String, Object> extraParams;

/** Finalize and obtain parameter instance from this builder. */
public CvcUpdate build() {
return new CvcUpdate(this.cvc, this.extraParams);
}

/** The CVC value, in string form. */
public Builder setCvc(String cvc) {
this.cvc = cvc;
return this;
}

/**
* Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
* call, and subsequent calls add additional key/value pairs to the original map. See {@link
* TokenCreateParams.CvcUpdate#extraParams} for the field documentation.
*/
public Builder putExtraParam(String key, Object value) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.put(key, value);
return this;
}

/**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
* See {@link TokenCreateParams.CvcUpdate#extraParams} for the field documentation.
*/
public Builder putAllExtraParam(Map<String, Object> map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
}
}
}

@Getter
public static class Person {
/** The person's address. */
Expand Down