PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / vendor / stripe / stripe-php / lib / Order.php

Order.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/stripe/stripe-php/lib/Order.php

123 lines 6.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // File generated from our OpenAPI spec
4
5 namespace Stripe;
6
7 /**
8 * An Order describes a purchase being made by a customer, including the products
9 * &amp; quantities being purchased, the order status, the payment information, and
10 * the billing/shipping details.
11 *
12 * Related guide: <a href="https://stripe.com/docs/orders">Orders overview</a>
13 *
14 * @property string $id Unique identifier for the object.
15 * @property string $object String representing the object's type. Objects of the same type share the same value.
16 * @property int $amount_subtotal Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
17 * @property int $amount_total Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or <a href="https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts">equivalent in charge currency</a>.
18 * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the Order, if any.
19 * @property \Stripe\StripeObject $automatic_tax
20 * @property null|\Stripe\StripeObject $billing_details Customer billing details associated with the order.
21 * @property null|string $client_secret <p>The client secret of this Order. Used for client-side retrieval using a publishable key.</p><p>The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.</p><p>Refer to our docs for <a href="https://stripe.com/docs/orders-beta/create-and-process">creating and processing an order</a> to learn about how client_secret should be handled.</p>
22 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
23 * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
24 * @property null|string|\Stripe\Customer $customer The customer which this orders belongs to.
25 * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
26 * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the order. Use <code>expand[]=discounts</code> to expand each discount.
27 * @property null|string $ip_address A recent IP address of the purchaser used for tax reporting and tax location inference.
28 * @property \Stripe\Collection<\Stripe\LineItem> $line_items A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items.
29 * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
30 * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
31 * @property \Stripe\StripeObject $payment
32 * @property null|\Stripe\StripeObject $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate.
33 * @property null|\Stripe\StripeObject $shipping_details Customer shipping information associated with the order.
34 * @property string $status The overall status of the order.
35 * @property \Stripe\StripeObject $tax_details
36 * @property \Stripe\StripeObject $total_details
37 */
38 class Order extends ApiResource
39 {
40 const OBJECT_NAME = 'order';
41
42 use ApiOperations\All;
43 use ApiOperations\Create;
44 use ApiOperations\Retrieve;
45 use ApiOperations\Update;
46
47 const STATUS_CANCELED = 'canceled';
48 const STATUS_COMPLETE = 'complete';
49 const STATUS_OPEN = 'open';
50 const STATUS_PROCESSING = 'processing';
51 const STATUS_SUBMITTED = 'submitted';
52
53 /**
54 * @param null|array $params
55 * @param null|array|string $opts
56 *
57 * @throws \Stripe\Exception\ApiErrorException if the request fails
58 *
59 * @return \Stripe\Order the canceled order
60 */
61 public function cancel($params = null, $opts = null)
62 {
63 $url = $this->instanceUrl() . '/cancel';
64 list($response, $opts) = $this->_request('post', $url, $params, $opts);
65 $this->refreshFrom($response, $opts);
66
67 return $this;
68 }
69
70 /**
71 * @param string $id
72 * @param null|array $params
73 * @param null|array|string $opts
74 *
75 * @throws \Stripe\Exception\ApiErrorException if the request fails
76 *
77 * @return \Stripe\Collection<\Stripe\LineItem> list of LineItems
78 */
79 public static function allLineItems($id, $params = null, $opts = null)
80 {
81 $url = static::resourceUrl($id) . '/line_items';
82 list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
83 $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
84 $obj->setLastResponse($response);
85
86 return $obj;
87 }
88
89 /**
90 * @param null|array $params
91 * @param null|array|string $opts
92 *
93 * @throws \Stripe\Exception\ApiErrorException if the request fails
94 *
95 * @return \Stripe\Order the reopened order
96 */
97 public function reopen($params = null, $opts = null)
98 {
99 $url = $this->instanceUrl() . '/reopen';
100 list($response, $opts) = $this->_request('post', $url, $params, $opts);
101 $this->refreshFrom($response, $opts);
102
103 return $this;
104 }
105
106 /**
107 * @param null|array $params
108 * @param null|array|string $opts
109 *
110 * @throws \Stripe\Exception\ApiErrorException if the request fails
111 *
112 * @return \Stripe\Order the submited order
113 */
114 public function submit($params = null, $opts = null)
115 {
116 $url = $this->instanceUrl() . '/submit';
117 list($response, $opts) = $this->_request('post', $url, $params, $opts);
118 $this->refreshFrom($response, $opts);
119
120 return $this;
121 }
122 }
123