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 API changes #1038

Merged
merged 1 commit into from
Jun 3, 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
12 changes: 12 additions & 0 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,9 @@ public static class Settings extends StripeObject {
@SerializedName("payouts")
SettingsPayouts payouts;

@SerializedName("sepa_debit_payments")
SepaDebitPayments sepaDebitPayments;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -1054,6 +1057,15 @@ public static class BacsDebitPayments extends StripeObject {
@SerializedName("display_name")
String displayName;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SepaDebitPayments extends StripeObject {
/** SEPA creditor identifier that identifies the company making the payment. */
@SerializedName("creditor_id")
String creditorId;
}
}

@Getter
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,25 @@ public static class NextActionRedirectToUrl extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PaymentMethodOptions extends StripeObject {
@SerializedName("bancontact")
Bancontact bancontact;

@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)
Expand Down
37 changes: 35 additions & 2 deletions src/main/java/com/stripe/model/PaymentMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore<P
@SerializedName("bacs_debit")
BacsDebit bacsDebit;

@SerializedName("bancontact")
Bancontact bancontact;

@SerializedName("billing_details")
BillingDetails billingDetails;

Expand All @@ -48,9 +51,15 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore<P
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Customer> customer;

@SerializedName("eps")
Eps eps;

@SerializedName("fpx")
Fpx fpx;

@SerializedName("giropay")
Giropay giropay;

/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
Expand Down Expand Up @@ -85,15 +94,19 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore<P
@SerializedName("object")
String object;

@SerializedName("p24")
P24 p24;

@SerializedName("sepa_debit")
SepaDebit sepaDebit;

/**
* The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name
* matching this value. It contains additional information specific to the PaymentMethod type.
*
* <p>One of {@code au_becs_debit}, {@code bacs_debit}, {@code card}, {@code card_present}, {@code
* fpx}, {@code ideal}, or {@code sepa_debit}.
* <p>One of {@code au_becs_debit}, {@code bacs_debit}, {@code bancontact}, {@code card}, {@code
* card_present}, {@code eps}, {@code fpx}, {@code giropay}, {@code ideal}, {@code p24}, or {@code
* sepa_debit}.
*/
@SerializedName("type")
String type;
Expand Down Expand Up @@ -438,6 +451,11 @@ public static class BacsDebit extends StripeObject {
String sortCode;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Bancontact extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -700,6 +718,11 @@ public static class VisaCheckout extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class CardPresent extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Eps extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -719,6 +742,11 @@ public static class Fpx extends StripeObject {
String bank;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Giropay extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -747,6 +775,11 @@ public static class Ideal extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class InteracPresent extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class P24 extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/stripe/model/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,13 @@ public static class OrderItem extends StripeObject {
@SerializedName("description")
String description;

/**
* The ID of the associated object for this line item. Expandable if not null (e.g., expandable
* to a SKU).
*/
@SerializedName("parent")
String parent;

/**
* The quantity of this order item. When type is {@code sku}, this is the number of instances of
* the SKU to be ordered.
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/stripe/model/checkout/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ public class Session extends ApiResource implements HasId {
* The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the
* browser's locale is used.
*
* <p>One of {@code auto}, {@code da}, {@code de}, {@code en}, {@code es}, {@code fi}, {@code fr},
* {@code it}, {@code ja}, {@code ms}, {@code nb}, {@code nl}, {@code pl}, {@code pt}, {@code
* pt-BR}, {@code sv}, or {@code zh}.
* <p>One of {@code auto}, {@code bg}, {@code cs}, {@code da}, {@code de}, {@code el}, {@code en},
* {@code es}, {@code et}, {@code fi}, {@code fr}, {@code hu}, {@code it}, {@code ja}, {@code lt},
* {@code lv}, {@code ms}, {@code mt}, {@code nb}, {@code nl}, {@code pl}, {@code pt}, {@code
* pt-BR}, {@code ro}, {@code ru}, {@code sk}, {@code sl}, {@code sv}, {@code tr}, or {@code zh}.
*/
@SerializedName("locale")
String locale;
Expand Down
128 changes: 126 additions & 2 deletions src/main/java/com/stripe/param/PaymentIntentConfirmParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,13 @@ public enum Type implements ApiRequestParams.EnumParam {

@Getter
public static class PaymentMethodOptions {
/**
* If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the
* Bancontact payment method options.
*/
@SerializedName("bancontact")
Object bancontact;

/** Configuration for any card payments attempted on this PaymentIntent. */
@SerializedName("card")
Object card;
Expand All @@ -838,7 +845,8 @@ public static class PaymentMethodOptions {
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map<String, Object> extraParams;

private PaymentMethodOptions(Object card, Map<String, Object> extraParams) {
private PaymentMethodOptions(Object bancontact, Object card, Map<String, Object> extraParams) {
this.bancontact = bancontact;
this.card = card;
this.extraParams = extraParams;
}
Expand All @@ -848,13 +856,33 @@ public static Builder builder() {
}

public static class Builder {
private Object bancontact;

private Object card;

private Map<String, Object> extraParams;

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

/**
* If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the
* Bancontact payment method options.
*/
public Builder setBancontact(Bancontact bancontact) {
this.bancontact = bancontact;
return this;
}

/**
* If this is a {@code bancontact} PaymentMethod, this sub-hash contains details about the
* Bancontact payment method options.
*/
public Builder setBancontact(EmptyParam bancontact) {
this.bancontact = bancontact;
return this;
}

/** Configuration for any card payments attempted on this PaymentIntent. */
Expand Down Expand Up @@ -897,6 +925,102 @@ public Builder putAllExtraParam(Map<String, Object> map) {
}
}

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

/**
* Preferred language of the Bancontact authorization page that the customer is redirected to.
*/
@SerializedName("preferred_language")
PreferredLanguage preferredLanguage;

private Bancontact(Map<String, Object> extraParams, PreferredLanguage preferredLanguage) {
this.extraParams = extraParams;
this.preferredLanguage = preferredLanguage;
}

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

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

private PreferredLanguage preferredLanguage;

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

/**
* 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 PaymentIntentConfirmParams.PaymentMethodOptions.Bancontact#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 PaymentIntentConfirmParams.PaymentMethodOptions.Bancontact#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;
}

/**
* Preferred language of the Bancontact authorization page that the customer is redirected
* to.
*/
public Builder setPreferredLanguage(PreferredLanguage preferredLanguage) {
this.preferredLanguage = preferredLanguage;
return this;
}
}

public enum PreferredLanguage implements ApiRequestParams.EnumParam {
@SerializedName("de")
DE("de"),

@SerializedName("en")
EN("en"),

@SerializedName("fr")
FR("fr"),

@SerializedName("nl")
NL("nl");

@Getter(onMethod_ = {@Override})
private final String value;

PreferredLanguage(String value) {
this.value = value;
}
}
}

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