Skip to content

Commit

Permalink
Merge branch 'beta' into merge-upstream
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	OPENAPI_VERSION
#	README.md
#	VERSION
#	gradle.properties
#	src/main/java/com/stripe/Stripe.java
  • Loading branch information
pakrym-stripe committed Aug 16, 2023
2 parents f2fa08a + c4f8327 commit 2d50391
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@
* ⚠️ `RequestOptions.getDefault()` does not apply global configuration options from `Stripe` class, all fields are initialized to `null`.
* ⚠️ `RequestOptionsBuilder` does not apply global configuration options from `Stripe` class, all fields are initialized to `null`.

## 23.0.0 - 2023-08-16

## 22.32.0-beta.1 - 2023-08-10
* [#1624](https://github.com/stripe/stripe-java/pull/1624) Update generated code for beta
* Add support for `paypal` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration`
* Add support for new value `quote.accept_failed` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

## 22.31.0-beta.1 - 2023-08-03
* [#1621](https://github.com/stripe/stripe-java/pull/1621) Update generated code for beta
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/com/stripe/model/PaymentMethodConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId {
@SerializedName("paynow")
Paynow paynow;

@SerializedName("paypal")
Paypal paypal;

@SerializedName("promptpay")
Promptpay promptpay;

Expand Down Expand Up @@ -1643,6 +1646,49 @@ public static class DisplayPreference extends StripeObject {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Paypal extends StripeObject {
/**
* Whether this payment method may be offered at checkout. True if {@code display_preference} is
* {@code on} and the payment method's capability is active.
*/
@SerializedName("available")
Boolean available;

@SerializedName("display_preference")
DisplayPreference displayPreference;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class DisplayPreference extends StripeObject {
/**
* For child configurations, whether or not the account's preference will be observed. If
* {@code false}, the parent configuration's preference is used.
*/
@SerializedName("overridable")
Boolean overridable;

/**
* The account's display preference.
*
* <p>One of {@code none}, {@code off}, or {@code on}.
*/
@SerializedName("preference")
String preference;

/**
* The effective display preference value.
*
* <p>One of {@code off}, or {@code on}.
*/
@SerializedName("value")
String value;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams {
@SerializedName("paynow")
Paynow paynow;

/**
* PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to
* pay using their PayPal account. Check this <a
* href="https://stripe.com/docs/payments/paypal">page</a> for more details.
*/
@SerializedName("paypal")
Paypal paypal;

/**
* PromptPay is a Thailand-based payment method that allows customers to make a payment using
* their preferred app from participating banks. Check this <a
Expand Down Expand Up @@ -354,6 +362,7 @@ private PaymentMethodConfigurationCreateParams(
P24 p24,
String parent,
Paynow paynow,
Paypal paypal,
Promptpay promptpay,
SepaDebit sepaDebit,
Sofort sofort,
Expand Down Expand Up @@ -390,6 +399,7 @@ private PaymentMethodConfigurationCreateParams(
this.p24 = p24;
this.parent = parent;
this.paynow = paynow;
this.paypal = paypal;
this.promptpay = promptpay;
this.sepaDebit = sepaDebit;
this.sofort = sofort;
Expand Down Expand Up @@ -464,6 +474,8 @@ public static class Builder {

private Paynow paynow;

private Paypal paypal;

private Promptpay promptpay;

private SepaDebit sepaDebit;
Expand Down Expand Up @@ -508,6 +520,7 @@ public PaymentMethodConfigurationCreateParams build() {
this.p24,
this.parent,
this.paynow,
this.paypal,
this.promptpay,
this.sepaDebit,
this.sofort,
Expand Down Expand Up @@ -881,6 +894,16 @@ public Builder setPaynow(PaymentMethodConfigurationCreateParams.Paynow paynow) {
return this;
}

/**
* PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to
* pay using their PayPal account. Check this <a
* href="https://stripe.com/docs/payments/paypal">page</a> for more details.
*/
public Builder setPaypal(PaymentMethodConfigurationCreateParams.Paypal paypal) {
this.paypal = paypal;
return this;
}

/**
* PromptPay is a Thailand-based payment method that allows customers to make a payment using
* their preferred app from participating banks. Check this <a
Expand Down Expand Up @@ -5352,6 +5375,169 @@ public enum Preference implements ApiRequestParams.EnumParam {
}
}

@Getter
public static class Paypal {
/** Whether or not the payment method should be displayed. */
@SerializedName("display_preference")
DisplayPreference displayPreference;

/**
* 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 Paypal(DisplayPreference displayPreference, Map<String, Object> extraParams) {
this.displayPreference = displayPreference;
this.extraParams = extraParams;
}

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

public static class Builder {
private DisplayPreference displayPreference;

private Map<String, Object> extraParams;

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

/** Whether or not the payment method should be displayed. */
public Builder setDisplayPreference(
PaymentMethodConfigurationCreateParams.Paypal.DisplayPreference displayPreference) {
this.displayPreference = displayPreference;
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
* PaymentMethodConfigurationCreateParams.Paypal#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 PaymentMethodConfigurationCreateParams.Paypal#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 DisplayPreference {
/**
* 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;

/** The account's preference for whether or not to display this payment method. */
@SerializedName("preference")
Preference preference;

private DisplayPreference(Map<String, Object> extraParams, Preference preference) {
this.extraParams = extraParams;
this.preference = preference;
}

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

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

private Preference preference;

/** Finalize and obtain parameter instance from this builder. */
public PaymentMethodConfigurationCreateParams.Paypal.DisplayPreference build() {
return new PaymentMethodConfigurationCreateParams.Paypal.DisplayPreference(
this.extraParams, this.preference);
}

/**
* 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
* PaymentMethodConfigurationCreateParams.Paypal.DisplayPreference#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
* PaymentMethodConfigurationCreateParams.Paypal.DisplayPreference#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;
}

/** The account's preference for whether or not to display this payment method. */
public Builder setPreference(
PaymentMethodConfigurationCreateParams.Paypal.DisplayPreference.Preference preference) {
this.preference = preference;
return this;
}
}

public enum Preference implements ApiRequestParams.EnumParam {
@SerializedName("none")
NONE("none"),

@SerializedName("off")
OFF("off"),

@SerializedName("on")
ON("on");

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

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

@Getter
public static class Promptpay {
/** Whether or not the payment method should be displayed. */
Expand Down
Loading

0 comments on commit 2d50391

Please sign in to comment.