Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates #1316

Merged
merged 4 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v157
v161
4 changes: 4 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

// File generated from our OpenAPI spec

require __DIR__ . '/lib/Util/ApiVersion.php';

// Stripe singleton
require __DIR__ . '/lib/Stripe.php';

Expand Down Expand Up @@ -254,6 +256,7 @@
require __DIR__ . '/lib/Service/Terminal/LocationService.php';
require __DIR__ . '/lib/Service/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php';
require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php';
require __DIR__ . '/lib/Service/TestHelpers/RefundService.php';
require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php';
require __DIR__ . '/lib/Service/TestHelpers/TestClockService.php';
Expand Down Expand Up @@ -289,6 +292,7 @@
require __DIR__ . '/lib/Service/Reporting/ReportingServiceFactory.php';
require __DIR__ . '/lib/Service/Sigma/SigmaServiceFactory.php';
require __DIR__ . '/lib/Service/Terminal/TerminalServiceFactory.php';
require __DIR__ . '/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php';
require __DIR__ . '/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php';
require __DIR__ . '/lib/Service/TestHelpers/TestHelpersServiceFactory.php';
require __DIR__ . '/lib/Service/TestHelpers/Treasury/TreasuryServiceFactory.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @property null|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 null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in <code>payment</code> or <code>subscription</code> mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created.
* @property null|string $customer_creation Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
* @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in <code>payment</code> or <code>subscription</code> mode.
* @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in <code>setup</code> mode.
* @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the <code>customer</code> attribute.
* @property int $expires_at The timestamp at which the Checkout Session will expire.
* @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items purchased by the customer.
Expand Down
1 change: 1 addition & 0 deletions lib/CreditNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
* @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 %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
* @property null|int $subtotal_excluding_tax The integer amount in %s 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 %s representing the total amount of the credit note, including tax and all discount.
* @property null|int $total_excluding_tax The integer amount in %s representing the total amount of the credit note, excluding tax, but including discounts.
Expand Down
2 changes: 2 additions & 0 deletions lib/CreditNoteLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @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 The integer amount in %s representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
* @property null|int $amount_excluding_tax The integer amount in %s representing the amount being credited for this line item, excluding all tax and discounts.
* @property null|string $description Description of the item being credited.
* @property int $discount_amount The integer amount in %s representing the discount being credited for this line item.
* @property \Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item
Expand All @@ -19,6 +20,7 @@
* @property string $type The type of the credit note line item, one of <code>invoice_line_item</code> or <code>custom_line_item</code>. When the type is <code>invoice_line_item</code> there is an additional <code>invoice_line_item</code> property on the resource the value of which is the id of the credited line item on the invoice.
* @property null|int $unit_amount The cost of each unit of product being credited.
* @property null|string $unit_amount_decimal Same as <code>unit_amount</code>, but contains a decimal value with at most 12 decimal places.
* @property null|string $unit_amount_excluding_tax The amount in %s representing the unit amount being credited for this line item, excluding all tax and discounts.
*/
class CreditNoteLineItem extends ApiResource
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public function deleteDiscount($params = null, $opts = null)
}

/**
* @param string $id
* @param null|array $params
* @param null|array|string $opts
* @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
2 changes: 1 addition & 1 deletion lib/FinancialConnections/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public function disconnect($params = null, $opts = null)
}

/**
* @param string $id
* @param null|array $params
* @param null|array|string $opts
* @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@
* @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any.
* @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
* @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
* @property null|int $subtotal_excluding_tax The integer amount in %s representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
* @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to.
* @property \Stripe\StripeObject $threshold_reason
* @property int $total Total after discounts and taxes.
* @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items.
* @property null|int $total_excluding_tax The integer amount in %s representing the total amount of the invoice including all discounts but excluding all tax.
* @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items.
* @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have <a href="https://stripe.com/docs/billing/webhooks#understand">been exhausted</a>. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
*/
Expand Down
2 changes: 2 additions & 0 deletions lib/InvoiceLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @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 The amount, in %s.
* @property null|int $amount_excluding_tax The integer amount in %s representing the amount for this line item, excluding all tax and discounts.
* @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 null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item.
Expand All @@ -27,6 +28,7 @@
* @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item
* @property \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 <code>invoiceitem</code> or a <code>subscription</code>.
* @property null|string $unit_amount_excluding_tax The amount in %s representing the unit amount for this line item, excluding all tax and discounts.
*/
class InvoiceLineItem extends ApiResource
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public function cancel($params = null, $opts = null)
}

/**
* @param string $id
* @param null|array $params
* @param null|array|string $opts
* @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
2 changes: 1 addition & 1 deletion lib/PaymentLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class PaymentLink extends ApiResource
const SUBMIT_TYPE_PAY = 'pay';

/**
* @param string $id
* @param null|array $params
* @param null|array|string $opts
* @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
1 change: 1 addition & 0 deletions lib/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* @property \Stripe\StripeObject $oxxo
* @property \Stripe\StripeObject $p24
* @property \Stripe\StripeObject $paynow
* @property \Stripe\StripeObject $promptpay
* @property \Stripe\StripeObject $radar_options Options to configure Radar. See <a href="https://stripe.com/docs/radar/radar-session">Radar Session</a> for more information.
* @property \Stripe\StripeObject $sepa_debit
* @property \Stripe\StripeObject $sofort
Expand Down
4 changes: 2 additions & 2 deletions lib/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ public function finalizeQuote($params = null, $opts = null)
}

/**
* @param string $id
* @param null|array $params
* @param null|array|string $opts
* @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand All @@ -151,9 +151,9 @@ public static function allComputedUpfrontLineItems($id, $params = null, $opts =
}

/**
* @param string $id
* @param null|array $params
* @param null|array|string $opts
* @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/CreditNoteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function preview($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\CreditNote>
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem>
*/
public function previewLines($params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function allBalanceTransactions($parentId, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Customer>
* @return \Stripe\Collection<\Stripe\PaymentMethod>
*/
public function allPaymentMethods($id, $params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/FinancialConnections/AccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function all($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FinancialConnections\Account>
* @return \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner>
*/
public function allOwners($id, $params = null, $opts = null)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/InvoiceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function all($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\LineItem>
* @return \Stripe\Collection<\Stripe\InvoiceLineItem>
*/
public function allLines($parentId, $params = null, $opts = null)
{
Expand Down Expand Up @@ -241,7 +241,7 @@ public function upcoming($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Invoice>
* @return \Stripe\Collection<\Stripe\InvoiceLineItem>
*/
public function upcomingLines($params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function all($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Order>
* @return \Stripe\Collection<\Stripe\LineItem>
*/
public function allLineItems($id, $params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/PaymentLinkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function all($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\PaymentLink>
* @return \Stripe\Collection<\Stripe\LineItem>
*/
public function allLineItems($id, $params = null, $opts = null)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/QuoteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function all($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Quote>
* @return \Stripe\Collection<\Stripe\LineItem>
*/
public function allComputedUpfrontLineItems($id, $params = null, $opts = null)
{
Expand All @@ -67,7 +67,7 @@ public function allComputedUpfrontLineItems($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Quote>
* @return \Stripe\Collection<\Stripe\LineItem>
*/
public function allLineItems($id, $params = null, $opts = null)
{
Expand Down
76 changes: 76 additions & 0 deletions lib/Service/TestHelpers/Issuing/CardService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\TestHelpers\Issuing;

class CardService extends \Stripe\Service\AbstractService
{
/**
* Updates the shipping status of the specified Issuing <code>Card</code> object to
* <code>delivered</code>.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\Card
*/
public function deliverCard($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/deliver', $id), $params, $opts);
}

/**
* Updates the shipping status of the specified Issuing <code>Card</code> object to
* <code>failure</code>.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\Card
*/
public function failCard($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/fail', $id), $params, $opts);
}

/**
* Updates the shipping status of the specified Issuing <code>Card</code> object to
* <code>returned</code>.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\Card
*/
public function returnCard($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/return', $id), $params, $opts);
}

/**
* Updates the shipping status of the specified Issuing <code>Card</code> object to
* <code>shipped</code>.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Issuing\Card
*/
public function shipCard($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/ship', $id), $params, $opts);
}
}
25 changes: 25 additions & 0 deletions lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\TestHelpers\Issuing;

/**
* Service factory class for API resources in the Issuing namespace.
*
* @property CardService $cards
*/
class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
/**
* @var array<string, string>
*/
private static $classMap = [
'cards' => CardService::class,
];

protected function getServiceClass($name)
{
return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null;
}
}
2 changes: 2 additions & 0 deletions lib/Service/TestHelpers/TestHelpersServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Service factory class for API resources in the TestHelpers namespace.
*
* @property CustomerService $customers
* @property Issuing\IssuingServiceFactory $issuing
* @property RefundService $refunds
* @property Terminal\TerminalServiceFactory $terminal
* @property TestClockService $testClocks
Expand All @@ -20,6 +21,7 @@ class TestHelpersServiceFactory extends \Stripe\Service\AbstractServiceFactory
*/
private static $classMap = [
'customers' => CustomerService::class,
'issuing' => Issuing\IssuingServiceFactory::class,
'refunds' => RefundService::class,
'terminal' => Terminal\TerminalServiceFactory::class,
'testClocks' => TestClockService::class,
Expand Down
2 changes: 2 additions & 0 deletions lib/Treasury/ReceivedCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
* @property string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|string $failure_code Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen.
* @property null|string $financial_account The FinancialAccount that received the funds.
* @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
* @property \Stripe\StripeObject $initiating_payment_method_details
* @property \Stripe\StripeObject $linked_flows
* @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 string $network The rails used to send the funds.
* @property null|\Stripe\StripeObject $reversal_details Details describing when a ReceivedCredit may be reversed.
* @property string $status Status of the ReceivedCredit. ReceivedCredits are created either <code>succeeded</code> (approved) or <code>failed</code> (declined). If a ReceivedCredit is declined, the failure reason can be found in the <code>failure_code</code> field.
* @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object.
*/
Expand Down
Loading