Class Order

All Implemented Interfaces:
HasId, MetadataStore<Order>, StripeActiveObject, StripeObjectInterface

public class Order extends ApiResource implements HasId, MetadataStore<Order>
Orders represent your intent to purchase a particular Climate product. When you create an order, the payment is deducted from your merchant balance.
  • Constructor Details

    • Order

      public Order()
  • Method Details

    • getProduct

      public String getProduct()
      Get ID of expandable product object.
    • setProduct

      public void setProduct(String id)
    • getProductObject

      public Product getProductObject()
      Get expanded product.
    • setProductObject

      public void setProductObject(Product expandableObject)
    • cancel

      public Order cancel() throws StripeException
      Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.
      Throws:
      StripeException
    • cancel

      public Order cancel(RequestOptions options) throws StripeException
      Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.
      Throws:
      StripeException
    • cancel

      public Order cancel(Map<String,Object> params) throws StripeException
      Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.
      Throws:
      StripeException
    • cancel

      public Order cancel(Map<String,Object> params, RequestOptions options) throws StripeException
      Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.
      Throws:
      StripeException
    • cancel

      public Order cancel(OrderCancelParams params) throws StripeException
      Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.
      Throws:
      StripeException
    • cancel

      public Order cancel(OrderCancelParams params, RequestOptions options) throws StripeException
      Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total.
      Throws:
      StripeException
    • create

      public static Order create(Map<String,Object> params) throws StripeException
      Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance.
      Throws:
      StripeException
    • create

      public static Order create(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance.
      Throws:
      StripeException
    • create

      public static Order create(OrderCreateParams params) throws StripeException
      Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance.
      Throws:
      StripeException
    • create

      public static Order create(OrderCreateParams params, RequestOptions options) throws StripeException
      Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance.
      Throws:
      StripeException
    • list

      public static OrderCollection list(Map<String,Object> params) throws StripeException
      Lists all Climate order objects. The orders are returned sorted by creation date, with the most recently created orders appearing first.
      Throws:
      StripeException
    • list

      public static OrderCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      Lists all Climate order objects. 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
      Lists all Climate order objects. 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
      Lists all Climate order objects. The orders are returned sorted by creation date, with the most recently created orders appearing first.
      Throws:
      StripeException
    • retrieve

      public static Order retrieve(String order) throws StripeException
      Retrieves the details of a Climate order object with the given ID.
      Throws:
      StripeException
    • retrieve

      public static Order retrieve(String order, RequestOptions options) throws StripeException
      Retrieves the details of a Climate order object with the given ID.
      Throws:
      StripeException
    • retrieve

      public static Order retrieve(String order, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves the details of a Climate order object with the given ID.
      Throws:
      StripeException
    • retrieve

      public static Order retrieve(String order, OrderRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves the details of a Climate order object with the given ID.
      Throws:
      StripeException
    • update

      public Order update(Map<String,Object> params) throws StripeException
      Updates the specified order by setting the values of the parameters passed.
      Specified by:
      update in interface MetadataStore<Order>
      Throws:
      StripeException
    • update

      public Order update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates the specified order by setting the values of the parameters passed.
      Specified by:
      update in interface MetadataStore<Order>
      Throws:
      StripeException
    • update

      public Order update(OrderUpdateParams params) throws StripeException
      Updates the specified order by setting the values of the parameters passed.
      Throws:
      StripeException
    • update

      public Order update(OrderUpdateParams params, RequestOptions options) throws StripeException
      Updates the specified order by setting the values of the parameters passed.
      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      The state/county/province/region where the supplier is located.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getAmountFees

      public Long getAmountFees()
      Total amount of Frontier's service fees in the currency's smallest unit.
    • getAmountSubtotal

      public Long getAmountSubtotal()
      Total amount of the carbon removal in the currency's smallest unit.
    • getAmountTotal

      public Long getAmountTotal()
      Total amount of the order including fees in the currency's smallest unit.
    • getBeneficiary

      public Order.Beneficiary getBeneficiary()
    • getCanceledAt

      public Long getCanceledAt()
      Time at which the order was canceled. Measured in seconds since the Unix epoch.
    • getCancellationReason

      public String getCancellationReason()
      Reason for the cancellation of this order.

      One of expired, product_unavailable, or requested.

    • getCertificate

      public String getCertificate()
      For delivered orders, a URL to a delivery certificate for the order.
    • getConfirmedAt

      public Long getConfirmedAt()
      Time at which the order was confirmed. Measured in seconds since the Unix epoch.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getCurrency

      public String getCurrency()
      Three-letter ISO currency code, in lowercase, representing the currency for this order.
    • getDelayedAt

      public Long getDelayedAt()
      Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch.
    • getDeliveredAt

      public Long getDeliveredAt()
      Time at which the order was delivered. Measured in seconds since the Unix epoch.
    • getDeliveryDetails

      public List<Order.DeliveryDetail> getDeliveryDetails()
      Details about the delivery of carbon removal for this order.
    • getExpectedDeliveryYear

      public Long getExpectedDeliveryYear()
      The year this order is expected to be delivered.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getMetricTons

      public BigDecimal getMetricTons()
      Quantity of carbon removal that is included in this order.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to climate.order.

    • getProductSubstitutedAt

      public Long getProductSubstitutedAt()
      Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch.
    • getStatus

      public String getStatus()
      The current status of this order.

      One of awaiting_funds, canceled, confirmed, delivered, or open.

    • setAmountFees

      public void setAmountFees(Long amountFees)
      Total amount of Frontier's service fees in the currency's smallest unit.
    • setAmountSubtotal

      public void setAmountSubtotal(Long amountSubtotal)
      Total amount of the carbon removal in the currency's smallest unit.
    • setAmountTotal

      public void setAmountTotal(Long amountTotal)
      Total amount of the order including fees in the currency's smallest unit.
    • setBeneficiary

      public void setBeneficiary(Order.Beneficiary beneficiary)
    • setCanceledAt

      public void setCanceledAt(Long canceledAt)
      Time at which the order was canceled. Measured in seconds since the Unix epoch.
    • setCancellationReason

      public void setCancellationReason(String cancellationReason)
      Reason for the cancellation of this order.

      One of expired, product_unavailable, or requested.

    • setCertificate

      public void setCertificate(String certificate)
      For delivered orders, a URL to a delivery certificate for the order.
    • setConfirmedAt

      public void setConfirmedAt(Long confirmedAt)
      Time at which the order was confirmed. Measured in seconds since the Unix epoch.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase, representing the currency for this order.
    • setDelayedAt

      public void setDelayedAt(Long delayedAt)
      Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch.
    • setDeliveredAt

      public void setDeliveredAt(Long deliveredAt)
      Time at which the order was delivered. Measured in seconds since the Unix epoch.
    • setDeliveryDetails

      public void setDeliveryDetails(List<Order.DeliveryDetail> deliveryDetails)
      Details about the delivery of carbon removal for this order.
    • setExpectedDeliveryYear

      public void setExpectedDeliveryYear(Long expectedDeliveryYear)
      The year this order is expected to be delivered.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMetadata

      public void setMetadata(Map<String,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.
    • setMetricTons

      public void setMetricTons(BigDecimal metricTons)
      Quantity of carbon removal that is included in this order.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to climate.order.

    • setProductSubstitutedAt

      public void setProductSubstitutedAt(Long productSubstitutedAt)
      Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch.
    • setStatus

      public void setStatus(String status)
      The current status of this order.

      One of awaiting_funds, canceled, confirmed, delivered, or open.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,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:
      getMetadata in interface MetadataStore<Order>