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 #1596

Merged
merged 10 commits into from
Oct 26, 2023
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 13.1.0 - 2023-10-26
* [#1595](https://github.com/stripe/stripe-php/pull/1595) Update generated code
* Add support for new value `balance_invalid_parameter` on enum `StripeError.code`

## 13.1.0-beta.1 - 2023-10-17
* [#1594](https://github.com/stripe/stripe-php/pull/1594) Update generated code for beta
- Update pinned API version to `2023-10-16`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v603
v627
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
require __DIR__ . '/lib/LineItem.php';
require __DIR__ . '/lib/LoginLink.php';
require __DIR__ . '/lib/Mandate.php';
require __DIR__ . '/lib/Margin.php';
require __DIR__ . '/lib/Order.php';
require __DIR__ . '/lib/PaymentIntent.php';
require __DIR__ . '/lib/PaymentLink.php';
Expand Down Expand Up @@ -225,6 +226,7 @@
require __DIR__ . '/lib/Service/Issuing/TokenService.php';
require __DIR__ . '/lib/Service/Issuing/TransactionService.php';
require __DIR__ . '/lib/Service/MandateService.php';
require __DIR__ . '/lib/Service/MarginService.php';
require __DIR__ . '/lib/Service/OrderService.php';
require __DIR__ . '/lib/Service/PaymentIntentService.php';
require __DIR__ . '/lib/Service/PaymentLinkService.php';
Expand Down
1 change: 1 addition & 0 deletions lib/ErrorObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class ErrorObject extends StripeObject
const CODE_APPLICATION_FEES_NOT_ALLOWED = 'application_fees_not_allowed';
const CODE_AUTHENTICATION_REQUIRED = 'authentication_required';
const CODE_BALANCE_INSUFFICIENT = 'balance_insufficient';
const CODE_BALANCE_INVALID_PARAMETER = 'balance_invalid_parameter';
const CODE_BANK_ACCOUNT_BAD_ROUTING_NUMBERS = 'bank_account_bad_routing_numbers';
const CODE_BANK_ACCOUNT_DECLINED = 'bank_account_declined';
const CODE_BANK_ACCOUNT_EXISTS = 'bank_account_exists';
Expand Down
2 changes: 2 additions & 0 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
* @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal <code>customer.shipping</code>. Once the invoice is finalized, this field will no longer be updated.
* @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal <code>customer.tax_exempt</code>. Once the invoice is finalized, this field will no longer be updated.
* @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as <code>customer.tax_ids</code>. Once the invoice is finalized, this field will no longer be updated.
* @property null|(string|\Stripe\Margin)[] $default_margins The margins applied to the invoice. Can be overridden by line item <code>margins</code>. Use <code>expand[]=default_margins</code> to expand each margin.
* @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
* @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
* @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any.
Expand Down Expand Up @@ -118,6 +119,7 @@
* @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 cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
* @property null|\Stripe\StripeObject[] $total_margin_amounts The aggregate amounts calculated per margin across all line items.
* @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items.
* @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
* @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
1 change: 1 addition & 0 deletions lib/InvoiceItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
* @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to.
* @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|\Stripe\Margin)[] $margins The margins which apply to the invoice item. When set, the <code>default_margins</code> on the invoice do not apply to this invoice item.
* @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 \Stripe\StripeObject $period
* @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for.
Expand Down
2 changes: 2 additions & 0 deletions lib/InvoiceLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
* @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the <a href="https://stripe.com/docs/api/invoiceitems">invoice item</a> associated with this line item if any.
* @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[] $margin_amounts The amount of margin calculated per margin for this line item.
* @property null|(string|\Stripe\Margin)[] $margins The margins applied to the line item. When set, the <code>default_margins</code> on the invoice do not apply to the line item. Use <code>expand[]=margins</code> to expand each margin.
* @property \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. Note that for line items with <code>type=subscription</code> this will reflect the metadata of the subscription that caused the line item to be created.
* @property \Stripe\StripeObject $period
* @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration.
Expand Down
4 changes: 2 additions & 2 deletions lib/Issuing/CreditUnderwritingRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Stripe\Issuing;

/**
* Every time an applicant submits an application for a Charge Card product your Platform offers, or every time your Platform takes a proactive credit decision on an existing account, you must record the decision by creating a new CreditUnderwritingRecord object on a Connected account.
* Every time an applicant submits an application for a Charge Card product your platform offers, or every time your platform takes a proactive credit decision on an existing account, you must record the decision by creating a new <code>CreditUnderwritingRecord</code> object on a connected account.
*
* <a href="https://stripe.com/docs/issuing/coming_soon">Follow the guide</a> to learn about your requirements as a Platform.
* <a href="https://stripe.com/docs/issuing/credit/report-credit-decisions-and-manage-aans">Follow the guide</a> to learn about your requirements as a platform.
*
* @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.
Expand Down
2 changes: 1 addition & 1 deletion lib/Issuing/PersonalizationDesign.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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 null|string|\Stripe\File $card_logo The file for the card logo, for use with physical bundles that support card logos.
* @property null|string|\Stripe\File $card_logo The file for the card logo to use with physical bundles that support card logos. Must have a <code>purpose</code> value of <code>issuing_logo</code>.
* @property null|\Stripe\StripeObject $carrier_text Hash containing carrier text, for use with physical bundles that support carrier text.
* @property null|string $lookup_key A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters.
* @property \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.
Expand Down
29 changes: 29 additions & 0 deletions lib/Margin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe;

/**
* A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who
* resell products and services and earn a discount (margin) for doing so.
*
* @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 bool $active Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to <code>true</code>.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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 $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|string $name Name of the margin that's displayed on, for example, invoices.
* @property float $percent_off Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied.
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
*/
class Margin extends ApiResource
{
const OBJECT_NAME = 'margin';

use ApiOperations\All;
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;
}
2 changes: 1 addition & 1 deletion lib/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @property \Stripe\StripeObject $status_transitions
* @property null|string|\Stripe\Subscription $subscription The subscription that was created or updated from this quote.
* @property \Stripe\StripeObject $subscription_data
* @property null|\Stripe\StripeObject[] $subscription_data_overrides
* @property null|\Stripe\StripeObject[] $subscription_data_overrides List representing overrides for <code>subscription_data</code> configurations for specific subscription schedules.
* @property null|string|\Stripe\SubscriptionSchedule $subscription_schedule The subscription schedule that was created or updated from this quote.
* @property null|\Stripe\StripeObject[] $subscription_schedules The subscription schedules that were created or updated from this quote.
* @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this quote belongs to.
Expand Down
2 changes: 2 additions & 0 deletions lib/QuotePreviewInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal <code>customer.shipping</code>. Once the invoice is finalized, this field will no longer be updated.
* @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal <code>customer.tax_exempt</code>. Once the invoice is finalized, this field will no longer be updated.
* @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as <code>customer.tax_ids</code>. Once the invoice is finalized, this field will no longer be updated.
* @property null|(string|\Stripe\Margin)[] $default_margins The margins applied to the invoice. Can be overridden by line item <code>margins</code>. Use <code>expand[]=default_margins</code> to expand each margin.
* @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
* @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
* @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any.
Expand Down Expand Up @@ -114,6 +115,7 @@
* @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 cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
* @property null|\Stripe\StripeObject[] $total_margin_amounts The aggregate amounts calculated per margin across all line items.
* @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items.
* @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
* @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/Service/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @property InvoiceService $invoices
* @property Issuing\IssuingServiceFactory $issuing
* @property MandateService $mandates
* @property MarginService $margins
* @property OrderService $orders
* @property PaymentIntentService $paymentIntents
* @property PaymentLinkService $paymentLinks
Expand Down Expand Up @@ -116,6 +117,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
'invoices' => InvoiceService::class,
'issuing' => Issuing\IssuingServiceFactory::class,
'mandates' => MandateService::class,
'margins' => MarginService::class,
'orders' => OrderService::class,
'paymentIntents' => PaymentIntentService::class,
'paymentLinks' => PaymentLinkService::class,
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/Issuing/CreditUnderwritingRecordService.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function createFromProactiveReview($params = null, $opts = null)
}

/**
* Update a <code>CreditUnderwritingRecord</code> object from an decision made on a
* Update a <code>CreditUnderwritingRecord</code> object from a decision made on a
* credit application.
*
* @param string $id
Expand Down
76 changes: 76 additions & 0 deletions lib/Service/MarginService.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;

class MarginService extends \Stripe\Service\AbstractService
{
/**
* Retrieve a list of your margins.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\Margin>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/billing/margins', $params, $opts);
}

/**
* Create a margin object to be used with invoices, invoice items, and invoice line
* items for a customer to represent a partner discount.A margin has a
* <code>percent_off</code> which is the percent that will be taken off the
* subtotal after all items and other discounts and promotions) of any invoices for
* a customer. Calculation of prorations do not include any partner margins applied
* on the original invoice item.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Margin
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/billing/margins', $params, $opts);
}

/**
* Retrieve a margin object with the given ID.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Margin
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/billing/margins/%s', $id), $params, $opts);
}

/**
* Update the specified margin object. Certain fields of the margin object are not
* editable.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Margin
*/
public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/billing/margins/%s', $id), $params, $opts);
}
}
1 change: 1 addition & 0 deletions lib/StripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* @property \Stripe\Service\InvoiceService $invoices
* @property \Stripe\Service\Issuing\IssuingServiceFactory $issuing
* @property \Stripe\Service\MandateService $mandates
* @property \Stripe\Service\MarginService $margins
* @property \Stripe\Service\OrderService $orders
* @property \Stripe\Service\PaymentIntentService $paymentIntents
* @property \Stripe\Service\PaymentLinkService $paymentLinks
Expand Down
Loading