From 5a4acd34b20a12764e837ac4d9f2df2e79f1303b Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:46:51 -0700 Subject: [PATCH] Update generated code (#1483) * Update generated code for v307 * Update generated code for v309 * Update generated code for v311 * Update generated code for v313 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/InvoiceLineItem.php | 6 +++--- lib/Service/PaymentIntentService.php | 2 +- lib/TaxRate.php | 2 +- tests/Stripe/GeneratedExamplesTest.php | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9010b7ef9..2b3b8788c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v301 \ No newline at end of file +v313 \ No newline at end of file diff --git a/lib/InvoiceLineItem.php b/lib/InvoiceLineItem.php index d70b18b10..411712190 100644 --- a/lib/InvoiceLineItem.php +++ b/lib/InvoiceLineItem.php @@ -14,7 +14,7 @@ * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property null|string $invoice_item The ID of the invoice item associated with this line item if any. + * @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the invoice item associated with this line item if any. * @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 \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. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. * @property \Stripe\StripeObject $period @@ -23,8 +23,8 @@ * @property bool $proration Whether this is a proration. * @property null|\Stripe\StripeObject $proration_details Additional details for proration line items * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. - * @property null|string $subscription The subscription that the invoice item pertains to, if any. - * @property null|string $subscription_item The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. + * @property null|string|\Stripe\Subscription $subscription The subscription that the invoice item pertains to, if any. + * @property null|string|\Stripe\SubscriptionItem $subscription_item The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. * @property null|\Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. diff --git a/lib/Service/PaymentIntentService.php b/lib/Service/PaymentIntentService.php index f3f81d5cf..787a873f5 100644 --- a/lib/Service/PaymentIntentService.php +++ b/lib/Service/PaymentIntentService.php @@ -45,7 +45,7 @@ public function applyCustomerBalance($id, $params = null, $opts = null) * * Once canceled, no additional charges will be made by the PaymentIntent and any * operations on the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining + * a status of requires_capture, the remaining * amount_capturable will automatically be refunded. * * You cannot cancel the PaymentIntent for a Checkout Session. 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 float $percentage This represents the tax rate percent out of 100. + * @property float $percentage Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. * @property null|string $tax_type The high-level tax type, such as vat or sales_tax. */ diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 7f0ec38af..31852e455 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -2291,6 +2291,20 @@ public function testCreatePlan() static::assertInstanceOf(\Stripe\Plan::class, $result); } + public function testCreatePlan2() + { + $this->expectsRequest('post', '/v1/plans'); + $result = $this->client->plans->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'interval' => 'month', + 'product' => ['name' => 'My product'], + ] + ); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + public function testDeletePlan() { $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx');