Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates #1284

Merged
merged 1 commit into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a
* href="https://stripe.com/docs/api#invoices">invoices</a> or <a
* href="https://stripe.com/docs/api#create_order_legacy-coupon">orders</a>.
* Coupons do not work with conventional one-off <a
* href="https://stripe.com/docs/api#create_charge">charges</a>.
* href="https://stripe.com/docs/api#subscriptions">subscriptions</a>, <a
* href="https://stripe.com/docs/api#invoices">invoices</a>, <a
* href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a>, <a
* href="https://stripe.com/docs/api#quotes">quotes</a>, and more. Coupons do not
* work with conventional one-off <a
* href="https://stripe.com/docs/api#create_charge">charges</a> or <a
* href="https://stripe.com/docs/api/payment_intents">payment intents</a>.
*
* @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.
Expand Down
1 change: 1 addition & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 2 additions & 0 deletions lib/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* &amp; quantities being purchased, the order status, the payment information, and
* the billing/shipping details.
*
* Related guide: <a href="https://stripe.com/docs/orders">Orders overview</a>
*
* @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 <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
Expand Down
14 changes: 14 additions & 0 deletions lib/PaymentLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the <a href="https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts">Connect documentation</a> 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 <code>null</code>, Stripe will dynamically show relevant payment methods you've enabled in your <a href="https://dashboard.stripe.com/settings/payment_methods">payment method settings</a>.
* @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 <code>subscription_data</code>.
* @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.
*/
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions lib/PromotionCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a
* href="https://stripe.com/docs/api#coupons">coupon</a>. 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 <a href="https://stripe.com/docs/api#invoices">invoices</a> or <a href="https://stripe.com/docs/api#create_order_legacy-coupon">orders</a>. Coupons do not work with conventional one-off <a href="https://stripe.com/docs/api#create_charge">charges</a>.
* @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 <a href="https://stripe.com/docs/api#subscriptions">subscriptions</a>, <a href="https://stripe.com/docs/api#invoices">invoices</a>, <a href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a>, <a href="https://stripe.com/docs/api#quotes">quotes</a>, and more. Coupons do not work with conventional one-off <a href="https://stripe.com/docs/api#create_charge">charges</a> or <a href="https://stripe.com/docs/api/payment_intents">payment intents</a>.
* @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.
Expand Down
2 changes: 1 addition & 1 deletion lib/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @property null|string $reason Reason for the refund, either user-provided (<code>duplicate</code>, <code>fraudulent</code>, or <code>requested_by_customer</code>) or generated by Stripe internally (<code>expired_uncaptured_charge</code>).
* @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 <code>pending</code>, <code>succeeded</code>, or <code>failed</code>. For other types of refunds, it can be <code>pending</code>, <code>succeeded</code>, <code>failed</code>, or <code>canceled</code>. Refer to our <a href="https://stripe.com/docs/refunds#failed-refunds">refunds</a> documentation for more details.
* @property null|string $status Status of the refund. For credit card refunds, this can be <code>pending</code>, <code>succeeded</code>, or <code>failed</code>. For other types of refunds, it can be <code>pending</code>, <code>requires_action</code>, <code>succeeded</code>, <code>failed</code>, or <code>canceled</code>. Refer to our <a href="https://stripe.com/docs/refunds#failed-refunds">refunds</a> 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
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function create($params = null, $opts = null)
}

/**
* Reopens a <code>processing</code> order.
* Reopens a <code>submitted</code> order.
*
* @param string $id
* @param null|array $params
Expand Down
1 change: 1 addition & 0 deletions lib/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>default_source</code>. If neither are set, invoices will use the customer's <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> or <a href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
* @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 <code>default_payment_method</code> is also set, <code>default_payment_method</code> will take precedence. If neither are set, invoices will use the customer's <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> or <a href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
* @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have <code>tax_rates</code> set. Invoices created will have their <code>default_tax_rates</code> 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.
Expand Down