Skip to content
Open
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
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6a1eb046657923602071d7707e99ce8a004a8216
104722335bd36cf4d60f025dc4b0d7150a7c2200
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2261
v2271
12 changes: 12 additions & 0 deletions src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,18 @@ public com.stripe.service.PaymentLinkService paymentLinks() {
return new com.stripe.service.PaymentLinkService(this.getResponseGetter());
}

/**
* @deprecated StripeClient.paymentLocationCapabilities() is deprecated, use
* StripeClient.v1().paymentLocationCapabilities() instead. All functionality under it has
* been copied over to StripeClient.v1().paymentLocationCapabilities(). See <a
* href="https://github.com/stripe/stripe-java/wiki/v1-namespace-in-StripeClient">migration
* guide</a> for more on this and tips on migrating to the new v1 namespace.
*/
@Deprecated
public com.stripe.service.PaymentLocationCapabilityService paymentLocationCapabilities() {
return new com.stripe.service.PaymentLocationCapabilityService(this.getResponseGetter());
}

/**
* @deprecated StripeClient.paymentLocations() is deprecated, use
* StripeClient.v1().paymentLocations() instead. All functionality under it has been copied
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 @@ -72,6 +72,8 @@ public final class EventDataClassLookup {
com.stripe.model.PaymentIntentAmountDetailsLineItem.class);
classLookup.put("payment_link", com.stripe.model.PaymentLink.class);
classLookup.put("payment_location", com.stripe.model.PaymentLocation.class);
classLookup.put(
"payment_location_capability", com.stripe.model.PaymentLocationCapability.class);
classLookup.put("payment_method", com.stripe.model.PaymentMethod.class);
classLookup.put("payment_method_balance", com.stripe.model.PaymentMethodBalance.class);
classLookup.put(
Expand Down
51 changes: 0 additions & 51 deletions src/main/java/com/stripe/model/InvoiceItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -818,61 +818,10 @@ public static class RateCardRateDetails extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class ProrationDetails extends StripeObject {
@SerializedName("credited_items")
CreditedItems creditedItems;

/** Discount amounts applied when the proration was created. */
@SerializedName("discount_amounts")
List<InvoiceItem.ProrationDetails.DiscountAmount> discountAmounts;

/**
* For more details about CreditedItems, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class CreditedItems extends StripeObject {
/**
* When {@code type} is {@code invoice_item}, the invoice item id for the debited invoice item
* corresponding to this credit proration.
*/
@SerializedName("invoice_item")
String invoiceItem;

@SerializedName("invoice_line_items")
InvoiceLineItems invoiceLineItems;

/**
* Whether the credit references a pending invoice item or one or more invoice line items on
* an invoice.
*
* <p>One of {@code invoice_item}, or {@code invoice_line_items}.
*/
@SerializedName("type")
String type;

/**
* For more details about InvoiceLineItems, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class InvoiceLineItems extends StripeObject {
/** The invoice id for the debited line item(s). */
@SerializedName("invoice")
String invoice;

/**
* IDs of the debited invoice line item(s) on the invoice that correspond to the credit
* proration.
*/
@SerializedName("invoice_line_items")
List<String> invoiceLineItems;
}
}

/**
* For more details about DiscountAmount, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore<P
@SerializedName("allocated_funds")
AllocatedFunds allocatedFunds;

/**
* The list of payment method types allowed for use with this payment. Stripe automatically
* returns compatible payment methods from this list in the {@code payment_method_types} field of
* the response, based on the other PaymentIntent parameters, such as {@code currency}, {@code
* amount}, and {@code customer}.
*/
@SerializedName("allowed_payment_method_types")
List<String> allowedPaymentMethodTypes;

/**
* Amount intended to be collected by this PaymentIntent. A positive integer representing how much
* to charge in the <a href="https://docs.stripe.com/currencies#zero-decimal">smallest currency
Expand Down
187 changes: 187 additions & 0 deletions src/main/java/com/stripe/model/PaymentLocationCapability.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
// File generated from our OpenAPI spec
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.PaymentLocationCapabilityUpdateParams;
import java.util.List;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
* A Payment Location Capability represents a capability for a Stripe account at a Payment Location.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class PaymentLocationCapability extends ApiResource {
/** The account for which the capability enables functionality. */
@SerializedName("account")
String account;

/**
* The identifier for the capability.
*
* <p>Equal to {@code fr_meal_vouchers_conecs_payments}.
*/
@SerializedName("capability")
String capability;

/** The payment location for which the capability enables functionality. */
@SerializedName("location")
String location;

/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code payment_location_capability}.
*/
@SerializedName("object")
String object;

/** Whether the capability has been requested. */
@SerializedName("requested")
Boolean requested;

/** Time at which the capability was requested. Measured in seconds since the Unix epoch. */
@SerializedName("requested_at")
Long requestedAt;

@SerializedName("requirements")
Requirements requirements;

/**
* The status of the capability.
*
* <p>One of {@code active}, {@code inactive}, {@code pending}, or {@code unrequested}.
*/
@SerializedName("status")
String status;

/**
* Updates a specified Payment Location Capability. Request or remove a payment location
* capability by updating its {@code requested} parameter.
*/
public static PaymentLocationCapability update(String capability, Map<String, Object> params)
throws StripeException {
return update(capability, params, (RequestOptions) null);
}

/**
* Updates a specified Payment Location Capability. Request or remove a payment location
* capability by updating its {@code requested} parameter.
*/
public static PaymentLocationCapability update(
String capability, Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format("/v1/payment_location_capabilities/%s", ApiResource.urlEncodeId(capability));
ApiRequest request =
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
return getGlobalResponseGetter().request(request, PaymentLocationCapability.class);
}

/**
* Updates a specified Payment Location Capability. Request or remove a payment location
* capability by updating its {@code requested} parameter.
*/
public static PaymentLocationCapability update(
String capability, PaymentLocationCapabilityUpdateParams params) throws StripeException {
return update(capability, params, (RequestOptions) null);
}

/**
* Updates a specified Payment Location Capability. Request or remove a payment location
* capability by updating its {@code requested} parameter.
*/
public static PaymentLocationCapability update(
String capability, PaymentLocationCapabilityUpdateParams params, RequestOptions options)
throws StripeException {
String path =
String.format("/v1/payment_location_capabilities/%s", ApiResource.urlEncodeId(capability));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options);
return getGlobalResponseGetter().request(request, PaymentLocationCapability.class);
}

/**
* For more details about Requirements, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Requirements extends StripeObject {
/** Fields that need to be collected to keep the capability enabled. */
@SerializedName("currently_due")
List<String> currentlyDue;

/**
* Description of why the capability is disabled.
*
* <p>One of {@code account.capability_required}, {@code pending.onboarding}, {@code
* pending.review}, {@code rejected.other}, {@code rejected.unsupported_business}, or {@code
* requirements.fields_needed}.
*/
@SerializedName("disabled_reason")
String disabledReason;

/**
* Fields that are {@code currently_due} and need to be collected again because validation or
* verification failed.
*/
@SerializedName("errors")
List<PaymentLocationCapability.Requirements.Errors> errors;

/**
* For more details about Errors, please refer to the <a href="https://docs.stripe.com/api">API
* Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Errors extends StripeObject {
/**
* The code for the type of error.
*
* <p>One of {@code information_missing}, or {@code invalid_value_other}.
*/
@SerializedName("code")
String code;

/**
* An informative message that indicates the error type and provides additional details about
* the error.
*/
@SerializedName("reason")
String reason;

/**
* The specific user onboarding requirement field (in the requirements hash) that needs to be
* resolved.
*/
@SerializedName("requirement")
String requirement;
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(requirements, responseGetter);
}
}
Loading
Loading