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

Update generated code for beta #1622

Merged
merged 13 commits into from
Dec 22, 2023
Merged
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 13.7.0 - 2023-12-22
* [#1621](https://github.com/stripe/stripe-php/pull/1621) Update generated code
* Add support for new resource `FinancialConnections.Transaction`
* Add support for `all` and `retrieve` methods on resource `Transaction`
* Add support for `subscribe` and `unsubscribe` methods on resource `FinancialConnections.Account`
* Add support for new value `financial_connections.account.refreshed_transactions` on enum `Event.type`
* Add support for `subscriptions` and `transaction_refresh` on `FinancialConnections.Account`
* Add support for new value `transactions` on enum `FinancialConnections.Session.prefetch[]`
* Add support for `revolut_pay` on `PaymentMethodConfiguration`
* Remove support for `id_bank_transfer`, `multibanco`, `netbanking`, `pay_by_bank`, and `upi` on `PaymentMethodConfiguration`
* Change type of `Quote.invoice_settings` from `nullable(InvoiceSettingQuoteSetting)` to `InvoiceSettingQuoteSetting`
* Add support for `destination_details` on `Refund`

## 13.7.0-beta.1 - 2023-12-08
* [#1617](https://github.com/stripe/stripe-php/pull/1617) Update generated code for beta
* Add support for `retrieve` method on resource `FinancialConnections.Transaction`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v710
v737
2 changes: 1 addition & 1 deletion lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* @property null|\Stripe\StripeObject $shipping_details Shipping information for this Checkout Session.
* @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to this Session.
* @property null|string $status The status of the Checkout Session, one of <code>open</code>, <code>complete</code>, or <code>expired</code>.
* @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. <code>submit_type</code> can only be specified on Checkout Sessions in <code>payment</code> mode, but not Checkout Sessions in <code>subscription</code> or <code>setup</code> mode.
* @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. <code>submit_type</code> can only be specified on Checkout Sessions in <code>payment</code> mode, but not Checkout Sessions in <code>subscription</code> or <code>setup</code> mode. Possible values are <code>auto</code>, <code>pay</code>, <code>book</code>, <code>donate</code>. If blank or <code>auto</code>, <code>pay</code> is used.
* @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in <code>subscription</code> mode.
* @property null|string $success_url The URL the customer will be directed to after the payment or subscription creation is successful.
* @property null|\Stripe\StripeObject $tax_id_collection
Expand Down
2 changes: 2 additions & 0 deletions lib/ConfirmationToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* to your server for confirming a PaymentIntent or SetupIntent. If the confirmation
* is successful, values present on the ConfirmationToken are written onto the Intent.
*
* To learn more or request access, visit the related guided: <a href="https://stripe.com/docs/payments/finalize-payments-on-the-server-confirmation-tokens">Finalize payments on the server using Confirmation Tokens</a>.
*
* @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 $created Time at which the object was created. Measured in seconds since the Unix epoch.
Expand Down
1 change: 1 addition & 0 deletions lib/ErrorObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class ErrorObject extends StripeObject
const CODE_SETUP_INTENT_MANDATE_INVALID = 'setup_intent_mandate_invalid';
const CODE_SETUP_INTENT_SETUP_ATTEMPT_EXPIRED = 'setup_intent_setup_attempt_expired';
const CODE_SETUP_INTENT_UNEXPECTED_STATE = 'setup_intent_unexpected_state';
const CODE_SHIPPING_ADDRESS_INVALID = 'shipping_address_invalid';
const CODE_SHIPPING_CALCULATION_FAILED = 'shipping_calculation_failed';
const CODE_SKU_INACTIVE = 'sku_inactive';
const CODE_STATE_UNSUPPORTED = 'state_unsupported';
Expand Down
2 changes: 1 addition & 1 deletion lib/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* This object represents files hosted on Stripe's servers. You can upload
* files with the <a href="https://stripe.com/docs/api#create_file">create file</a> request
* (for example, when uploading dispute evidence). Stripe also
* creates files independetly (for example, the results of a <a href="#scheduled_queries">Sigma scheduled
* creates files independently (for example, the results of a <a href="#scheduled_queries">Sigma scheduled
* query</a>).
*
* Related guide: <a href="https://stripe.com/docs/file-upload">File upload guide</a>
Expand Down
2 changes: 1 addition & 1 deletion lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
* @property null|\Stripe\StripeObject $from_invoice Details of the invoice that was cloned. See the <a href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more details.
* @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
* @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
* @property null|\Stripe\StripeObject $issuer The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
* @property null|\Stripe\StripeObject $issuer
* @property null|\Stripe\StripeObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
* @property null|string|\Stripe\Invoice $latest_revision The ID of the most recent non-draft revision of this invoice
* @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. <code>lines</code> is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
Expand Down
1 change: 1 addition & 0 deletions lib/PaymentMethodConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
* @property null|\Stripe\StripeObject $paynow
* @property null|\Stripe\StripeObject $paypal
* @property null|\Stripe\StripeObject $promptpay
* @property null|\Stripe\StripeObject $revolut_pay
* @property null|\Stripe\StripeObject $sepa_debit
* @property null|\Stripe\StripeObject $sofort
* @property null|\Stripe\StripeObject $upi
Expand Down
2 changes: 1 addition & 1 deletion lib/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @property null|\Stripe\StripeObject $from_quote Details of the quote that was cloned. See the <a href="https://stripe.com/docs/quotes/clone">cloning documentation</a> for more details.
* @property null|string $header A header that will be displayed on the quote PDF.
* @property null|string|\Stripe\Invoice $invoice The invoice that was created from this quote.
* @property null|\Stripe\StripeObject $invoice_settings All invoices will be billed using the specified settings.
* @property \Stripe\StripeObject $invoice_settings
* @property null|\Stripe\Collection<\Stripe\LineItem> $line_items A list of items the customer is being quoted for.
* @property null|string[] $lines A list of lines on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
* @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.
Expand Down
2 changes: 1 addition & 1 deletion lib/QuotePreviewInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
* @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
* @property null|string $footer Footer displayed on the invoice.
* @property null|\Stripe\StripeObject $from_invoice Details of the invoice that was cloned. See the <a href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more details.
* @property null|\Stripe\StripeObject $issuer The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
* @property null|\Stripe\StripeObject $issuer
* @property null|\Stripe\StripeObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
* @property null|string|\Stripe\Invoice $latest_revision The ID of the most recent non-draft revision of this invoice
* @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. <code>lines</code> is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
Expand Down
1 change: 1 addition & 0 deletions lib/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @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 null|string $description An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only).
* @property null|\Stripe\StripeObject $destination_details
* @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.
* @property null|string $failure_reason Provides the reason for the refund failure. Possible values are: <code>lost_or_stolen_card</code>, <code>expired_or_canceled_card</code>, <code>charge_for_pending_refund_disputed</code>, <code>insufficient_funds</code>, <code>declined</code>, <code>merchant_request</code>, or <code>unknown</code>.
* @property null|string $instructions_email For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.
Expand Down
1 change: 1 addition & 0 deletions lib/Tax/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @property null|int $expires_at Timestamp of date at which the tax calculation will expire.
* @property null|\Stripe\Collection<\Stripe\Tax\CalculationLineItem> $line_items The list of items the customer is purchasing.
* @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|\Stripe\StripeObject $ship_from_details The details of the ship from location, such as the address.
* @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the calculation.
* @property int $tax_amount_exclusive The amount of tax to be collected on top of the line item prices.
* @property int $tax_amount_inclusive The amount of tax already included in the line item prices.
Expand Down
1 change: 1 addition & 0 deletions lib/Tax/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* @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 string $reference A custom unique identifier, such as 'myOrder_123'.
* @property null|\Stripe\StripeObject $reversal If <code>type=reversal</code>, contains information about what was reversed.
* @property null|\Stripe\StripeObject $ship_from_details The details of the ship from location, such as the address.
* @property null|\Stripe\StripeObject $shipping_cost The shipping cost details for the transaction.
* @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation.
* @property string $type If <code>reversal</code>, this transaction reverses an earlier transaction.
Expand Down
97 changes: 97 additions & 0 deletions tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,32 @@ public function testFinancialConnectionsAccountsRefreshPost()
static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result);
}

public function testFinancialConnectionsAccountsSubscribePost()
{
$this->expectsRequest(
'post',
'/v1/financial_connections/accounts/fa_123/subscribe'
);
$result = $this->client->financialConnections->accounts->subscribe(
'fa_123',
['features' => ['transactions']]
);
static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result);
}

public function testFinancialConnectionsAccountsUnsubscribePost()
{
$this->expectsRequest(
'post',
'/v1/financial_connections/accounts/fa_123/unsubscribe'
);
$result = $this->client->financialConnections->accounts->unsubscribe(
'fa_123',
['features' => ['transactions']]
);
static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result);
}

public function testFinancialConnectionsSessionsGet()
{
$this->expectsRequest(
Expand Down Expand Up @@ -1189,6 +1215,29 @@ public function testFinancialConnectionsSessionsPost2()
static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result);
}

public function testFinancialConnectionsTransactionsGet()
{
$this->expectsRequest(
'get',
'/v1/financial_connections/transactions/tr_123'
);
$result = $this->client->financialConnections->transactions->retrieve(
'tr_123',
[]
);
static::assertInstanceOf(\Stripe\FinancialConnections\Transaction::class, $result);
}

public function testFinancialConnectionsTransactionsGet2()
{
$this->expectsRequest('get', '/v1/financial_connections/transactions');
$result = $this->client->financialConnections->transactions->all([
'account' => 'fca_xyz',
]);
static::assertInstanceOf(\Stripe\Collection::class, $result);
static::assertInstanceOf(\Stripe\FinancialConnections\Transaction::class, $result->data[0]);
}

public function testIdentityVerificationReportsGet()
{
$this->expectsRequest('get', '/v1/identity/verification_reports');
Expand Down Expand Up @@ -3153,6 +3202,54 @@ public function testTaxRatesPost2()
static::assertInstanceOf(\Stripe\TaxRate::class, $result);
}

public function testTaxRegistrationsGet()
{
$this->expectsRequest('get', '/v1/tax/registrations');
$result = $this->client->tax->registrations->all(['status' => 'all']);
static::assertInstanceOf(\Stripe\Collection::class, $result);
static::assertInstanceOf(\Stripe\Tax\Registration::class, $result->data[0]);
}

public function testTaxRegistrationsPost()
{
$this->expectsRequest('post', '/v1/tax/registrations');
$result = $this->client->tax->registrations->create([
'country' => 'IE',
'country_options' => ['ie' => ['type' => 'oss_union']],
'active_from' => 'now',
]);
static::assertInstanceOf(\Stripe\Tax\Registration::class, $result);
}

public function testTaxRegistrationsPost2()
{
$this->expectsRequest(
'post',
'/v1/tax/registrations/taxreg_xxxxxxxxxxxxx'
);
$result = $this->client->tax->registrations->update(
'taxreg_xxxxxxxxxxxxx',
['expires_at' => 'now']
);
static::assertInstanceOf(\Stripe\Tax\Registration::class, $result);
}

public function testTaxSettingsGet()
{
$this->expectsRequest('get', '/v1/tax/settings');
$result = $this->client->tax->settings->retrieve([]);
static::assertInstanceOf(\Stripe\Tax\Settings::class, $result);
}

public function testTaxSettingsPost()
{
$this->expectsRequest('post', '/v1/tax/settings');
$result = $this->client->tax->settings->update([
'defaults' => ['tax_code' => 'txcd_10000000'],
]);
static::assertInstanceOf(\Stripe\Tax\Settings::class, $result);
}

public function testTaxTransactionsCreateFromCalculationPost()
{
$this->expectsRequest(
Expand Down
Loading