From 8e36ca309d7e9a4ce07d76434a3fea09dad812eb Mon Sep 17 00:00:00 2001 From: Annie Li Date: Wed, 12 Oct 2022 10:20:33 -0700 Subject: [PATCH] Generate files for next major --- init.php | 2 - lib/Issuing/Authorization.php | 1 + lib/LineItem.php | 1 - lib/Order.php | 122 ------------------------ lib/Service/CoreServiceFactory.php | 2 - lib/Service/OrderService.php | 144 ----------------------------- lib/StripeClient.php | 1 - lib/Util/ObjectTypes.php | 1 - 8 files changed, 1 insertion(+), 273 deletions(-) delete mode 100644 lib/Order.php delete mode 100644 lib/Service/OrderService.php diff --git a/init.php b/init.php index 9d5a325c8..3366b5ebd 100644 --- a/init.php +++ b/init.php @@ -129,7 +129,6 @@ require __DIR__ . '/lib/LineItem.php'; require __DIR__ . '/lib/LoginLink.php'; require __DIR__ . '/lib/Mandate.php'; -require __DIR__ . '/lib/Order.php'; require __DIR__ . '/lib/PaymentIntent.php'; require __DIR__ . '/lib/PaymentLink.php'; require __DIR__ . '/lib/PaymentMethod.php'; @@ -219,7 +218,6 @@ require __DIR__ . '/lib/Service/Issuing/DisputeService.php'; require __DIR__ . '/lib/Service/Issuing/TransactionService.php'; require __DIR__ . '/lib/Service/MandateService.php'; -require __DIR__ . '/lib/Service/OrderService.php'; require __DIR__ . '/lib/Service/PaymentIntentService.php'; require __DIR__ . '/lib/Service/PaymentLinkService.php'; require __DIR__ . '/lib/Service/PaymentMethodService.php'; diff --git a/lib/Issuing/Authorization.php b/lib/Issuing/Authorization.php index 7e6ff679b..8bc4a9a4a 100644 --- a/lib/Issuing/Authorization.php +++ b/lib/Issuing/Authorization.php @@ -30,6 +30,7 @@ * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property \Stripe\StripeObject $merchant_data * @property \Stripe\StripeObject $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. + * @property null|\Stripe\StripeObject $network_data Details about the authorization, such as identifiers, set by the card network. * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. * @property \Stripe\StripeObject[] $request_history History of every time pending_request was approved/denied, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. * @property string $status The current status of the authorization in its lifecycle. diff --git a/lib/LineItem.php b/lib/LineItem.php index 845ff0173..63c5ca2ec 100644 --- a/lib/LineItem.php +++ b/lib/LineItem.php @@ -17,7 +17,6 @@ * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. * @property \Stripe\StripeObject[] $discounts The discounts applied to the line item. * @property null|\Stripe\Price $price The price used to generate the line item. - * @property string|\Stripe\Product $product

The ID of the product for this line item.

This will always be the same as price.product.

* @property null|int $quantity The quantity of products being purchased. * @property \Stripe\StripeObject[] $taxes The taxes applied to the line item. */ diff --git a/lib/Order.php b/lib/Order.php deleted file mode 100644 index d9af3dfc5..000000000 --- a/lib/Order.php +++ /dev/null @@ -1,122 +0,0 @@ -Orders overview - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount_subtotal Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - * @property int $amount_total Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the smallest currency unit (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 equivalent in charge currency. - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the Order, if any. - * @property \Stripe\StripeObject $automatic_tax - * @property null|\Stripe\StripeObject $billing_details Customer billing details associated with the order. - * @property null|string $client_secret

The client secret of this Order. Used for client-side retrieval using a publishable key.

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.

Refer to our docs for creating and processing an order to learn about how client_secret should be handled.

- * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The customer which this orders belongs to. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the order. Use expand[]=discounts to expand each discount. - * @property null|string $ip_address A recent IP address of the purchaser used for tax reporting and tax location inference. - * @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. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $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. - * @property \Stripe\StripeObject $payment - * @property null|\Stripe\StripeObject $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate. - * @property null|\Stripe\StripeObject $shipping_details Customer shipping information associated with the order. - * @property string $status The overall status of the order. - * @property \Stripe\StripeObject $tax_details - * @property \Stripe\StripeObject $total_details - */ -class Order extends ApiResource -{ - const OBJECT_NAME = 'order'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_COMPLETE = 'complete'; - const STATUS_OPEN = 'open'; - const STATUS_PROCESSING = 'processing'; - const STATUS_SUBMITTED = 'submitted'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order the canceled order - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param string $id - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\LineItem> list of LineItems - */ - public static function allLineItems($id, $params = null, $opts = null) - { - $url = static::resourceUrl($id) . '/line_items'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order the reopened order - */ - public function reopen($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/reopen'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order the submited order - */ - public function submit($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/submit'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index ce9676c21..5a67e662d 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -34,7 +34,6 @@ * @property Issuing\IssuingServiceFactory $issuing * @property MandateService $mandates * @property OAuthService $oauth - * @property OrderService $orders * @property PaymentIntentService $paymentIntents * @property PaymentLinkService $paymentLinks * @property PaymentMethodService $paymentMethods @@ -100,7 +99,6 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory 'issuing' => Issuing\IssuingServiceFactory::class, 'mandates' => MandateService::class, 'oauth' => OAuthService::class, - 'orders' => OrderService::class, 'paymentIntents' => PaymentIntentService::class, 'paymentLinks' => PaymentLinkService::class, 'paymentMethods' => PaymentMethodService::class, diff --git a/lib/Service/OrderService.php b/lib/Service/OrderService.php deleted file mode 100644 index 89de15fe8..000000000 --- a/lib/Service/OrderService.php +++ /dev/null @@ -1,144 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/orders', $params, $opts); - } - - /** - * When retrieving an order, there is an includable line_items - * property containing the first handful of those items. There is also a URL where - * you can retrieve the full (paginated) list of line items. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\LineItem> - */ - public function allLineItems($id, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/orders/%s/line_items', $id), $params, $opts); - } - - /** - * Cancels the order as well as the payment intent if one is attached. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/cancel', $id), $params, $opts); - } - - /** - * Creates a new open order object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/orders', $params, $opts); - } - - /** - * Reopens a submitted order. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function reopen($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/reopen', $id), $params, $opts); - } - - /** - * 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. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } - - /** - * Submitting an Order transitions the status to processing and - * creates a PaymentIntent object so the order can be paid. If the Order has an - * amount_total of 0, no PaymentIntent object will be created. Once - * the order is submitted, its contents cannot be changed, unless the reopen method is called. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function submit($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/submit', $id), $params, $opts); - } - - /** - * Updates the specific order by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } -} diff --git a/lib/StripeClient.php b/lib/StripeClient.php index 05989ff62..22a83a8df 100644 --- a/lib/StripeClient.php +++ b/lib/StripeClient.php @@ -34,7 +34,6 @@ * @property \Stripe\Service\Issuing\IssuingServiceFactory $issuing * @property \Stripe\Service\MandateService $mandates * @property \Stripe\Service\OAuthService $oauth - * @property \Stripe\Service\OrderService $orders * @property \Stripe\Service\PaymentIntentService $paymentIntents * @property \Stripe\Service\PaymentLinkService $paymentLinks * @property \Stripe\Service\PaymentMethodService $paymentMethods diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index a94b58291..5e0b4d3d1 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -61,7 +61,6 @@ class ObjectTypes \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, - \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class,