Skip to content

Commit

Permalink
Merge pull request #1774 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Oct 18, 2024
2 parents a62a9a7 + ed1bc9e commit 87dffec
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 29 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1278
v1314
4 changes: 2 additions & 2 deletions lib/Billing/CreditBalanceSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
namespace Stripe\Billing;

/**
* Indicates the credit balance for credits granted to a customer.
* Indicates the billing credit balance for billing credits granted to a customer.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property \Stripe\StripeObject[] $balances The credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
* @property \Stripe\StripeObject[] $balances The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
* @property string|\Stripe\Customer $customer The customer the balance is for.
* @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
10 changes: 5 additions & 5 deletions lib/Billing/CreditBalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* @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.
* @property null|\Stripe\StripeObject $credit Credit details for this balance transaction. Only present if type is <code>credit</code>.
* @property string|\Stripe\Billing\CreditGrant $credit_grant The credit grant associated with this balance transaction.
* @property null|\Stripe\StripeObject $debit Debit details for this balance transaction. Only present if type is <code>debit</code>.
* @property int $effective_at The effective time of this balance transaction.
* @property null|\Stripe\StripeObject $credit Credit details for this credit balance transaction. Only present if type is <code>credit</code>.
* @property string|\Stripe\Billing\CreditGrant $credit_grant The credit grant associated with this credit balance transaction.
* @property null|\Stripe\StripeObject $debit Debit details for this credit balance transaction. Only present if type is <code>debit</code>.
* @property int $effective_at The effective time of this credit balance transaction.
* @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\TestHelpers\TestClock $test_clock ID of the test clock this credit balance transaction belongs to.
* @property null|string $type The type of balance transaction (credit or debit).
* @property null|string $type The type of credit balance transaction (credit or debit).
*/
class CreditBalanceTransaction extends \Stripe\ApiResource
{
Expand Down
13 changes: 8 additions & 5 deletions lib/Billing/CreditGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
namespace Stripe\Billing;

/**
* A credit grant is a resource that records a grant of some credit to a customer.
* A credit grant is an API resource that documents the allocation of some billing credits to a customer.
*
* Related guide: <a href="https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits">Billing credits</a>
* end
*
* @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 \Stripe\StripeObject $amount
* @property \Stripe\StripeObject $applicability_config
* @property string $category The category of this credit grant.
* @property string $category The category of this credit grant. This is for tracking purposes and will not be displayed to the customer.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string|\Stripe\Customer $customer ID of the customer to whom the credit was granted.
* @property null|int $effective_at The time when the credit becomes effective i.e when it is eligible to be used.
* @property null|int $expires_at The time when the credit will expire. If not present, the credit will never expire.
* @property string|\Stripe\Customer $customer ID of the customer to whom the billing credits are granted.
* @property null|int $effective_at The time when the billing credits become effective i.e when they are eligible to be used.
* @property null|int $expires_at The time when the billing credits will expire. If not present, the billing credits will never expire.
* @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 \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 A descriptive name shown in dashboard.
Expand Down
2 changes: 1 addition & 1 deletion lib/CreditNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @property string $pdf The link to download the PDF of the credit note.
* @property null|int $post_payment_amount
* @property null|int $pre_payment_amount
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for all line items.
* @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
* @property null|string|\Stripe\Refund $refund Refund related to this credit note.
* @property null|\Stripe\StripeObject[] $refunds Refunds related to this credit note.
Expand Down
2 changes: 1 addition & 1 deletion lib/CreditNoteLineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @property \Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item
* @property null|string $invoice_line_item ID of the invoice line item being credited
* @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[] $pretax_credit_amounts
* @property null|\Stripe\StripeObject[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for this line item.
* @property null|int $quantity The number of units of product being credited.
* @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.
Expand Down
1 change: 0 additions & 1 deletion lib/Issuing/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class Authorization extends \Stripe\ApiResource
const AUTHORIZATION_METHOD_SWIPE = 'swipe';

const STATUS_CLOSED = 'closed';
const STATUS_EXPIRED = 'expired';
const STATUS_PENDING = 'pending';
const STATUS_REVERSED = 'reversed';

Expand Down
8 changes: 8 additions & 0 deletions lib/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @property null|\Stripe\StripeObject $afterpay_clearpay
* @property null|\Stripe\StripeObject $alipay
* @property null|string $allow_redisplay This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”.
* @property null|\Stripe\StripeObject $alma
* @property null|\Stripe\StripeObject $amazon_pay
* @property null|\Stripe\StripeObject $au_becs_debit
* @property null|\Stripe\StripeObject $bacs_debit
Expand All @@ -34,6 +35,7 @@
* @property null|\Stripe\StripeObject $eps
* @property null|\Stripe\StripeObject $fpx
* @property null|\Stripe\StripeObject $giropay
* @property null|\Stripe\StripeObject $gopay
* @property null|\Stripe\StripeObject $grabpay
* @property null|\Stripe\StripeObject $ideal
* @property null|\Stripe\StripeObject $interac_present
Expand All @@ -56,11 +58,13 @@
* @property null|\Stripe\StripeObject $payto
* @property null|\Stripe\StripeObject $pix
* @property null|\Stripe\StripeObject $promptpay
* @property null|\Stripe\StripeObject $qris
* @property null|\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 null|\Stripe\StripeObject $rechnung
* @property null|\Stripe\StripeObject $revolut_pay
* @property null|\Stripe\StripeObject $samsung_pay
* @property null|\Stripe\StripeObject $sepa_debit
* @property null|\Stripe\StripeObject $shopeepay
* @property null|\Stripe\StripeObject $sofort
* @property null|\Stripe\StripeObject $swish
* @property null|\Stripe\StripeObject $twint
Expand All @@ -83,6 +87,7 @@ class PaymentMethod extends ApiResource
const TYPE_AFFIRM = 'affirm';
const TYPE_AFTERPAY_CLEARPAY = 'afterpay_clearpay';
const TYPE_ALIPAY = 'alipay';
const TYPE_ALMA = 'alma';
const TYPE_AMAZON_PAY = 'amazon_pay';
const TYPE_AU_BECS_DEBIT = 'au_becs_debit';
const TYPE_BACS_DEBIT = 'bacs_debit';
Expand All @@ -96,6 +101,7 @@ class PaymentMethod extends ApiResource
const TYPE_EPS = 'eps';
const TYPE_FPX = 'fpx';
const TYPE_GIROPAY = 'giropay';
const TYPE_GOPAY = 'gopay';
const TYPE_GRABPAY = 'grabpay';
const TYPE_IDEAL = 'ideal';
const TYPE_INTERAC_PRESENT = 'interac_present';
Expand All @@ -116,10 +122,12 @@ class PaymentMethod extends ApiResource
const TYPE_PAYTO = 'payto';
const TYPE_PIX = 'pix';
const TYPE_PROMPTPAY = 'promptpay';
const TYPE_QRIS = 'qris';
const TYPE_RECHNUNG = 'rechnung';
const TYPE_REVOLUT_PAY = 'revolut_pay';
const TYPE_SAMSUNG_PAY = 'samsung_pay';
const TYPE_SEPA_DEBIT = 'sepa_debit';
const TYPE_SHOPEEPAY = 'shopeepay';
const TYPE_SOFORT = 'sofort';
const TYPE_SWISH = 'swish';
const TYPE_TWINT = 'twint';
Expand Down
1 change: 1 addition & 0 deletions lib/PaymentMethodConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @property null|\Stripe\StripeObject $affirm
* @property null|\Stripe\StripeObject $afterpay_clearpay
* @property null|\Stripe\StripeObject $alipay
* @property null|\Stripe\StripeObject $alma
* @property null|\Stripe\StripeObject $amazon_pay
* @property null|\Stripe\StripeObject $apple_pay
* @property null|string $application For child configs, the Connect application associated with the configuration.
Expand Down
1 change: 1 addition & 0 deletions lib/PaymentMethodDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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 \Stripe\StripeObject $amazon_pay Indicates the status of a specific payment method on a payment method domain.
* @property \Stripe\StripeObject $apple_pay Indicates the status of a specific payment method on a payment method domain.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $domain_name The domain name that this payment method domain object represents.
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/TestHelpers/Issuing/CardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public function shipCard($id, $params = null, $opts = null)

/**
* Updates the shipping status of the specified Issuing <code>Card</code> object to
* <code>submitted</code>. This method is only available with Stripe Version
* ‘2024-09-30.acacia’ or above.
* <code>submitted</code>. This method requires Stripe Version ‘2024-09-30.acacia’
* or later.
*
* @param string $id
* @param null|array $params
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TokenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TokenService extends \Stripe\Service\AbstractService
{
/**
* Creates a single-use token that represents a bank account’s details. You can use
* this token with any API method in place of a bank account dictionary. You can
* this token with any v1 API method in place of a bank account dictionary. You can
* only use this token once. To do so, attach it to a <a href="#accounts">connected
* account</a> where <a
* href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
Expand Down
10 changes: 10 additions & 0 deletions lib/Tax/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
*
* @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|\Stripe\StripeObject $au_serr
* @property null|\Stripe\StripeObject $ca_mrdp
* @property null|string|\Stripe\Tax\Form $corrected_by The form that corrects this form, if any.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|\Stripe\StripeObject $eu_dac7
* @property \Stripe\StripeObject[] $filing_statuses A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction’s tax authority.
* @property null|\Stripe\StripeObject $gb_mrdp
* @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 $nz_mrdp
* @property \Stripe\StripeObject $payee
* @property string $type The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type.
* @property null|\Stripe\StripeObject $us_1099_k
Expand All @@ -25,6 +30,11 @@ class Form extends \Stripe\ApiResource
{
const OBJECT_NAME = 'tax.form';

const TYPE_AU_SERR = 'au_serr';
const TYPE_CA_MRDP = 'ca_mrdp';
const TYPE_EU_DAC7 = 'eu_dac7';
const TYPE_GB_MRDP = 'gb_mrdp';
const TYPE_NZ_MRDP = 'nz_mrdp';
const TYPE_US_1099_K = 'us_1099_k';
const TYPE_US_1099_MISC = 'us_1099_misc';
const TYPE_US_1099_NEC = 'us_1099_nec';
Expand Down
2 changes: 1 addition & 1 deletion lib/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Token extends ApiResource

/**
* Creates a single-use token that represents a bank account’s details. You can use
* this token with any API method in place of a bank account dictionary. You can
* this token with any v1 API method in place of a bank account dictionary. You can
* only use this token once. To do so, attach it to a <a href="#accounts">connected
* account</a> where <a
* href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a>
Expand Down
2 changes: 1 addition & 1 deletion lib/V2/Billing/MeterEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
*/
class MeterEvent extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event';
const OBJECT_NAME = 'v2.billing.meter_event';
}
2 changes: 1 addition & 1 deletion lib/V2/Billing/MeterEventAdjustment.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class MeterEventAdjustment extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event_adjustment';
const OBJECT_NAME = 'v2.billing.meter_event_adjustment';

const STATUS_COMPLETE = 'complete';
const STATUS_PENDING = 'pending';
Expand Down
2 changes: 1 addition & 1 deletion lib/V2/Billing/MeterEventSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
*/
class MeterEventSession extends \Stripe\ApiResource
{
const OBJECT_NAME = 'billing.meter_event_session';
const OBJECT_NAME = 'v2.billing.meter_event_session';
}
13 changes: 7 additions & 6 deletions tests/Stripe/BaseStripeClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public function testRawRequestWithStripeContextOption()
public function testV2GetRequest()
{
$this->curlClientStub->method('executeRequestWithRetries')
->willReturn(['{"object": "billing.meter_event_session"}', 200, []])
->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []])
;

$this->curlClientStub->expects(static::once())
Expand Down Expand Up @@ -446,7 +446,7 @@ public function testV2GetRequest()
public function testV2PostRequest()
{
$this->curlClientStub->method('executeRequestWithRetries')
->willReturn(['{"object": "billing.meter_event_session"}', 200, []])
->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []])
;

$this->curlClientStub->expects(static::once())
Expand Down Expand Up @@ -475,7 +475,7 @@ public function testV2PostRequest()
public function testV2PostRequestWithEmptyParams()
{
$this->curlClientStub->method('executeRequestWithRetries')
->willReturn(['{"object": "billing.meter_event_session"}', 200, []])
->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []])
;

$this->curlClientStub->expects(static::once())
Expand Down Expand Up @@ -777,7 +777,7 @@ public function testV2OverridesPreviewVersionIfPassedInRawRequestOptions()
public function testV2OverridesPreviewVersionIfPassedInRequestOptions()
{
$this->curlClientStub->method('executeRequestWithRetries')
->willReturn(['{"object": "billing.meter_event_session"}', 200, []])
->willReturn(['{"object": "v2.billing.meter_event_session"}', 200, []])
;

$this->curlClientStub->expects(static::once())
Expand All @@ -802,7 +802,7 @@ public function testV2OverridesPreviewVersionIfPassedInRequestOptions()
public function testV1AndV2Request()
{
$this->curlClientStub->method('executeRequestWithRetries')
->willReturnOnConsecutiveCalls(['{"object": "billing.meter_event_session"}', 200, []], ['{"object": "billing.meter_event"}', 200, []])
->willReturnOnConsecutiveCalls(['{"object": "v2.billing.meter_event_session"}', 200, []], ['{"object": "billing.meter_event"}', 200, []])
;

$this->curlClientStub
Expand All @@ -816,7 +816,8 @@ public function testV1AndV2Request()
$this->assertContains('Stripe-Version: ' . ApiVersion::CURRENT, $opts[\CURLOPT_HTTPHEADER]);

return true;
}), MOCK_URL . '/v1/billing/meter_event/bmes_123',
}),
MOCK_URL . '/v1/billing/meter_event/bmes_123',
])
;

Expand Down

0 comments on commit 87dffec

Please sign in to comment.