Skip to content

API Updates #1182

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 2 commits into from
Feb 9, 2021
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
9 changes: 9 additions & 0 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,15 @@ public static class BusinessProfile extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Capabilities extends StripeObject {
/**
* The status of the Afterpay Clearpay capability of the account, or whether the account can
* directly process Afterpay Clearpay charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("afterpay_clearpay_payments")
String afterpayClearpayPayments;

/**
* The status of the BECS Direct Debit (AU) payments capability of the account, or whether the
* account can directly process BECS Direct Debit (AU) charges.
Expand Down
74 changes: 74 additions & 0 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@Setter(lombok.AccessLevel.NONE)
ExpandableField<PaymentIntent> paymentIntent;

@SerializedName("payment_settings")
PaymentSettings paymentSettings;

/** End of the usage period during which invoice items were added to this invoice. */
@SerializedName("period_end")
Long periodEnd;
Expand Down Expand Up @@ -1430,6 +1433,77 @@ public void setDiscountObject(Discount expandableObject) {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PaymentMethodOptions extends StripeObject {
/**
* If paying by {@code bancontact}, this sub-hash contains details about the Bancontact payment
* method options to pass to the invoice’s PaymentIntent.
*/
@SerializedName("bancontact")
Bancontact bancontact;

/**
* If paying by {@code card}, this sub-hash contains details about the Card payment method
* options to pass to the invoice’s PaymentIntent.
*/
@SerializedName("card")
Card card;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Bancontact extends StripeObject {
/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
*
* <p>One of {@code de}, {@code en}, {@code fr}, or {@code nl}.
*/
@SerializedName("preferred_language")
String preferredLanguage;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Card extends StripeObject {
/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your
* customers for authentication based on risk level and <a
* href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
* However, if you wish to request 3D Secure based on logic from your own fraud engine,
* provide this option. Read our guide on <a
* href="https://stripe.com/docs/payments/3d-secure#manual-three-ds">manually requesting 3D
* Secure</a> for more information on how this configuration interacts with Radar and our SCA
* Engine.
*
* <p>One of {@code any}, or {@code automatic}.
*/
@SerializedName("request_three_d_secure")
String requestThreeDSecure;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PaymentSettings extends StripeObject {
/** Payment-method-specific configuration to provide to the invoice’s PaymentIntent. */
@SerializedName("payment_method_options")
PaymentMethodOptions paymentMethodOptions;

/**
* The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If
* not set, Stripe attempts to automatically determine the types to use by looking at the
* invoice’s default payment method, the subscription’s default payment method, the customer’s
* default payment method, and your <a
* href="https://dashboard.stripe.com/settings/billing/invoice">invoice template settings</a>.
*/
@SerializedName("payment_method_types")
List<String> paymentMethodTypes;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
94 changes: 94 additions & 0 deletions src/main/java/com/stripe/param/AccountCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,10 @@ public Builder setState(String state) {

@Getter
public static class Capabilities {
/** The afterpay_clearpay_payments capability. */
@SerializedName("afterpay_clearpay_payments")
AfterpayClearpayPayments afterpayClearpayPayments;

/** The au_becs_debit_payments capability. */
@SerializedName("au_becs_debit_payments")
AuBecsDebitPayments auBecsDebitPayments;
Expand Down Expand Up @@ -908,6 +912,7 @@ public static class Capabilities {
Transfers transfers;

private Capabilities(
AfterpayClearpayPayments afterpayClearpayPayments,
AuBecsDebitPayments auBecsDebitPayments,
BacsDebitPayments bacsDebitPayments,
BancontactPayments bancontactPayments,
Expand All @@ -929,6 +934,7 @@ private Capabilities(
TaxReportingUs1099K taxReportingUs1099K,
TaxReportingUs1099Misc taxReportingUs1099Misc,
Transfers transfers) {
this.afterpayClearpayPayments = afterpayClearpayPayments;
this.auBecsDebitPayments = auBecsDebitPayments;
this.bacsDebitPayments = bacsDebitPayments;
this.bancontactPayments = bancontactPayments;
Expand Down Expand Up @@ -957,6 +963,8 @@ public static Builder builder() {
}

public static class Builder {
private AfterpayClearpayPayments afterpayClearpayPayments;

private AuBecsDebitPayments auBecsDebitPayments;

private BacsDebitPayments bacsDebitPayments;
Expand Down Expand Up @@ -1002,6 +1010,7 @@ public static class Builder {
/** Finalize and obtain parameter instance from this builder. */
public Capabilities build() {
return new Capabilities(
this.afterpayClearpayPayments,
this.auBecsDebitPayments,
this.bacsDebitPayments,
this.bancontactPayments,
Expand All @@ -1025,6 +1034,13 @@ public Capabilities build() {
this.transfers);
}

/** The afterpay_clearpay_payments capability. */
public Builder setAfterpayClearpayPayments(
AfterpayClearpayPayments afterpayClearpayPayments) {
this.afterpayClearpayPayments = afterpayClearpayPayments;
return this;
}

/** The au_becs_debit_payments capability. */
public Builder setAuBecsDebitPayments(AuBecsDebitPayments auBecsDebitPayments) {
this.auBecsDebitPayments = auBecsDebitPayments;
Expand Down Expand Up @@ -1172,6 +1188,84 @@ public Builder setTransfers(Transfers transfers) {
}
}

@Getter
public static class AfterpayClearpayPayments {
/**
* 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;

/**
* Passing true requests the capability for the account, if it is not already requested. A
* requested capability may not immediately become active. Any requirements to activate the
* capability are returned in the {@code requirements} arrays.
*/
@SerializedName("requested")
Boolean requested;

private AfterpayClearpayPayments(Map<String, Object> extraParams, Boolean requested) {
this.extraParams = extraParams;
this.requested = requested;
}

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

public static class Builder {
private Map<String, Object> extraParams;

private Boolean requested;

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

/**
* 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 AccountCreateParams.Capabilities.AfterpayClearpayPayments#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 AccountCreateParams.Capabilities.AfterpayClearpayPayments#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;
}

/**
* Passing true requests the capability for the account, if it is not already requested. A
* requested capability may not immediately become active. Any requirements to activate the
* capability are returned in the {@code requirements} arrays.
*/
public Builder setRequested(Boolean requested) {
this.requested = requested;
return this;
}
}
}

@Getter
public static class AuBecsDebitPayments {
/**
Expand Down
94 changes: 94 additions & 0 deletions src/main/java/com/stripe/param/AccountUpdateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ public Builder setState(EmptyParam state) {

@Getter
public static class Capabilities {
/** The afterpay_clearpay_payments capability. */
@SerializedName("afterpay_clearpay_payments")
AfterpayClearpayPayments afterpayClearpayPayments;

/** The au_becs_debit_payments capability. */
@SerializedName("au_becs_debit_payments")
AuBecsDebitPayments auBecsDebitPayments;
Expand Down Expand Up @@ -1001,6 +1005,7 @@ public static class Capabilities {
Transfers transfers;

private Capabilities(
AfterpayClearpayPayments afterpayClearpayPayments,
AuBecsDebitPayments auBecsDebitPayments,
BacsDebitPayments bacsDebitPayments,
BancontactPayments bancontactPayments,
Expand All @@ -1022,6 +1027,7 @@ private Capabilities(
TaxReportingUs1099K taxReportingUs1099K,
TaxReportingUs1099Misc taxReportingUs1099Misc,
Transfers transfers) {
this.afterpayClearpayPayments = afterpayClearpayPayments;
this.auBecsDebitPayments = auBecsDebitPayments;
this.bacsDebitPayments = bacsDebitPayments;
this.bancontactPayments = bancontactPayments;
Expand Down Expand Up @@ -1050,6 +1056,8 @@ public static Builder builder() {
}

public static class Builder {
private AfterpayClearpayPayments afterpayClearpayPayments;

private AuBecsDebitPayments auBecsDebitPayments;

private BacsDebitPayments bacsDebitPayments;
Expand Down Expand Up @@ -1095,6 +1103,7 @@ public static class Builder {
/** Finalize and obtain parameter instance from this builder. */
public Capabilities build() {
return new Capabilities(
this.afterpayClearpayPayments,
this.auBecsDebitPayments,
this.bacsDebitPayments,
this.bancontactPayments,
Expand All @@ -1118,6 +1127,13 @@ public Capabilities build() {
this.transfers);
}

/** The afterpay_clearpay_payments capability. */
public Builder setAfterpayClearpayPayments(
AfterpayClearpayPayments afterpayClearpayPayments) {
this.afterpayClearpayPayments = afterpayClearpayPayments;
return this;
}

/** The au_becs_debit_payments capability. */
public Builder setAuBecsDebitPayments(AuBecsDebitPayments auBecsDebitPayments) {
this.auBecsDebitPayments = auBecsDebitPayments;
Expand Down Expand Up @@ -1265,6 +1281,84 @@ public Builder setTransfers(Transfers transfers) {
}
}

@Getter
public static class AfterpayClearpayPayments {
/**
* 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;

/**
* Passing true requests the capability for the account, if it is not already requested. A
* requested capability may not immediately become active. Any requirements to activate the
* capability are returned in the {@code requirements} arrays.
*/
@SerializedName("requested")
Boolean requested;

private AfterpayClearpayPayments(Map<String, Object> extraParams, Boolean requested) {
this.extraParams = extraParams;
this.requested = requested;
}

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

public static class Builder {
private Map<String, Object> extraParams;

private Boolean requested;

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

/**
* 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 AccountUpdateParams.Capabilities.AfterpayClearpayPayments#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 AccountUpdateParams.Capabilities.AfterpayClearpayPayments#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;
}

/**
* Passing true requests the capability for the account, if it is not already requested. A
* requested capability may not immediately become active. Any requirements to activate the
* capability are returned in the {@code requirements} arrays.
*/
public Builder setRequested(Boolean requested) {
this.requested = requested;
return this;
}
}
}

@Getter
public static class AuBecsDebitPayments {
/**
Expand Down
Loading