diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e8f6775c5..e6c86cecd 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v581 \ No newline at end of file +v596 \ No newline at end of file diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index 97ee2a593..eac933859 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -21,7 +21,7 @@ * @property int $fee Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed. * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. * @property int $net Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by amount - fee - * @property string $reporting_category Learn more about how [reporting categories] (https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. + * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. * @property null|string|\Stripe\StripeObject $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, 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_refund, payment_reversal, 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. diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index 302191c6f..5b0b0e974 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -30,6 +30,7 @@ * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. * @property null|string $cancel_url If set, Checkout displays a back button and customers will be directed to this URL 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. + * @property null|string $client_secret Client secret to be used when initializing Stripe.js embedded checkout. * @property null|\Stripe\StripeObject $consent Results of consent_collection for this session. * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. @@ -58,6 +59,8 @@ * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. * @property null|\Stripe\StripeObject $phone_number_collection * @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow. + * @property null|string $redirect_on_completion Applies to Checkout Sessions with ui_mode: embedded. By default, Stripe will always redirect to your return_url after a successful confirmation. If you set redirect_on_completion: 'if_required', then we will only redirect if your user chooses a redirect-based payment method. + * @property null|string $return_url Applies to Checkout Sessions with ui_mode: embedded. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. * @property null|\Stripe\StripeObject $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate. @@ -69,6 +72,7 @@ * @property null|string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. * @property null|\Stripe\StripeObject $tax_id_collection * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. + * @property null|string $ui_mode The UI mode of the Session. Can be hosted (default) or embedded. * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. */ class Session extends \Stripe\ApiResource @@ -96,6 +100,10 @@ class Session extends \Stripe\ApiResource const PAYMENT_STATUS_PAID = 'paid'; const PAYMENT_STATUS_UNPAID = 'unpaid'; + const REDIRECT_ON_COMPLETION_ALWAYS = 'always'; + const REDIRECT_ON_COMPLETION_IF_REQUIRED = 'if_required'; + const REDIRECT_ON_COMPLETION_NEVER = 'never'; + const STATUS_COMPLETE = 'complete'; const STATUS_EXPIRED = 'expired'; const STATUS_OPEN = 'open'; @@ -105,6 +113,9 @@ class Session extends \Stripe\ApiResource const SUBMIT_TYPE_DONATE = 'donate'; const SUBMIT_TYPE_PAY = 'pay'; + const UI_MODE_EMBEDDED = 'embedded'; + const UI_MODE_HOSTED = 'hosted'; + /** * @param null|array $params * @param null|array|string $opts diff --git a/lib/Service/SetupIntentService.php b/lib/Service/SetupIntentService.php index e7f84d7ca..17927a0f1 100644 --- a/lib/Service/SetupIntentService.php +++ b/lib/Service/SetupIntentService.php @@ -22,11 +22,11 @@ public function all($params = null, $opts = null) } /** - * A SetupIntent object can be canceled when it is in one of these statuses: + * You can cancel a SetupIntent object when it’s in one of these statuses: * requires_payment_method, requires_confirmation, or * requires_action. * - * Once canceled, setup is abandoned and any operations on the SetupIntent will + * After you cancel it, setup is abandoned and any operations on the SetupIntent * fail with an error. * * @param string $id diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php index 31e2aa51c..131a138d1 100644 --- a/lib/Service/SubscriptionService.php +++ b/lib/Service/SubscriptionService.php @@ -155,11 +155,52 @@ public function search($params = null, $opts = null) } /** - * Updates an existing subscription on a customer to match the specified - * parameters. When changing plans or quantities, we will optionally prorate the - * price we charge next month to make up for any price changes. To preview how the - * proration will be calculated, use the upcoming - * invoice endpoint. + * Updates an existing subscription to match the specified parameters. When + * changing prices or quantities, we optionally prorate the price we charge next + * month to make up for any price changes. To preview how the proration is + * calculated, use the upcoming invoice + * endpoint. + * + * By default, we prorate subscription changes. For example, if a customer signs up + * on May 1 for a 100 price, they’ll be billed + * 100 immediately. If on May 15 they switch to a + * 200 price, then on June 1 they’ll be billed + * 250 (200 for a renewal of her + * subscription, plus a 50 prorating adjustment for half of + * the previous month’s 100 difference). Similarly, a + * downgrade generates a credit that is applied to the next invoice. We also + * prorate when you make quantity changes. + * + * Switching prices does not normally change the billing date or generate an + * immediate charge unless: + * + * + * + * In these cases, we apply a credit for the unused time on the previous price, + * immediately charge the customer using the new price, and reset the billing date. + * + * If you want to charge for an upgrade immediately, pass + * proration_behavior as always_invoice to create + * prorations, automatically invoice the customer for those proration adjustments, + * and attempt to collect payment. If you pass create_prorations, the + * prorations are created but not automatically invoiced. If you want to bill the + * customer for the prorations before the subscription’s renewal date, you need to + * manually invoice the customer. + * + * If you don’t want to prorate, set the proration_behavior option to + * none. With this option, the customer is billed + * 100 on May 1 and 200 on June 1. + * Similarly, if you set proration_behavior to none when + * switching between different billing intervals (for example, from monthly to + * yearly), we don’t generate any credits for the old subscription’s unused time. + * We still reset the billing date and bill immediately for the new subscription. + * + * Updating the quantity on a subscription many times in an hour may result in rate limiting. If you need to bill for a frequently + * changing quantity, consider integrating usage-based billing instead. * * @param string $id * @param null|array $params diff --git a/lib/Terminal/Configuration.php b/lib/Terminal/Configuration.php index 09a9d44df..9bc709eeb 100644 --- a/lib/Terminal/Configuration.php +++ b/lib/Terminal/Configuration.php @@ -12,6 +12,7 @@ * @property null|\Stripe\StripeObject $bbpos_wisepos_e * @property null|bool $is_account_default Whether this Configuration is the default for your account * @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 $offline * @property null|\Stripe\StripeObject $tipping * @property null|\Stripe\StripeObject $verifone_p400 */