Package com.stripe.model
Class Order
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.Order
-
- All Implemented Interfaces:
HasId,MetadataStore<Order>,StripeObjectInterface
public class Order extends ApiResource implements HasId, MetadataStore<Order>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOrder.ShippingMethodstatic classOrder.StatusTransitionsThe type of estimate.-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description Order()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)static Ordercreate(OrderCreateParams params)Creates a new order object.static Ordercreate(OrderCreateParams params, RequestOptions options)Creates a new order object.static Ordercreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a new order object.static Ordercreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a new order object.booleanequals(java.lang.Object o)java.lang.LonggetAmount()A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.java.lang.LonggetAmountReturned()The total amount that was returned to the customer.java.lang.StringgetApplication()ID of the Connect Application that created the order.java.lang.LonggetApplicationFee()A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account.java.lang.StringgetCharge()Get ID of expandablechargeobject.ChargegetChargeObject()Get expandedcharge.java.lang.LonggetCreated()Time at which the object was created.java.lang.StringgetCurrency()Three-letter ISO currency code, in lowercase.java.lang.StringgetCustomer()Get ID of expandablecustomerobject.CustomergetCustomerObject()Get expandedcustomer.java.lang.StringgetEmail()The email address of the customer placing the order.java.lang.StringgetExternalCouponCode()External coupon code to load for this order.java.lang.StringgetId()Unique identifier for the object.java.util.List<OrderItem>getItems()List of items constituting the order.java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetObject()String representing the object's type.OrderReturnCollectiongetReturns()A list of returns that have taken place for this order.java.lang.StringgetSelectedShippingMethod()The shipping method that is currently selected for this order, if any.ShippingDetailsgetShipping()The shipping address for the order.java.util.List<Order.ShippingMethod>getShippingMethods()A list of supported shipping methods for this order.java.lang.StringgetStatus()Current order status.Order.StatusTransitionsgetStatusTransitions()The timestamps at which the order status was updated.java.lang.LonggetUpdated()Time at which the object was last updated.java.lang.StringgetUpstreamId()The user's order ID if it is different from the Stripe order ID.inthashCode()static OrderCollectionlist(OrderListParams params)Returns a list of your orders.static OrderCollectionlist(OrderListParams params, RequestOptions options)Returns a list of your orders.static OrderCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of your orders.static OrderCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of your orders.Orderpay()Pay an order by providing asourceto create a payment.Orderpay(RequestOptions options)Pay an order by providing asourceto create a payment.Orderpay(OrderPayParams params)Pay an order by providing asourceto create a payment.Orderpay(OrderPayParams params, RequestOptions options)Pay an order by providing asourceto create a payment.Orderpay(java.util.Map<java.lang.String,java.lang.Object> params)Pay an order by providing asourceto create a payment.Orderpay(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Pay an order by providing asourceto create a payment.static Orderretrieve(java.lang.String id)Retrieves the details of an existing order.static Orderretrieve(java.lang.String id, RequestOptions options)Retrieves the details of an existing order.static Orderretrieve(java.lang.String id, OrderRetrieveParams params, RequestOptions options)Retrieves the details of an existing order.static Orderretrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the details of an existing order.OrderReturnreturnOrder()Return all or part of an order.OrderReturnreturnOrder(RequestOptions options)Return all or part of an order.OrderReturnreturnOrder(OrderReturnOrderParams params)Return all or part of an order.OrderReturnreturnOrder(OrderReturnOrderParams params, RequestOptions options)Return all or part of an order.OrderReturnreturnOrder(java.util.Map<java.lang.String,java.lang.Object> params)Return all or part of an order.OrderReturnreturnOrder(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Return all or part of an order.voidsetAmount(java.lang.Long amount)A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.voidsetAmountReturned(java.lang.Long amountReturned)The total amount that was returned to the customer.voidsetApplication(java.lang.String application)ID of the Connect Application that created the order.voidsetApplicationFee(java.lang.Long applicationFee)A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account.voidsetCharge(java.lang.String id)voidsetChargeObject(Charge expandableObject)voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCurrency(java.lang.String currency)Three-letter ISO currency code, in lowercase.voidsetCustomer(java.lang.String id)voidsetCustomerObject(Customer expandableObject)voidsetEmail(java.lang.String email)The email address of the customer placing the order.voidsetExternalCouponCode(java.lang.String externalCouponCode)External coupon code to load for this order.voidsetId(java.lang.String id)Unique identifier for the object.voidsetItems(java.util.List<OrderItem> items)List of items constituting the order.voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetObject(java.lang.String object)String representing the object's type.voidsetReturns(OrderReturnCollection returns)A list of returns that have taken place for this order.voidsetSelectedShippingMethod(java.lang.String selectedShippingMethod)The shipping method that is currently selected for this order, if any.voidsetShipping(ShippingDetails shipping)The shipping address for the order.voidsetShippingMethods(java.util.List<Order.ShippingMethod> shippingMethods)A list of supported shipping methods for this order.voidsetStatus(java.lang.String status)Current order status.voidsetStatusTransitions(Order.StatusTransitions statusTransitions)The timestamps at which the order status was updated.voidsetUpdated(java.lang.Long updated)Time at which the object was last updated.voidsetUpstreamId(java.lang.String upstreamId)The user's order ID if it is different from the Stripe order ID.Orderupdate(OrderUpdateParams params)Updates the specific order by setting the values of the parameters passed.Orderupdate(OrderUpdateParams params, RequestOptions options)Updates the specific order by setting the values of the parameters passed.Orderupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the specific order by setting the values of the parameters passed.Orderupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates the specific order by setting the values of the parameters passed.-
Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getCharge
public java.lang.String getCharge()
Get ID of expandablechargeobject.
-
setCharge
public void setCharge(java.lang.String id)
-
getChargeObject
public Charge getChargeObject()
Get expandedcharge.
-
setChargeObject
public void setChargeObject(Charge expandableObject)
-
getCustomer
public java.lang.String getCustomer()
Get ID of expandablecustomerobject.
-
setCustomer
public void setCustomer(java.lang.String id)
-
getCustomerObject
public Customer getCustomerObject()
Get expandedcustomer.
-
setCustomerObject
public void setCustomerObject(Customer expandableObject)
-
create
public static Order create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a new order object.- Throws:
StripeException
-
create
public static Order create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a new order object.- Throws:
StripeException
-
create
public static Order create(OrderCreateParams params) throws StripeException
Creates a new order object.- Throws:
StripeException
-
create
public static Order create(OrderCreateParams params, RequestOptions options) throws StripeException
Creates a new order object.- Throws:
StripeException
-
list
public static OrderCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
list
public static OrderCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
list
public static OrderCollection list(OrderListParams params) throws StripeException
Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
list
public static OrderCollection list(OrderListParams params, RequestOptions options) throws StripeException
Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.- Throws:
StripeException
-
retrieve
public static Order retrieve(java.lang.String id) throws StripeException
Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
retrieve
public static Order retrieve(java.lang.String id, RequestOptions options) throws StripeException
Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
retrieve
public static Order retrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
retrieve
public static Order retrieve(java.lang.String id, OrderRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.- Throws:
StripeException
-
update
public Order update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
updatein interfaceMetadataStore<Order>- Throws:
StripeException
-
update
public Order update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
updatein interfaceMetadataStore<Order>- Throws:
StripeException
-
update
public Order update(OrderUpdateParams params) throws StripeException
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
update
public Order update(OrderUpdateParams params, RequestOptions options) throws StripeException
Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
pay
public Order pay() throws StripeException
Pay an order by providing asourceto create a payment.- Throws:
StripeException
-
pay
public Order pay(RequestOptions options) throws StripeException
Pay an order by providing asourceto create a payment.- Throws:
StripeException
-
pay
public Order pay(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Pay an order by providing asourceto create a payment.- Throws:
StripeException
-
pay
public Order pay(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Pay an order by providing asourceto create a payment.- Throws:
StripeException
-
pay
public Order pay(OrderPayParams params) throws StripeException
Pay an order by providing asourceto create a payment.- Throws:
StripeException
-
pay
public Order pay(OrderPayParams params, RequestOptions options) throws StripeException
Pay an order by providing asourceto create a payment.- Throws:
StripeException
-
returnOrder
public OrderReturn returnOrder() throws StripeException
Return all or part of an order. The order must have a status ofpaidorfulfilledbefore it can be returned. Once all items have been returned, the order will becomecanceledorreturneddepending on which status the order started in.- Throws:
StripeException
-
returnOrder
public OrderReturn returnOrder(RequestOptions options) throws StripeException
Return all or part of an order. The order must have a status ofpaidorfulfilledbefore it can be returned. Once all items have been returned, the order will becomecanceledorreturneddepending on which status the order started in.- Throws:
StripeException
-
returnOrder
public OrderReturn returnOrder(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Return all or part of an order. The order must have a status ofpaidorfulfilledbefore it can be returned. Once all items have been returned, the order will becomecanceledorreturneddepending on which status the order started in.- Throws:
StripeException
-
returnOrder
public OrderReturn returnOrder(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Return all or part of an order. The order must have a status ofpaidorfulfilledbefore it can be returned. Once all items have been returned, the order will becomecanceledorreturneddepending on which status the order started in.- Throws:
StripeException
-
returnOrder
public OrderReturn returnOrder(OrderReturnOrderParams params) throws StripeException
Return all or part of an order. The order must have a status ofpaidorfulfilledbefore it can be returned. Once all items have been returned, the order will becomecanceledorreturneddepending on which status the order started in.- Throws:
StripeException
-
returnOrder
public OrderReturn returnOrder(OrderReturnOrderParams params, RequestOptions options) throws StripeException
Return all or part of an order. The order must have a status ofpaidorfulfilledbefore it can be returned. Once all items have been returned, the order will becomecanceledorreturneddepending on which status the order started in.- Throws:
StripeException
-
getAmount
public java.lang.Long getAmount()
A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.
-
getAmountReturned
public java.lang.Long getAmountReturned()
The total amount that was returned to the customer.
-
getApplication
public java.lang.String getApplication()
ID of the Connect Application that created the order.
-
getApplicationFee
public java.lang.Long getApplicationFee()
A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
getEmail
public java.lang.String getEmail()
The email address of the customer placing the order.
-
getExternalCouponCode
public java.lang.String getExternalCouponCode()
External coupon code to load for this order.
-
getItems
public java.util.List<OrderItem> getItems()
List of items constituting the order. An order can have up to 25 items.
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
order.
-
getReturns
public OrderReturnCollection getReturns()
A list of returns that have taken place for this order.
-
getSelectedShippingMethod
public java.lang.String getSelectedShippingMethod()
The shipping method that is currently selected for this order, if any. If present, it is equal to one of theids of shipping methods in theshipping_methodsarray. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method.
-
getShipping
public ShippingDetails getShipping()
The shipping address for the order. Present if the order is for goods to be shipped.
-
getShippingMethods
public java.util.List<Order.ShippingMethod> getShippingMethods()
A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it.
-
getStatus
public java.lang.String getStatus()
Current order status. One ofcreated,paid,canceled,fulfilled, orreturned. More details in the Orders Guide.
-
getStatusTransitions
public Order.StatusTransitions getStatusTransitions()
The timestamps at which the order status was updated.
-
getUpdated
public java.lang.Long getUpdated()
Time at which the object was last updated. Measured in seconds since the Unix epoch.
-
getUpstreamId
public java.lang.String getUpstreamId()
The user's order ID if it is different from the Stripe order ID.
-
setAmount
public void setAmount(java.lang.Long amount)
A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order.
-
setAmountReturned
public void setAmountReturned(java.lang.Long amountReturned)
The total amount that was returned to the customer.
-
setApplication
public void setApplication(java.lang.String application)
ID of the Connect Application that created the order.
-
setApplicationFee
public void setApplicationFee(java.lang.Long applicationFee)
A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
setEmail
public void setEmail(java.lang.String email)
The email address of the customer placing the order.
-
setExternalCouponCode
public void setExternalCouponCode(java.lang.String externalCouponCode)
External coupon code to load for this order.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setItems
public void setItems(java.util.List<OrderItem> items)
List of items constituting the order. An order can have up to 25 items.
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
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.
-
setObject
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.Equal to
order.
-
setReturns
public void setReturns(OrderReturnCollection returns)
A list of returns that have taken place for this order.
-
setSelectedShippingMethod
public void setSelectedShippingMethod(java.lang.String selectedShippingMethod)
The shipping method that is currently selected for this order, if any. If present, it is equal to one of theids of shipping methods in theshipping_methodsarray. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method.
-
setShipping
public void setShipping(ShippingDetails shipping)
The shipping address for the order. Present if the order is for goods to be shipped.
-
setShippingMethods
public void setShippingMethods(java.util.List<Order.ShippingMethod> shippingMethods)
A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it.
-
setStatus
public void setStatus(java.lang.String status)
Current order status. One ofcreated,paid,canceled,fulfilled, orreturned. More details in the Orders Guide.
-
setStatusTransitions
public void setStatusTransitions(Order.StatusTransitions statusTransitions)
The timestamps at which the order status was updated.
-
setUpdated
public void setUpdated(java.lang.Long updated)
Time at which the object was last updated. Measured in seconds since the Unix epoch.
-
setUpstreamId
public void setUpstreamId(java.lang.String upstreamId)
The user's order ID if it is different from the Stripe order ID.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
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.- Specified by:
getMetadatain interfaceMetadataStore<Order>
-
-