Bump stripe-php from 16.4.0 to 17.2.1

This commit is contained in:
johnnyq
2025-05-22 12:37:35 -04:00
parent 5361391b3b
commit 6a368840fa
332 changed files with 4978 additions and 4624 deletions

View File

@@ -15,29 +15,29 @@ namespace Stripe;
* @property int $amount_shipping This is the sum of all the shipping amounts.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property string|\Stripe\Customer $customer ID of the customer.
* @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note.
* @property Customer|string $customer ID of the customer.
* @property null|CustomerBalanceTransaction|string $customer_balance_transaction Customer balance transaction related to this credit note.
* @property int $discount_amount The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.
* @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items.
* @property ((object{amount: int, discount: Discount|string}&StripeObject))[] $discount_amounts The aggregate amounts calculated per discount for all line items.
* @property null|int $effective_at The date when this credit note is in effect. Same as <code>created</code> unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF.
* @property string|\Stripe\Invoice $invoice ID of the invoice.
* @property \Stripe\Collection<\Stripe\CreditNoteLineItem> $lines Line items that make up the credit note
* @property Invoice|string $invoice ID of the invoice.
* @property Collection<CreditNoteLineItem> $lines Line items that make up the credit note
* @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.
* @property null|string $memo Customer-facing text that appears on the credit note PDF.
* @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.
* @property null|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.
* @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
* @property null|int $out_of_band_amount Amount that was credited outside of Stripe.
* @property string $pdf The link to download the PDF of the credit note.
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for all line items.
* @property ((object{amount: int, credit_balance_transaction?: Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for all line items.
* @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
* @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice.
* @property ((object{amount_refunded: int, refund: Refund|string}&StripeObject))[] $refunds Refunds related to this credit note.
* @property null|(object{amount_subtotal: int, amount_tax: int, amount_total: int, shipping_rate: null|ShippingRate|string, taxes?: ((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[]}&StripeObject) $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice.
* @property string $status Status of this credit note, one of <code>issued</code> or <code>void</code>. Learn more about <a href="https://stripe.com/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
* @property int $subtotal The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
* @property null|int $subtotal_excluding_tax The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts.
* @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items.
* @property int $total The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.
* @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts.
* @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $total_taxes The aggregate tax information for all line items.
* @property string $type Type of this credit note, one of <code>pre_payment</code> or <code>post_payment</code>. A <code>pre_payment</code> credit note means it was issued when the invoice was open. A <code>post_payment</code> credit note means it was issued when the invoice was paid.
* @property null|int $voided_at The time that the credit note was voided.
*/
@@ -64,7 +64,7 @@ class CreditNote extends ApiResource
* <code>status=open</code> invoice, a credit note reduces its
* <code>amount_due</code>. For a <code>status=paid</code> invoice, a credit note
* does not affect its <code>amount_due</code>. Instead, it can result in any
* combination of the following:.
* combination of the following:
*
* <ul> <li>Refund: create a new refund (using <code>refund_amount</code>) or link
* an existing refund (using <code>refund</code>).</li> <li>Customer balance
@@ -81,12 +81,12 @@ class CreditNote extends ApiResource
* <code>post_payment_credit_notes_amount</code> depending on its
* <code>status</code> at the time of credit note creation.
*
* @param null|array $params
* @param null|array{amount?: int, credit_amount?: int, effective_at?: int, email_type?: string, expand?: string[], invoice: string, lines?: (array{amount?: int, description?: string, invoice_line_item?: string, quantity?: int, tax_amounts?: null|array{amount: int, tax_rate: string, taxable_amount: int}[], tax_rates?: null|string[], type: string, unit_amount?: int, unit_amount_decimal?: string})[], memo?: string, metadata?: array<string, string>, out_of_band_amount?: int, reason?: string, refund_amount?: int, refunds?: array{amount_refunded?: int, refund?: string}[], shipping_cost?: array{shipping_rate?: string}} $params
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return CreditNote the created resource
*
* @return \Stripe\CreditNote the created resource
* @throws Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
@@ -94,7 +94,7 @@ class CreditNote extends ApiResource
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj = Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
@@ -103,18 +103,18 @@ class CreditNote extends ApiResource
/**
* Returns a list of credit notes.
*
* @param null|array $params
* @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], invoice?: string, limit?: int, starting_after?: string} $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return Collection<CreditNote> of ApiResources
*
* @return \Stripe\Collection<\Stripe\CreditNote> of ApiResources
* @throws Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
return static::_requestPage($url, Collection::class, $params, $opts);
}
/**
@@ -123,13 +123,13 @@ class CreditNote extends ApiResource
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return CreditNote
*
* @return \Stripe\CreditNote
* @throws Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$opts = Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
@@ -140,12 +140,12 @@ class CreditNote extends ApiResource
* Updates an existing credit note.
*
* @param string $id the ID of the resource to update
* @param null|array $params
* @param null|array{expand?: string[], memo?: string, metadata?: array<string, string>} $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return CreditNote the updated resource
*
* @return \Stripe\CreditNote the updated resource
* @throws Exception\ApiErrorException if the request fails
*/
public static function update($id, $params = null, $opts = null)
{
@@ -153,7 +153,7 @@ class CreditNote extends ApiResource
$url = static::resourceUrl($id);
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj = Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
@@ -163,15 +163,15 @@ class CreditNote extends ApiResource
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return CreditNote the previewed credit note
*
* @return \Stripe\CreditNote the previewed credit note
* @throws Exception\ApiErrorException if the request fails
*/
public static function preview($params = null, $opts = null)
{
$url = static::classUrl() . '/preview';
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj = Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
@@ -181,15 +181,15 @@ class CreditNote extends ApiResource
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return Collection<CreditNoteLineItem> list of credit note line items
*
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> list of credit note line items
* @throws Exception\ApiErrorException if the request fails
*/
public static function previewLines($params = null, $opts = null)
{
$url = static::classUrl() . '/preview/lines';
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj = Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
@@ -199,9 +199,9 @@ class CreditNote extends ApiResource
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return CreditNote the voided credit note
*
* @return \Stripe\CreditNote the voided credit note
* @throws Exception\ApiErrorException if the request fails
*/
public function voidCreditNote($params = null, $opts = null)
{
@@ -219,9 +219,9 @@ class CreditNote extends ApiResource
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
* @return Collection<CreditNoteLineItem> the list of credit note line items
*
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> the list of credit note line items
* @throws Exception\ApiErrorException if the request fails
*/
public static function allLines($id, $params = null, $opts = null)
{