Skip to content

Commit

Permalink
Codegen for openapi 1ad8d09
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Jun 3, 2021
1 parent 655c9e1 commit 4070e9b
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 0 deletions.
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
require __DIR__ . '/lib/Subscription.php';
require __DIR__ . '/lib/SubscriptionItem.php';
require __DIR__ . '/lib/SubscriptionSchedule.php';
require __DIR__ . '/lib/TaxCode.php';
require __DIR__ . '/lib/TaxId.php';
require __DIR__ . '/lib/TaxRate.php';
require __DIR__ . '/lib/Terminal/ConnectionToken.php';
Expand Down Expand Up @@ -215,6 +216,7 @@
require __DIR__ . '/lib/Service/SubscriptionService.php';
require __DIR__ . '/lib/Service/SubscriptionItemService.php';
require __DIR__ . '/lib/Service/SubscriptionScheduleService.php';
require __DIR__ . '/lib/Service/TaxCodeService.php';
require __DIR__ . '/lib/Service/TaxRateService.php';
require __DIR__ . '/lib/Service/Terminal/ConnectionTokenService.php';
require __DIR__ . '/lib/Service/Terminal/LocationService.php';
Expand Down
1 change: 1 addition & 0 deletions lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @property null|bool $allow_promotion_codes Enables user redeemable promotion codes.
* @property null|int $amount_subtotal Total of all items before discounts or taxes are applied.
* @property null|int $amount_total Total of all items after discounts and taxes are applied.
* @property \Stripe\StripeObject $automatic_tax
* @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address.
* @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website.
* @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems.
Expand Down
1 change: 1 addition & 0 deletions lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
* @property \Stripe\Collection $sources The customer's payment sources, if any.
* @property \Stripe\Collection $subscriptions The customer's current subscriptions, if any.
* @property \Stripe\StripeObject $tax
* @property null|string $tax_exempt Describes the customer's tax exemption status. One of <code>none</code>, <code>exempt</code>, or <code>reverse</code>. When set to <code>reverse</code>, invoice and receipt PDFs include the text <strong>&quot;Reverse charge&quot;</strong>.
* @property \Stripe\Collection $tax_ids The customer's tax IDs.
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
* @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.
* @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the <code>invoice.created</code> webhook, for example, so you might not want to display that invoice as unpaid to your users.
* @property bool $auto_advance Controls whether Stripe will perform <a href="https://stripe.com/docs/billing/invoices/workflow/#auto_advance">automatic collection</a> of the invoice. When <code>false</code>, the invoice's state will not automatically advance without an explicit action.
* @property \Stripe\StripeObject $automatic_tax
* @property null|string $billing_reason Indicates the reason why the invoice was created. <code>subscription_cycle</code> indicates an invoice created by a subscription advancing into a new period. <code>subscription_create</code> indicates an invoice created due to creating a subscription. <code>subscription_update</code> indicates an invoice created due to updating a subscription. <code>subscription</code> is set for all old invoices to indicate either a change to a subscription or a period advancement. <code>manual</code> is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The <code>upcoming</code> value is reserved for simulated invoices per the upcoming invoice endpoint. <code>subscription_threshold</code> indicates an invoice created due to a billing threshold being reached.
* @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any.
* @property null|string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
Expand Down
5 changes: 5 additions & 0 deletions lib/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @property null|string $nickname A brief description of the price, hidden from customers.
* @property string|\Stripe\Product $product The ID of the product this price is associated with.
* @property null|\Stripe\StripeObject $recurring The recurring components of a price such as <code>interval</code> and <code>usage_type</code>.
* @property null|string $tax_behavior Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of <code>inclusive</code>, <code>exclusive</code>, or <code>unspecified</code>. Once specified as either <code>inclusive</code> or <code>exclusive</code>, it cannot be changed.
* @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires <code>billing_scheme</code> to be set to <code>tiered</code>. See also the documentation for <code>billing_scheme</code>.
* @property null|string $tiers_mode Defines if the tiering price should be <code>graduated</code> or <code>volume</code> based. In <code>volume</code>-based tiering, the maximum quantity within a period determines the per unit price. In <code>graduated</code> tiering, pricing can change as the quantity grows.
* @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with <code>tiers</code>.
Expand All @@ -54,6 +55,10 @@ class Price extends ApiResource
const BILLING_SCHEME_PER_UNIT = 'per_unit';
const BILLING_SCHEME_TIERED = 'tiered';

const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive';
const TAX_BEHAVIOR_INCLUSIVE = 'inclusive';
const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified';

const TIERS_MODE_GRADUATED = 'graduated';
const TIERS_MODE_VOLUME = 'volume';

Expand Down
1 change: 1 addition & 0 deletions lib/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes.
* @property null|bool $shippable Whether this product is shipped (i.e., physical goods).
* @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used.
* @property null|string|\Stripe\TaxCode $tax_code A <a href="https://stripe.com/docs/tax/tax-codes">tax code</a> ID.
* @property string $type The type of the product. The product is either of type <code>good</code>, which is eligible for use with Orders and SKUs, or <code>service</code>, which is eligible for use with Subscriptions and Plans.
* @property null|string $unit_label A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions.
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
Expand Down
2 changes: 2 additions & 0 deletions lib/Service/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
* @property SubscriptionItemService $subscriptionItems
* @property SubscriptionService $subscriptions
* @property SubscriptionScheduleService $subscriptionSchedules
* @property TaxCodeService $taxCodes
* @property TaxRateService $taxRates
* @property Terminal\TerminalServiceFactory $terminal
* @property TokenService $tokens
Expand Down Expand Up @@ -112,6 +113,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
'subscriptionItems' => SubscriptionItemService::class,
'subscriptions' => SubscriptionService::class,
'subscriptionSchedules' => SubscriptionScheduleService::class,
'taxCodes' => TaxCodeService::class,
'taxRates' => TaxRateService::class,
'terminal' => Terminal\TerminalServiceFactory::class,
'tokens' => TokenService::class,
Expand Down
41 changes: 41 additions & 0 deletions lib/Service/TaxCodeService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service;

class TaxCodeService extends \Stripe\Service\AbstractService
{
/**
* A list of <a href="https://stripe.com/docs/tax/tax-codes">all tax codes
* available</a> to add to Products in order to allow specific tax calculations.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/tax_codes', $params, $opts);
}

/**
* Retrieves the details of an existing tax code. Supply the unique tax code ID and
* Stripe will return the corresponding tax code information.
*
* @param string $id
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\TaxCode
*/
public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/tax_codes/%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 @@ -53,6 +53,7 @@
* @property \Stripe\Service\SubscriptionItemService $subscriptionItems
* @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules
* @property \Stripe\Service\SubscriptionService $subscriptions
* @property \Stripe\Service\TaxCodeService $taxCodes
* @property \Stripe\Service\TaxRateService $taxRates
* @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal
* @property \Stripe\Service\TokenService $tokens
Expand Down
1 change: 1 addition & 0 deletions lib/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.
* @property \Stripe\StripeObject $automatic_tax
* @property int $billing_cycle_anchor Determines the date of the first full invoice, and, for plans with <code>month</code> or <code>year</code> intervals, the day of the month for subsequent invoices.
* @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
* @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled
Expand Down
22 changes: 22 additions & 0 deletions lib/TaxCode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe;

/**
* <a href="https://stripe.com/docs/tax/tax-codes">Tax codes</a> classify goods and
* services for tax purposes.
*
* @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 string $description A detailed description of which types of products the tax code represents.
* @property string $name A short name for the tax code.
*/
class TaxCode extends ApiResource
{
const OBJECT_NAME = 'tax_code';

use ApiOperations\All;
use ApiOperations\Retrieve;
}
8 changes: 8 additions & 0 deletions lib/TaxRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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 float $percentage This represents the tax rate percent out of 100.
* @property null|string $state <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>, without country prefix. For example, &quot;NY&quot; for New York, United States.
* @property null|string $tax_type The high-level tax type, such as <code>vat</code> or <code>sales_tax</code>.
*/
class TaxRate extends ApiResource
{
Expand All @@ -37,4 +38,11 @@ class TaxRate extends ApiResource
use ApiOperations\Create;
use ApiOperations\Retrieve;
use ApiOperations\Update;

const TAX_TYPE_GST = 'gst';
const TAX_TYPE_HST = 'hst';
const TAX_TYPE_PST = 'pst';
const TAX_TYPE_QST = 'qst';
const TAX_TYPE_SALES_TAX = 'sales_tax';
const TAX_TYPE_VAT = 'vat';
}
1 change: 1 addition & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class ObjectTypes
\Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class,
\Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class,
\Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
\Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
\Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class,
\Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class,
\Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class,
Expand Down

0 comments on commit 4070e9b

Please sign in to comment.