From 1c49a79e132e42e44e852d1239636f7b1069a09f Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:49:54 +0000 Subject: [PATCH 1/6] Update generated code for v745 --- OPENAPI_VERSION | 2 +- lib/SubscriptionSchedule.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index da794494d..6cad75a2d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v742 \ No newline at end of file +v745 \ No newline at end of file diff --git a/lib/SubscriptionSchedule.php b/lib/SubscriptionSchedule.php index 9494ac533..7e7877b55 100644 --- a/lib/SubscriptionSchedule.php +++ b/lib/SubscriptionSchedule.php @@ -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 active. * @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 release or cancel with the default being release. release will end the subscription schedule and keep the underlying subscription running.cancel 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 release or cancel with the default being release. release will end the subscription schedule and keep the underlying subscription running. cancel will end the subscription schedule and cancel the underlying subscription. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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. From 753142648c16f9007207da97ff4be4d7f5954a57 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:50:44 +0000 Subject: [PATCH 2/6] Update generated code for v750 --- OPENAPI_VERSION | 2 +- lib/Subscription.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6cad75a2d..2d7c95cad 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v745 \ No newline at end of file +v750 \ No newline at end of file diff --git a/lib/Subscription.php b/lib/Subscription.php index 06bdd28e2..9ab3c888a 100644 --- a/lib/Subscription.php +++ b/lib/Subscription.php @@ -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 billing cycle dates. It sets the day of week for week intervals, the day of month for month and year intervals, and the month of year for year intervals. The timestamp is in UTC format. + * @property null|\Stripe\StripeObject $billing_cycle_anchor_config The fixed values used to calculate the billing_cycle_anchor. * @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 at_period_end flag set to true, cancel_at_period_end 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. From 715443b5da66fa5924e137833173c23fd4020531 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:26:02 +0000 Subject: [PATCH 3/6] Update generated code for v752 --- OPENAPI_VERSION | 2 +- lib/BalanceTransaction.php | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2d7c95cad..c99779c39 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v750 \ No newline at end of file +v752 \ No newline at end of file diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index c78c0f5ca..2823d84a0 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -24,7 +24,7 @@ * @property string $reporting_category Learn more about how reporting categories 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 available or pending. - * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_inbound, obligation_outbound, obligation_reversal_inbound, obligation_reversal_outbound, obligation_payout, obligation_payout_failure, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. + * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, climate_order_purchase, climate_order_refund, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, obligation_outbound, obligation_reversal_inbound, payment, payment_failure_refund, payment_network_reserve_hold, payment_network_reserve_release, payment_refund, payment_reversal, payment_unreconciled, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. To classify transactions for accounting purposes, consider reporting_category instead. */ class BalanceTransaction extends ApiResource { @@ -48,12 +48,8 @@ class BalanceTransaction extends ApiResource const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; const TYPE_ISSUING_DISPUTE = 'issuing_dispute'; const TYPE_ISSUING_TRANSACTION = 'issuing_transaction'; - const TYPE_OBLIGATION_INBOUND = 'obligation_inbound'; const TYPE_OBLIGATION_OUTBOUND = 'obligation_outbound'; - const TYPE_OBLIGATION_PAYOUT = 'obligation_payout'; - const TYPE_OBLIGATION_PAYOUT_FAILURE = 'obligation_payout_failure'; const TYPE_OBLIGATION_REVERSAL_INBOUND = 'obligation_reversal_inbound'; - const TYPE_OBLIGATION_REVERSAL_OUTBOUND = 'obligation_reversal_outbound'; const TYPE_PAYMENT = 'payment'; const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund'; const TYPE_PAYMENT_NETWORK_RESERVE_HOLD = 'payment_network_reserve_hold'; From e94744bf0d8755c72cdf3f7e3c72b02dad0c1e76 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:59:32 +0000 Subject: [PATCH 4/6] Update generated code for v755 --- OPENAPI_VERSION | 2 +- init.php | 2 ++ lib/CustomerSession.php | 24 ++++++++++++++++++++++++ lib/Service/CoreServiceFactory.php | 2 ++ lib/Service/CustomerSessionService.php | 25 +++++++++++++++++++++++++ lib/StripeClient.php | 1 + lib/Util/ObjectTypes.php | 1 + 7 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 lib/CustomerSession.php create mode 100644 lib/Service/CustomerSessionService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c99779c39..749c898fd 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v752 \ No newline at end of file +v755 \ No newline at end of file diff --git a/init.php b/init.php index b3e3bc457..28aab4049 100644 --- a/init.php +++ b/init.php @@ -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'; @@ -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'; diff --git a/lib/CustomerSession.php b/lib/CustomerSession.php new file mode 100644 index 000000000..3d0038989 --- /dev/null +++ b/lib/CustomerSession.php @@ -0,0 +1,24 @@ +The client secret of this customer session. Used on the client to set up secure access to the given customer.

The client secret can be used to provide access to customer 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.

+ * @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 true if the object exists in live mode or the value false if the object exists in test mode. + */ +class CustomerSession extends ApiResource +{ + const OBJECT_NAME = 'customer_session'; + + use ApiOperations\Create; +} diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index 5a6844e87..fd372479a 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -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 @@ -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, diff --git a/lib/Service/CustomerSessionService.php b/lib/Service/CustomerSessionService.php new file mode 100644 index 000000000..57dcba609 --- /dev/null +++ b/lib/Service/CustomerSessionService.php @@ -0,0 +1,25 @@ +request('post', '/v1/customer_sessions', $params, $opts); + } +} diff --git a/lib/StripeClient.php b/lib/StripeClient.php index fe9492e8f..5d309e222 100644 --- a/lib/StripeClient.php +++ b/lib/StripeClient.php @@ -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 diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index 341c62410..ba347aedd 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -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, From 51425d1d901bdad99ce138d6c128ba136ca8ab85 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:47:36 +0000 Subject: [PATCH 5/6] Update generated code for v755 --- lib/BalanceTransaction.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index 2823d84a0..56e3d10c6 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -48,8 +48,12 @@ class BalanceTransaction extends ApiResource const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; const TYPE_ISSUING_DISPUTE = 'issuing_dispute'; const TYPE_ISSUING_TRANSACTION = 'issuing_transaction'; + const TYPE_OBLIGATION_INBOUND = 'obligation_inbound'; const TYPE_OBLIGATION_OUTBOUND = 'obligation_outbound'; + const TYPE_OBLIGATION_PAYOUT = 'obligation_payout'; + const TYPE_OBLIGATION_PAYOUT_FAILURE = 'obligation_payout_failure'; const TYPE_OBLIGATION_REVERSAL_INBOUND = 'obligation_reversal_inbound'; + const TYPE_OBLIGATION_REVERSAL_OUTBOUND = 'obligation_reversal_outbound'; const TYPE_PAYMENT = 'payment'; const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund'; const TYPE_PAYMENT_NETWORK_RESERVE_HOLD = 'payment_network_reserve_hold'; From f3446e084536beb02b4823ff218cb4fca1d1e25d Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 00:29:39 +0000 Subject: [PATCH 6/6] Update generated code for v755 --- tests/Stripe/GeneratedExamplesTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index 498ce4d38..60bc02bb1 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -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(