com.stripe.model.issuing.Card Maven / Gradle / Ivy
// File generated from our OpenAPI spec
package com.stripe.model.issuing;
import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.Address;
import com.stripe.model.ExpandableField;
import com.stripe.model.HasId;
import com.stripe.model.MetadataStore;
import com.stripe.model.StripeObject;
import com.stripe.net.ApiMode;
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.issuing.CardCreateParams;
import com.stripe.param.issuing.CardDeliverCardParams;
import com.stripe.param.issuing.CardFailCardParams;
import com.stripe.param.issuing.CardListParams;
import com.stripe.param.issuing.CardRetrieveParams;
import com.stripe.param.issuing.CardReturnCardParams;
import com.stripe.param.issuing.CardShipCardParams;
import com.stripe.param.issuing.CardUpdateParams;
import java.util.List;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
/**
* You can create physical or virtual cards that
* are issued to cardholders.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class Card extends ApiResource implements HasId, MetadataStore {
/** The brand of the card. */
@SerializedName("brand")
String brand;
/**
* The reason why the card was canceled.
*
* One of {@code design_rejected}, {@code lost}, or {@code stolen}.
*/
@SerializedName("cancellation_reason")
String cancellationReason;
/**
* An Issuing {@code Cardholder} object represents an individual or business entity who is issued cards.
*
*
Related guide: How to
* create a cardholder
*/
@SerializedName("cardholder")
Cardholder cardholder;
/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;
/**
* Three-letter ISO currency code,
* in lowercase. Supported currencies are {@code usd} in the US, {@code eur} in the EU, and {@code
* gbp} in the UK.
*/
@SerializedName("currency")
String currency;
/**
* The card's CVC. For security reasons, this is only available for virtual cards, and will be
* omitted unless you explicitly request it with the {@code expand} parameter.
* Additionally, it's only available via the "Retrieve a card"
* endpoint, not via "List all cards" or any other endpoint.
*/
@SerializedName("cvc")
String cvc;
/** The expiration month of the card. */
@SerializedName("exp_month")
Long expMonth;
/** The expiration year of the card. */
@SerializedName("exp_year")
Long expYear;
/** The financial account this card is attached to. */
@SerializedName("financial_account")
String financialAccount;
/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;
/** The last 4 digits of the card number. */
@SerializedName("last4")
String last4;
/**
* Has the value {@code true} if the object exists in live mode or the value {@code false} if the
* object exists in test mode.
*/
@SerializedName("livemode")
Boolean livemode;
/**
* Set of key-value pairs that you can attach
* to an object. This can be useful for storing additional information about the object in a
* structured format.
*/
@Getter(onMethod_ = {@Override})
@SerializedName("metadata")
Map metadata;
/**
* The full unredacted card number. For security reasons, this is only available for virtual
* cards, and will be omitted unless you explicitly request it with the {@code expand} parameter.
* Additionally, it's only available via the "Retrieve a card"
* endpoint, not via "List all cards" or any other endpoint.
*/
@SerializedName("number")
String number;
/**
* String representing the object's type. Objects of the same type share the same value.
*
* Equal to {@code issuing.card}.
*/
@SerializedName("object")
String object;
/** The personalization design object belonging to this card. */
@SerializedName("personalization_design")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField personalizationDesign;
/** The latest card that replaces this card, if any. */
@SerializedName("replaced_by")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField replacedBy;
/** The card this card replaces, if any. */
@SerializedName("replacement_for")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField replacementFor;
/**
* The reason why the previous card needed to be replaced.
*
* One of {@code damaged}, {@code expired}, {@code lost}, or {@code stolen}.
*/
@SerializedName("replacement_reason")
String replacementReason;
/** Where and how the card will be shipped. */
@SerializedName("shipping")
Shipping shipping;
@SerializedName("spending_controls")
SpendingControls spendingControls;
/**
* Whether authorizations can be approved on this card. May be blocked from activating cards
* depending on past-due Cardholder requirements. Defaults to {@code inactive}.
*
*
One of {@code active}, {@code canceled}, or {@code inactive}.
*/
@SerializedName("status")
String status;
/**
* The type of the card.
*
*
One of {@code physical}, or {@code virtual}.
*/
@SerializedName("type")
String type;
/** Information relating to digital wallets (like Apple Pay and Google Pay). */
@SerializedName("wallets")
Wallets wallets;
/** Get ID of expandable {@code personalizationDesign} object. */
public String getPersonalizationDesign() {
return (this.personalizationDesign != null) ? this.personalizationDesign.getId() : null;
}
public void setPersonalizationDesign(String id) {
this.personalizationDesign = ApiResource.setExpandableFieldId(id, this.personalizationDesign);
}
/** Get expanded {@code personalizationDesign}. */
public PersonalizationDesign getPersonalizationDesignObject() {
return (this.personalizationDesign != null) ? this.personalizationDesign.getExpanded() : null;
}
public void setPersonalizationDesignObject(PersonalizationDesign expandableObject) {
this.personalizationDesign =
new ExpandableField(expandableObject.getId(), expandableObject);
}
/** Get ID of expandable {@code replacedBy} object. */
public String getReplacedBy() {
return (this.replacedBy != null) ? this.replacedBy.getId() : null;
}
public void setReplacedBy(String id) {
this.replacedBy = ApiResource.setExpandableFieldId(id, this.replacedBy);
}
/** Get expanded {@code replacedBy}. */
public Card getReplacedByObject() {
return (this.replacedBy != null) ? this.replacedBy.getExpanded() : null;
}
public void setReplacedByObject(Card expandableObject) {
this.replacedBy = new ExpandableField(expandableObject.getId(), expandableObject);
}
/** Get ID of expandable {@code replacementFor} object. */
public String getReplacementFor() {
return (this.replacementFor != null) ? this.replacementFor.getId() : null;
}
public void setReplacementFor(String id) {
this.replacementFor = ApiResource.setExpandableFieldId(id, this.replacementFor);
}
/** Get expanded {@code replacementFor}. */
public Card getReplacementForObject() {
return (this.replacementFor != null) ? this.replacementFor.getExpanded() : null;
}
public void setReplacementForObject(Card expandableObject) {
this.replacementFor = new ExpandableField(expandableObject.getId(), expandableObject);
}
/** Creates an Issuing {@code Card} object. */
public static Card create(Map params) throws StripeException {
return create(params, (RequestOptions) null);
}
/** Creates an Issuing {@code Card} object. */
public static Card create(Map params, RequestOptions options)
throws StripeException {
String path = "/v1/issuing/cards";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Card.class);
}
/** Creates an Issuing {@code Card} object. */
public static Card create(CardCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}
/** Creates an Issuing {@code Card} object. */
public static Card create(CardCreateParams params, RequestOptions options)
throws StripeException {
String path = "/v1/issuing/cards";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, Card.class);
}
/**
* Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
* creation date, with the most recently created object appearing first.
*/
public static CardCollection list(Map params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
* creation date, with the most recently created object appearing first.
*/
public static CardCollection list(Map params, RequestOptions options)
throws StripeException {
String path = "/v1/issuing/cards";
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, CardCollection.class);
}
/**
* Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
* creation date, with the most recently created object appearing first.
*/
public static CardCollection list(CardListParams params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
* creation date, with the most recently created object appearing first.
*/
public static CardCollection list(CardListParams params, RequestOptions options)
throws StripeException {
String path = "/v1/issuing/cards";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, CardCollection.class);
}
/** Retrieves an Issuing {@code Card} object. */
public static Card retrieve(String card) throws StripeException {
return retrieve(card, (Map) null, (RequestOptions) null);
}
/** Retrieves an Issuing {@code Card} object. */
public static Card retrieve(String card, RequestOptions options) throws StripeException {
return retrieve(card, (Map) null, options);
}
/** Retrieves an Issuing {@code Card} object. */
public static Card retrieve(String card, Map params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(card));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
return getGlobalResponseGetter().request(request, Card.class);
}
/** Retrieves an Issuing {@code Card} object. */
public static Card retrieve(String card, CardRetrieveParams params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(card));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getGlobalResponseGetter().request(request, Card.class);
}
/**
* Updates the specified Issuing {@code Card} object by setting the values of the parameters
* passed. Any parameters not provided will be left unchanged.
*/
@Override
public Card update(Map params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates the specified Issuing {@code Card} object by setting the values of the parameters
* passed. Any parameters not provided will be left unchanged.
*/
@Override
public Card update(Map params, RequestOptions options) throws StripeException {
String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(this.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return getResponseGetter().request(request, Card.class);
}
/**
* Updates the specified Issuing {@code Card} object by setting the values of the parameters
* passed. Any parameters not provided will be left unchanged.
*/
public Card update(CardUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Updates the specified Issuing {@code Card} object by setting the values of the parameters
* passed. Any parameters not provided will be left unchanged.
*/
public Card update(CardUpdateParams params, RequestOptions options) throws StripeException {
String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(this.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return getResponseGetter().request(request, Card.class);
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Shipping extends StripeObject {
@SerializedName("address")
Address address;
/** Address validation details for the shipment. */
@SerializedName("address_validation")
AddressValidation addressValidation;
/**
* The delivery company that shipped a card.
*
* One of {@code dhl}, {@code fedex}, {@code royal_mail}, or {@code usps}.
*/
@SerializedName("carrier")
String carrier;
/** Additional information that may be required for clearing customs. */
@SerializedName("customs")
Customs customs;
/** A unix timestamp representing a best estimate of when the card will be delivered. */
@SerializedName("eta")
Long eta;
/** Recipient name. */
@SerializedName("name")
String name;
/**
* The phone number of the receiver of the shipment. Our courier partners will use this number
* to contact you in the event of card delivery issues. For individual shipments to the EU/UK,
* if this field is empty, we will provide them with the phone number provided when the
* cardholder was initially created.
*/
@SerializedName("phone_number")
String phoneNumber;
/**
* Whether a signature is required for card delivery. This feature is only supported for US
* users. Standard shipping service does not support signature on delivery. The default value
* for standard shipping service is false and for express and priority services is true.
*/
@SerializedName("require_signature")
Boolean requireSignature;
/**
* Shipment service, such as {@code standard} or {@code express}.
*
*
One of {@code express}, {@code priority}, or {@code standard}.
*/
@SerializedName("service")
String service;
/**
* The delivery status of the card.
*
*
One of {@code canceled}, {@code delivered}, {@code failure}, {@code pending}, {@code
* returned}, or {@code shipped}.
*/
@SerializedName("status")
String status;
/** A tracking number for a card shipment. */
@SerializedName("tracking_number")
String trackingNumber;
/**
* A link to the shipping carrier's site where you can view detailed information about a card
* shipment.
*/
@SerializedName("tracking_url")
String trackingUrl;
/**
* Packaging options.
*
*
One of {@code bulk}, or {@code individual}.
*/
@SerializedName("type")
String type;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AddressValidation extends StripeObject {
/**
* The address validation capabilities to use.
*
*
One of {@code disabled}, {@code normalization_only}, or {@code
* validation_and_normalization}.
*/
@SerializedName("mode")
String mode;
/** The normalized shipping address. */
@SerializedName("normalized_address")
Address normalizedAddress;
/**
* The validation result for the shipping address.
*
*
One of {@code indeterminate}, {@code likely_deliverable}, or {@code
* likely_undeliverable}.
*/
@SerializedName("result")
String result;
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Customs extends StripeObject {
/**
* A registration number used for customs in Europe. See https://www.gov.uk/eori for the UK and https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en
* for the EU.
*/
@SerializedName("eori_number")
String eoriNumber;
}
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SpendingControls extends StripeObject {
/**
* Array of strings containing categories
* of authorizations to allow. All other categories will be blocked. Cannot be set with {@code
* blocked_categories}.
*/
@SerializedName("allowed_categories")
List allowedCategories;
/**
* Array of strings containing representing countries from which authorizations will be allowed.
* Authorizations from merchants in all other countries will be declined. Country codes should
* be ISO 3166 alpha-2 country codes (e.g. {@code US}). Cannot be set with {@code
* blocked_merchant_countries}. Provide an empty value to unset this control.
*/
@SerializedName("allowed_merchant_countries")
List allowedMerchantCountries;
/**
* Array of strings containing categories
* of authorizations to decline. All other categories will be allowed. Cannot be set with {@code
* allowed_categories}.
*/
@SerializedName("blocked_categories")
List blockedCategories;
/**
* Array of strings containing representing countries from which authorizations will be
* declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. {@code US}). Cannot be
* set with {@code allowed_merchant_countries}. Provide an empty value to unset this control.
*/
@SerializedName("blocked_merchant_countries")
List blockedMerchantCountries;
/**
* Limit spending with amount-based rules that apply across any cards this card replaced (i.e.,
* its {@code replacement_for} card and that card's {@code replacement_for} card, up
* the chain).
*/
@SerializedName("spending_limits")
List spendingLimits;
/**
* Currency of the amounts within {@code spending_limits}. Always the same as the currency of
* the card.
*/
@SerializedName("spending_limits_currency")
String spendingLimitsCurrency;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SpendingLimit extends StripeObject {
/**
* Maximum amount allowed to spend per interval. This amount is in the card's currency and in
* the smallest currency unit.
*/
@SerializedName("amount")
Long amount;
/**
* Array of strings containing categories
* this limit applies to. Omitting this field will apply the limit to all categories.
*/
@SerializedName("categories")
List categories;
/**
* Interval (or event) to which the amount applies.
*
* One of {@code all_time}, {@code daily}, {@code monthly}, {@code per_authorization},
* {@code weekly}, or {@code yearly}.
*/
@SerializedName("interval")
String interval;
}
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Wallets extends StripeObject {
@SerializedName("apple_pay")
ApplePay applePay;
@SerializedName("google_pay")
GooglePay googlePay;
/** Unique identifier for a card used with digital wallets. */
@SerializedName("primary_account_identifier")
String primaryAccountIdentifier;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class ApplePay extends StripeObject {
/** Apple Pay Eligibility. */
@SerializedName("eligible")
Boolean eligible;
/**
* Reason the card is ineligible for Apple Pay
*
*
One of {@code missing_agreement}, {@code missing_cardholder_contact}, or {@code
* unsupported_region}.
*/
@SerializedName("ineligible_reason")
String ineligibleReason;
}
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class GooglePay extends StripeObject {
/** Google Pay Eligibility. */
@SerializedName("eligible")
Boolean eligible;
/**
* Reason the card is ineligible for Google Pay
*
*
One of {@code missing_agreement}, {@code missing_cardholder_contact}, or {@code
* unsupported_region}.
*/
@SerializedName("ineligible_reason")
String ineligibleReason;
}
}
public TestHelpers getTestHelpers() {
return new TestHelpers(this);
}
public static class TestHelpers {
private final Card resource;
private TestHelpers(Card resource) {
this.resource = resource;
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code
* delivered}.
*/
public Card deliverCard() throws StripeException {
return deliverCard((Map) null, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code
* delivered}.
*/
public Card deliverCard(RequestOptions options) throws StripeException {
return deliverCard((Map) null, options);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code
* delivered}.
*/
public Card deliverCard(Map params) throws StripeException {
return deliverCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code
* delivered}.
*/
public Card deliverCard(Map params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/deliver",
ApiResource.urlEncodeId(this.resource.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code
* delivered}.
*/
public Card deliverCard(CardDeliverCardParams params) throws StripeException {
return deliverCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code
* delivered}.
*/
public Card deliverCard(CardDeliverCardParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/deliver",
ApiResource.urlEncodeId(this.resource.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
*/
public Card failCard() throws StripeException {
return failCard((Map) null, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
*/
public Card failCard(RequestOptions options) throws StripeException {
return failCard((Map) null, options);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
*/
public Card failCard(Map params) throws StripeException {
return failCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
*/
public Card failCard(Map params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/fail",
ApiResource.urlEncodeId(this.resource.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
*/
public Card failCard(CardFailCardParams params) throws StripeException {
return failCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
*/
public Card failCard(CardFailCardParams params, RequestOptions options) throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/fail",
ApiResource.urlEncodeId(this.resource.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
*/
public Card returnCard() throws StripeException {
return returnCard((Map) null, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
*/
public Card returnCard(RequestOptions options) throws StripeException {
return returnCard((Map) null, options);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
*/
public Card returnCard(Map params) throws StripeException {
return returnCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
*/
public Card returnCard(Map params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/return",
ApiResource.urlEncodeId(this.resource.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
*/
public Card returnCard(CardReturnCardParams params) throws StripeException {
return returnCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
*/
public Card returnCard(CardReturnCardParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/return",
ApiResource.urlEncodeId(this.resource.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
*/
public Card shipCard() throws StripeException {
return shipCard((Map) null, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
*/
public Card shipCard(RequestOptions options) throws StripeException {
return shipCard((Map) null, options);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
*/
public Card shipCard(Map params) throws StripeException {
return shipCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
*/
public Card shipCard(Map params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/ship",
ApiResource.urlEncodeId(this.resource.getId()));
ApiRequest request =
new ApiRequest(
BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
*/
public Card shipCard(CardShipCardParams params) throws StripeException {
return shipCard(params, (RequestOptions) null);
}
/**
* Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
*/
public Card shipCard(CardShipCardParams params, RequestOptions options) throws StripeException {
String path =
String.format(
"/v1/test_helpers/issuing/cards/%s/shipping/ship",
ApiResource.urlEncodeId(this.resource.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options,
ApiMode.V1);
return resource.getResponseGetter().request(request, Card.class);
}
}
@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(cardholder, responseGetter);
trySetResponseGetter(personalizationDesign, responseGetter);
trySetResponseGetter(replacedBy, responseGetter);
trySetResponseGetter(replacementFor, responseGetter);
trySetResponseGetter(shipping, responseGetter);
trySetResponseGetter(spendingControls, responseGetter);
trySetResponseGetter(wallets, responseGetter);
}
}