Skip to content

Commit

Permalink
Merge pull request #1456 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta (new)
  • Loading branch information
richardm-stripe authored Mar 17, 2023
2 parents 63f7abe + 3ec605d commit 462de57
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 13 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v249
v264
2 changes: 2 additions & 0 deletions lib/BankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
* @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with.
* @property null|bool $default_for_currency Whether this bank account is the default external account for its currency.
* @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
* @property null|\Stripe\StripeObject $future_requirements Information about upcoming new requirements for the bank account, including what information needs to be collected.
* @property string $last4 The last four digits of the bank account number.
* @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|\Stripe\StripeObject $requirements Information about the requirements for the bank account, including what information needs to be collected.
* @property null|string $routing_number The routing transit number for the bank account.
* @property string $status <p>For bank accounts, possible values are <code>new</code>, <code>validated</code>, <code>verified</code>, <code>verification_failed</code>, or <code>errored</code>. A bank account that hasn't had any activity or validation performed is <code>new</code>. If Stripe can determine that the bank account exists, its status will be <code>validated</code>. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be <code>verified</code>. If the verification failed for any reason, such as microdeposit failure, the status will be <code>verification_failed</code>. If a transfer sent to this bank account fails, we'll set the status to <code>errored</code> and will not continue to send transfers until the bank details are updated.</p><p>For external accounts, possible values are <code>new</code> and <code>errored</code>. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to <code>errored</code> and transfers are stopped until account details are updated.</p>
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class Event extends ApiResource
const PAYOUT_CREATED = 'payout.created';
const PAYOUT_FAILED = 'payout.failed';
const PAYOUT_PAID = 'payout.paid';
const PAYOUT_RECONCILIATION_COMPLETED = 'payout.reconciliation_completed';
const PAYOUT_UPDATED = 'payout.updated';
const PERSON_CREATED = 'person.created';
const PERSON_DELETED = 'person.deleted';
Expand Down
1 change: 0 additions & 1 deletion lib/InvoiceLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @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 null|\Stripe\StripeObject $applies_to
* @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 Down
4 changes: 2 additions & 2 deletions lib/PaymentLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* href="https://stripe.com/docs/api/events/types#event_types-checkout.session.completed">checkout
* session events</a> to track payments through payment links.
*
* Related guide: <a
* href="https://stripe.com/docs/payments/payment-links/api">Payment Links API</a>
* Related guide: <a href="https://stripe.com/docs/payment-links">Payment Links
* API</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.
Expand Down
5 changes: 2 additions & 3 deletions lib/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
*
* Related guides: <a
* href="https://stripe.com/docs/billing/subscriptions/set-up-subscription">Set up
* a subscription</a>, <a
* href="https://stripe.com/docs/payments/payment-links/overview">share a Payment
* Link</a>, <a
* a subscription</a>, <a href="https://stripe.com/docs/payment-links">share a
* Payment Link</a>, <a
* href="https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront">accept
* payments with Checkout</a>, and more about <a
* href="https://stripe.com/docs/products-prices/overview">Products and Prices</a>
Expand Down
5 changes: 3 additions & 2 deletions lib/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,17 @@ public function markStaleQuote($params = null, $opts = null)

/**
* @param string $id
* @param string $preview_invoice
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\InvoiceLineItem> list of InvoiceLineItems
*/
public static function previewInvoiceLines($id, $params = null, $opts = null)
public static function previewInvoiceLines($id, $preview_invoice, $params = null, $opts = null)
{
$url = static::resourceUrl($id) . '/preview_invoice_lines';
$url = static::resourceUrl($id) . '/preview_invoices/' . $preview_invoice . '/lines';
list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
Expand Down
5 changes: 3 additions & 2 deletions lib/Service/QuoteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public function markStaleQuote($id, $params = null, $opts = null)
/**
* Preview the invoice line items that would be generated by accepting the quote.
*
* @param string $parentId
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
Expand All @@ -185,9 +186,9 @@ public function markStaleQuote($id, $params = null, $opts = null)
*
* @return \Stripe\Collection<\Stripe\InvoiceLineItem>
*/
public function previewInvoiceLines($id, $params = null, $opts = null)
public function previewInvoiceLines($parentId, $id, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoice_lines', $id), $params, $opts);
return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices/%s/lines', $parentId, $id), $params, $opts);
}

/**
Expand Down
15 changes: 15 additions & 0 deletions lib/Service/Tax/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ public function create($params = null, $opts = null)
return $this->request('post', '/v1/tax/transactions', $params, $opts);
}

/**
* Creates a Tax <code>Transaction</code> from a calculation.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Transaction
*/
public function createFromCalculation($params = null, $opts = null)
{
return $this->request('post', '/v1/tax/transactions/create_from_calculation', $params, $opts);
}

/**
* Partially or fully reverses a previously created <code>Transaction</code>.
*
Expand Down
7 changes: 6 additions & 1 deletion lib/StripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@ class StripeClient extends BaseStripeClient
private $coreServiceFactory;

public function __get($name)
{
return $this->getService($name);
}

public function getService($name)
{
if (null === $this->coreServiceFactory) {
$this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this);
}

return $this->coreServiceFactory->__get($name);
return $this->coreServiceFactory->getService($name);
}
}
3 changes: 2 additions & 1 deletion lib/Tax/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
* @property null|int $expires_at Timestamp of date at which the tax calculation will expire. Empty if the calculation is an unsaved preview.
* @property null|\Stripe\Collection<\Stripe\LineItem> $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 $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.
* @property \Stripe\StripeObject[] $tax_breakdown Breakdown of individual tax amounts that add up to the total.
* @property int $tax_date Timestamp of date at which the tax rules and rates in effect applies for the calculation.
* @property \Stripe\StripeObject[] $tax_summary Summary of individual tax amounts that add up to the total.
*/
class Calculation extends \Stripe\ApiResource
{
Expand Down
19 changes: 19 additions & 0 deletions lib/Tax/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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 $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 All @@ -32,6 +33,24 @@ class Transaction extends \Stripe\ApiResource
const TYPE_REVERSAL = 'reversal';
const TYPE_TRANSACTION = 'transaction';

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Tax\Transaction the created transaction
*/
public static function createFromCalculation($params = null, $opts = null)
{
$url = static::classUrl() . '/create_from_calculation';
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);

return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down

0 comments on commit 462de57

Please sign in to comment.