Skip to content

Commit

Permalink
Update generated code (#1629)
Browse files Browse the repository at this point in the history
* Update generated code for v745

* Update generated code for v750

* Update generated code for v752

* Update generated code for v755

* Update generated code for v755

* Update generated code for v755

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] authored Jan 12, 2024
1 parent 03765fc commit 9363259
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v742
v755
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
require __DIR__ . '/lib/Customer.php';
require __DIR__ . '/lib/CustomerBalanceTransaction.php';
require __DIR__ . '/lib/CustomerCashBalanceTransaction.php';
require __DIR__ . '/lib/CustomerSession.php';
require __DIR__ . '/lib/Discount.php';
require __DIR__ . '/lib/Dispute.php';
require __DIR__ . '/lib/EphemeralKey.php';
Expand Down Expand Up @@ -178,6 +179,7 @@
require __DIR__ . '/lib/Service/CouponService.php';
require __DIR__ . '/lib/Service/CreditNoteService.php';
require __DIR__ . '/lib/Service/CustomerService.php';
require __DIR__ . '/lib/Service/CustomerSessionService.php';
require __DIR__ . '/lib/Service/DisputeService.php';
require __DIR__ . '/lib/Service/EphemeralKeyService.php';
require __DIR__ . '/lib/Service/EventService.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/BalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @property string $reporting_category Learn more about how <a href="https://stripe.com/docs/reports/reporting-categories">reporting categories</a> can help you understand balance transactions from an accounting perspective.
* @property null|string|\Stripe\ApplicationFee|\Stripe\ApplicationFeeRefund|\Stripe\Charge|\Stripe\CustomerCashBalanceTransaction|\Stripe\Dispute|\Stripe\Issuing\Authorization|\Stripe\Issuing\Dispute|\Stripe\Issuing\Transaction|\Stripe\Payout|\Stripe\Refund|\Stripe\StripeObject|\Stripe\Topup|\Stripe\Transfer|\Stripe\TransferReversal $source This transaction relates to the Stripe object.
* @property string $status The transaction's net funds status in the Stripe balance, which are either <code>available</code> or <code>pending</code>.
* @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>climate_order_purchase</code>, <code>climate_order_refund</code>, <code>connect_collection_transfer</code>, <code>contribution</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>obligation_inbound</code>, <code>obligation_outbound</code>, <code>obligation_reversal_inbound</code>, <code>obligation_reversal_outbound</code>, <code>obligation_payout</code>, <code>obligation_payout_failure</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_network_reserve_hold</code>, <code>payment_network_reserve_release</code>, <code>payment_refund</code>, <code>payment_reversal</code>, <code>payment_unreconciled</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. Learn more about <a href="https://stripe.com/docs/reports/balance-transaction-types">balance transaction types and what they represent</a>. To classify transactions for accounting purposes, consider <code>reporting_category</code> instead.
* @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>climate_order_purchase</code>, <code>climate_order_refund</code>, <code>connect_collection_transfer</code>, <code>contribution</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>obligation_outbound</code>, <code>obligation_reversal_inbound</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_network_reserve_hold</code>, <code>payment_network_reserve_release</code>, <code>payment_refund</code>, <code>payment_reversal</code>, <code>payment_unreconciled</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. Learn more about <a href="https://stripe.com/docs/reports/balance-transaction-types">balance transaction types and what they represent</a>. To classify transactions for accounting purposes, consider <code>reporting_category</code> instead.
*/
class BalanceTransaction extends ApiResource
{
Expand Down
24 changes: 24 additions & 0 deletions lib/CustomerSession.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe;

/**
* A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
* control over a customer.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property string $client_secret <p>The client secret of this customer session. Used on the client to set up secure access to the given <code>customer</code>.</p><p>The client secret can be used to provide access to <code>customer</code> from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.</p>
* @property null|\Stripe\StripeObject $components Configuration for the components supported by this customer session.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string|\Stripe\Customer $customer The customer the customer session was created for.
* @property int $expires_at The timestamp at which this customer session will 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.
*/
class CustomerSession extends ApiResource
{
const OBJECT_NAME = 'customer_session';

use ApiOperations\Create;
}
2 changes: 2 additions & 0 deletions lib/Service/CoreServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @property CouponService $coupons
* @property CreditNoteService $creditNotes
* @property CustomerService $customers
* @property CustomerSessionService $customerSessions
* @property DisputeService $disputes
* @property EphemeralKeyService $ephemeralKeys
* @property EventService $events
Expand Down Expand Up @@ -94,6 +95,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
'coupons' => CouponService::class,
'creditNotes' => CreditNoteService::class,
'customers' => CustomerService::class,
'customerSessions' => CustomerSessionService::class,
'disputes' => DisputeService::class,
'ephemeralKeys' => EphemeralKeyService::class,
'events' => EventService::class,
Expand Down
25 changes: 25 additions & 0 deletions lib/Service/CustomerSessionService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service;

class CustomerSessionService extends \Stripe\Service\AbstractService
{
/**
* Creates a customer session object that includes a single-use client secret that
* you can use on your front-end to grant client-side API access for certain
* customer resources.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\CustomerSession
*/
public function create($params = null, $opts = null)
{
return $this->request('post', '/v1/customer_sessions', $params, $opts);
}
}
1 change: 1 addition & 0 deletions lib/StripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @property \Stripe\Service\CouponService $coupons
* @property \Stripe\Service\CreditNoteService $creditNotes
* @property \Stripe\Service\CustomerService $customers
* @property \Stripe\Service\CustomerSessionService $customerSessions
* @property \Stripe\Service\DisputeService $disputes
* @property \Stripe\Service\EphemeralKeyService $ephemeralKeys
* @property \Stripe\Service\EventService $events
Expand Down
1 change: 1 addition & 0 deletions lib/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @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 total that will be transferred to the application owner's Stripe account.
* @property \Stripe\StripeObject $automatic_tax
* @property int $billing_cycle_anchor The reference point that aligns future <a href="https://stripe.com/docs/subscriptions/billing-cycle">billing cycle</a> dates. It sets the day of week for <code>week</code> intervals, the day of month for <code>month</code> and <code>year</code> intervals, and the month of year for <code>year</code> intervals. The timestamp is in UTC format.
* @property null|\Stripe\StripeObject $billing_cycle_anchor_config The fixed values used to calculate the <code>billing_cycle_anchor</code>.
* @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
* @property bool $cancel_at_period_end If the subscription has been canceled with the <code>at_period_end</code> flag set to <code>true</code>, <code>cancel_at_period_end</code> on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
Expand Down
2 changes: 1 addition & 1 deletion lib/SubscriptionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is <code>active</code>.
* @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule.
* @property \Stripe\StripeObject $default_settings
* @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are <code>release</code> or <code>cancel</code> with the default being <code>release</code>. <code>release</code> will end the subscription schedule and keep the underlying subscription running.<code>cancel</code> will end the subscription schedule and cancel the underlying subscription.
* @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are <code>release</code> or <code>cancel</code> with the default being <code>release</code>. <code>release</code> will end the subscription schedule and keep the underlying subscription running. <code>cancel</code> will end the subscription schedule and cancel the underlying subscription.
* @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 \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases.
Expand Down
1 change: 1 addition & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ObjectTypes
\Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class,
\Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class,
\Stripe\CustomerCashBalanceTransaction::OBJECT_NAME => \Stripe\CustomerCashBalanceTransaction::class,
\Stripe\CustomerSession::OBJECT_NAME => \Stripe\CustomerSession::class,
\Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class,
\Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class,
\Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class,
Expand Down
10 changes: 10 additions & 0 deletions tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,16 @@ public function testCreditNotesVoidPost()
static::assertInstanceOf(\Stripe\CreditNote::class, $result);
}

public function testCustomerSessionsPost()
{
$this->expectsRequest('post', '/v1/customer_sessions');
$result = $this->client->customerSessions->create([
'customer' => 'cus_123',
'components' => ['buy_button' => ['enabled' => true]],
]);
static::assertInstanceOf(\Stripe\CustomerSession::class, $result);
}

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

0 comments on commit 9363259

Please sign in to comment.