Skip to content

Commit

Permalink
Merge pull request stripe#780 from stripe/ob/sdk-autogen-java-spec-dd…
Browse files Browse the repository at this point in the history
…3a8ba_2

[generated] source: spec3.sdk.yaml@spec-dd3a8ba in master
  • Loading branch information
ob-stripe authored May 23, 2019
2 parents 33ff049 + 3a22ca9 commit 14d0d54
Show file tree
Hide file tree
Showing 23 changed files with 719 additions and 88 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/model/AccountLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public class AccountLink extends ApiResource {

/**
* Creates an AccountLink object that returns a Stripe URL that the user can redirect their user
* to in order to take them through the Hosted Verification flow.
* to in order to take them through the hosted onboarding flow.
*/
public static AccountLink create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
}

/**
* Creates an AccountLink object that returns a Stripe URL that the user can redirect their user
* to in order to take them through the Hosted Verification flow.
* to in order to take them through the hosted onboarding flow.
*/
public static AccountLink create(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand All @@ -53,15 +53,15 @@ public static AccountLink create(Map<String, Object> params, RequestOptions opti

/**
* Creates an AccountLink object that returns a Stripe URL that the user can redirect their user
* to in order to take them through the Hosted Verification flow.
* to in order to take them through the hosted onboarding flow.
*/
public static AccountLink create(AccountLinkCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}

/**
* Creates an AccountLink object that returns a Stripe URL that the user can redirect their user
* to in order to take them through the Hosted Verification flow.
* to in order to take them through the hosted onboarding flow.
*/
public static AccountLink create(AccountLinkCreateParams params, RequestOptions options)
throws StripeException {
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ public class Charge extends ApiResource implements BalanceTransactionSource, Met
ShippingDetails shipping;

/**
* For most Stripe users, the source of every charge is a credit or debit card. This hash is then
* the [card object](#card_object) describing that card.
* This is a legacy field that will be removed in the future. It contains the Source, Card, or
* BankAccount object used for the charge. For details about the payment method used for this
* charge, refer to `payment_method` or `payment_method_details` instead.
*/
@SerializedName("source")
PaymentSource source;
Expand Down Expand Up @@ -1242,9 +1243,18 @@ public static class Checks extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class ThreeDSecure extends StripeObject {
/**
* Whether or not authentication was performed. 3D Secure will succeed without
* authentication when the card is not enrolled.
*/
@SerializedName("authenticated")
Boolean authenticated;

/** Whether or not 3D Secure succeeded. */
@SerializedName("succeeded")
Boolean succeeded;

/** The version of 3D Secure that was used for this payment. */
@SerializedName("version")
String version;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.stripe.model.issuing.CardDetails;
import com.stripe.model.issuing.Cardholder;
import com.stripe.model.issuing.Transaction;
import com.stripe.model.radar.EarlyFraudWarning;
import com.stripe.model.radar.ValueList;
import com.stripe.model.radar.ValueListItem;
import com.stripe.model.reporting.ReportRun;
Expand Down Expand Up @@ -75,6 +76,7 @@ final class EventDataClassLookup {
classLookup.put("person", Person.class);
classLookup.put("plan", Plan.class);
classLookup.put("product", Product.class);
classLookup.put("radar.early_fraud_warning", EarlyFraudWarning.class);
classLookup.put("radar.value_list", ValueList.class);
classLookup.put("radar.value_list_item", ValueListItem.class);
classLookup.put("recipient", Recipient.class);
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,10 @@ public static class CustomField extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class CustomerTaxId extends StripeObject {
/** The type of the tax ID, one of `eu_vat`, `nz_gst`, `au_abn`, or `unknown`. */
/**
* The type of the tax ID, one of `au_abn`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, or
* `unknown`.
*/
@SerializedName("type")
String type;

Expand Down
32 changes: 29 additions & 3 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,16 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
@SerializedName("cancellation_reason")
String cancellationReason;

/** Capture method of this PaymentIntent, one of `automatic` or `manual`. */
/**
* One of `automatic` (default) or `manual`.
*
* <p>When the capture method is `automatic`, Stripe automatically captures funds when the
* customer authorizes the payment.
*
* <p>Change `capture_method` to manual if you wish to [separate authorization and
* capture](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#separate-authorization-and-capture)
* for payment methods that support this.
*/
@SerializedName("capture_method")
String captureMethod;

Expand All @@ -83,7 +92,21 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
@SerializedName("client_secret")
String clientSecret;

/** Confirmation method of this PaymentIntent, one of `manual` or `automatic`. */
/**
* One of `automatic` (default) or `manual`.
*
* <p>When the confirmation method is `automatic`, a PaymentIntent can be confirmed using a
* publishable key. After `next_action`s are handled, no additional confirmation is required to
* complete the payment.
*
* <p>When the confirmation method is `manual`, all payment attempts must be made using a secret
* key. The PaymentIntent returns to the `requires_confirmation` state after handling
* `next_action`s, and requires your server to initiate each payment attempt with an explicit
* confirmation.
*
* <p>Learn more about the different [confirmation
* flows](https://stripe.com/docs/payments/payment-intents#one-time-payments).
*/
@SerializedName("confirmation_method")
String confirmationMethod;

Expand Down Expand Up @@ -185,7 +208,10 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
@SerializedName("shipping")
ShippingDetails shipping;

/** ID of the source used in this PaymentIntent. */
/**
* This is a legacy field that will be removed in the future. It is the ID of the Source object
* that is associated with this PaymentIntent, if one was supplied.
*/
@SerializedName("source")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/model/TaxId.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TaxId extends ApiResource implements HasId {
@SerializedName("object")
String object;

/** Type of the tax ID, one of `eu_vat`, `nz_gst`, `au_abn`, or `unknown`. */
/** Type of the tax ID, one of `au_abn`, `eu_vat`, `in_gst`, `no_vat`, `nz_gst`, or `unknown`. */
@SerializedName("type")
String type;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/issuing/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ public static class AuthorizationControls extends StripeObject {
/** Limit the spending with rules based on time intervals and categories. */
@SerializedName("spending_limits")
List<SpendingLimit> spendingLimits;

/** Currency for the amounts within spending_limits. Locked to the currency of the card. */
@SerializedName("spending_limits_currency")
String spendingLimitsCurrency;
}

@Getter
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/issuing/Cardholder.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ public static class AuthorizationControls extends StripeObject {
/** Limit the spending with rules based on time intervals and categories. */
@SerializedName("spending_limits")
List<SpendingLimit> spendingLimits;

/** Currency for the amounts within spending_limits. */
@SerializedName("spending_limits_currency")
String spendingLimitsCurrency;
}

@Getter
Expand Down
166 changes: 166 additions & 0 deletions src/main/java/com/stripe/model/radar/EarlyFraudWarning.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model.radar;

import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Charge;
import com.stripe.model.ExpandableField;
import com.stripe.model.HasId;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.radar.EarlyFraudWarningListParams;
import com.stripe.param.radar.EarlyFraudWarningRetrieveParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class EarlyFraudWarning extends ApiResource implements HasId {
/**
* An EFW is actionable if it has not received a dispute and has not been fully refunded. You may
* wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute
* later.
*/
@SerializedName("actionable")
Boolean actionable;

/** ID of the charge this early fraud warning is for, optionally expanded. */
@SerializedName("charge")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Charge> charge;

/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;

/**
* The type of fraud labelled by the issuer. One of `card_never_received`,
* `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`,
* `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`.
*/
@SerializedName("fraud_type")
String fraudType;

/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object
* exists in test mode.
*/
@SerializedName("livemode")
Boolean livemode;

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

/** Get id of expandable `charge` object. */
public String getCharge() {
return (this.charge != null) ? this.charge.getId() : null;
}

public void setCharge(String id) {
this.charge = ApiResource.setExpandableFieldId(id, this.charge);
}

/** Get expanded `charge`. */
public Charge getChargeObject() {
return (this.charge != null) ? this.charge.getExpanded() : null;
}

public void setChargeObject(Charge expandableObject) {
this.charge = new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
}

/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(Map<String, Object> params)
throws StripeException {
return list(params, (RequestOptions) null);
}

/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/early_fraud_warnings");
return requestCollection(url, params, EarlyFraudWarningCollection.class, options);
}

/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(EarlyFraudWarningListParams params)
throws StripeException {
return list(params, (RequestOptions) null);
}

/** Returns a list of early fraud warnings. */
public static EarlyFraudWarningCollection list(
EarlyFraudWarningListParams params, RequestOptions options) throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/radar/early_fraud_warnings");
return requestCollection(url, params, EarlyFraudWarningCollection.class, options);
}

/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(String earlyFraudWarning) throws StripeException {
return retrieve(earlyFraudWarning, (Map<String, Object>) null, (RequestOptions) null);
}

/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(String earlyFraudWarning, RequestOptions options)
throws StripeException {
return retrieve(earlyFraudWarning, (Map<String, Object>) null, options);
}

/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(
String earlyFraudWarning, Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/radar/early_fraud_warnings/%s", ApiResource.urlEncodeId(earlyFraudWarning)));
return request(ApiResource.RequestMethod.GET, url, params, EarlyFraudWarning.class, options);
}

/**
* Retrieves the details of an early fraud warning that has previously been created.
*
* <p>Please refer to the <a href="#early_fraud_warning_object">early fraud warning</a> object
* reference for more details.
*/
public static EarlyFraudWarning retrieve(
String earlyFraudWarning, EarlyFraudWarningRetrieveParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/radar/early_fraud_warnings/%s", ApiResource.urlEncodeId(earlyFraudWarning)));
return request(ApiResource.RequestMethod.GET, url, params, EarlyFraudWarning.class, options);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Generated by com.stripe.generator.entity.SdkBuilder

package com.stripe.model.radar;

import com.stripe.model.StripeCollection;

public class EarlyFraudWarningCollection extends StripeCollection<EarlyFraudWarning> {}
10 changes: 8 additions & 2 deletions src/main/java/com/stripe/param/CustomerCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ public static class TaxIdData {
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map<String, Object> extraParams;

/** Type of the tax ID, one of `eu_vat`, `nz_gst`, or `au_abn`. */
/** Type of the tax ID, one of `au_abn`, `eu_vat`, `in_gst`, `no_vat`, or `nz_gst`. */
@SerializedName("type")
Type type;

Expand Down Expand Up @@ -1082,7 +1082,7 @@ public Builder putAllExtraParam(Map<String, Object> map) {
return this;
}

/** Type of the tax ID, one of `eu_vat`, `nz_gst`, or `au_abn`. */
/** Type of the tax ID, one of `au_abn`, `eu_vat`, `in_gst`, `no_vat`, or `nz_gst`. */
public Builder setType(Type type) {
this.type = type;
return this;
Expand All @@ -1102,6 +1102,12 @@ public enum Type implements ApiRequestParams.EnumParam {
@SerializedName("eu_vat")
EU_VAT("eu_vat"),

@SerializedName("in_gst")
IN_GST("in_gst"),

@SerializedName("no_vat")
NO_VAT("no_vat"),

@SerializedName("nz_gst")
NZ_GST("nz_gst");

Expand Down
Loading

0 comments on commit 14d0d54

Please sign in to comment.