From caffeb91a59e69ae007df300ffe1b4c870994883 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Tue, 10 May 2022 18:04:19 -0700 Subject: [PATCH] Codegen for openapi 7789931 --- lib/Coupon.php | 11 +++++++---- lib/Event.php | 1 + lib/Order.php | 2 ++ lib/PaymentLink.php | 14 ++++++++++++++ lib/PromotionCode.php | 7 ++++--- lib/Refund.php | 2 +- lib/Service/OrderService.php | 2 +- lib/Subscription.php | 1 + 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/lib/Coupon.php b/lib/Coupon.php index 0d84bd4bf..424c22226 100644 --- a/lib/Coupon.php +++ b/lib/Coupon.php @@ -7,10 +7,13 @@ /** * A coupon contains information about a percent-off or amount-off discount you * might want to apply to a customer. Coupons may be applied to invoices or orders. - * Coupons do not work with conventional one-off charges. + * href="https://stripe.com/docs/api#subscriptions">subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not + * work with conventional one-off charges or payment intents. * * @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. diff --git a/lib/Event.php b/lib/Event.php index 9bc59eee5..5724823ef 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -72,6 +72,7 @@ class Event extends ApiResource const BALANCE_AVAILABLE = 'balance.available'; const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; + const BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created'; const CAPABILITY_UPDATED = 'capability.updated'; const CASH_BALANCE_FUNDS_AVAILABLE = 'cash_balance.funds_available'; const CHARGE_CAPTURED = 'charge.captured'; diff --git a/lib/Order.php b/lib/Order.php index 8db36f690..58c71a94e 100644 --- a/lib/Order.php +++ b/lib/Order.php @@ -9,6 +9,8 @@ * & quantities being purchased, the order status, the payment information, and * the billing/shipping details. * + * Related guide: Orders overview + * * @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 $amount_subtotal Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php index 8062c5374..a4f77056f 100644 --- a/lib/PaymentLink.php +++ b/lib/PaymentLink.php @@ -26,14 +26,20 @@ * @property null|float $application_fee_percent 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 string $billing_address_collection Configuration for collecting the customer's billing address. + * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration to gather active consent from customers. + * @property string $customer_creation Configuration for Customer creation during checkout. * @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items representing what is being sold. * @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 \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 null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. + * @property null|\Stripe\StripeObject $payment_intent_data Indicates the parameters to be passed to PaymentIntent creation during checkout. * @property null|string[] $payment_method_types The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. * @property \Stripe\StripeObject $phone_number_collection * @property null|\Stripe\StripeObject $shipping_address_collection Configuration for collecting the customer's shipping address. + * @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to the session. + * @property string $submit_type Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. * @property null|\Stripe\StripeObject $subscription_data When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data. + * @property \Stripe\StripeObject $tax_id_collection * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. * @property string $url The public URL that can be shared with customers. */ @@ -49,6 +55,14 @@ class PaymentLink extends ApiResource const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; + const CUSTOMER_CREATION_ALWAYS = 'always'; + const CUSTOMER_CREATION_IF_REQUIRED = 'if_required'; + + const SUBMIT_TYPE_AUTO = 'auto'; + const SUBMIT_TYPE_BOOK = 'book'; + const SUBMIT_TYPE_DONATE = 'donate'; + const SUBMIT_TYPE_PAY = 'pay'; + /** * @param null|array $params * @param null|array|string $opts diff --git a/lib/PromotionCode.php b/lib/PromotionCode.php index 2457add49..7eb0c4074 100644 --- a/lib/PromotionCode.php +++ b/lib/PromotionCode.php @@ -5,14 +5,15 @@ namespace Stripe; /** - * A Promotion Code represents a customer-redeemable code for a coupon. It can be - * used to create multiple codes for a single coupon. + * A Promotion Code represents a customer-redeemable code for a coupon. It can be used to create + * multiple codes for a single coupon. * * @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 bool $active Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid. * @property string $code The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. - * @property \Stripe\Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to invoices or orders. Coupons do not work with conventional one-off charges. + * @property \Stripe\Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. diff --git a/lib/Refund.php b/lib/Refund.php index 4c640119f..b48157c1a 100644 --- a/lib/Refund.php +++ b/lib/Refund.php @@ -28,7 +28,7 @@ * @property null|string $reason Reason for the refund, either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. - * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to our refunds documentation for more details. + * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, requires_action, succeeded, failed, or canceled. Refer to our refunds documentation for more details. * @property null|string|\Stripe\TransferReversal $transfer_reversal If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. */ class Refund extends ApiResource diff --git a/lib/Service/OrderService.php b/lib/Service/OrderService.php index b2ccbcb1d..97c786261 100644 --- a/lib/Service/OrderService.php +++ b/lib/Service/OrderService.php @@ -72,7 +72,7 @@ public function create($params = null, $opts = null) } /** - * Reopens a processing order. + * Reopens a submitted order. * * @param string $id * @param null|array $params diff --git a/lib/Subscription.php b/lib/Subscription.php index 7a02c2295..1515a5830 100644 --- a/lib/Subscription.php +++ b/lib/Subscription.php @@ -30,6 +30,7 @@ * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. + * @property null|string $description The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. * @property null|int $ended_at If the subscription has ended, the date the subscription ended. * @property \Stripe\Collection<\Stripe\SubscriptionItem> $items List of subscription items, each with an attached price.