diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION
index 472b52dc7..369d9db7c 100644
--- a/OPENAPI_VERSION
+++ b/OPENAPI_VERSION
@@ -1 +1 @@
-v1167
\ No newline at end of file
+v1187
\ No newline at end of file
diff --git a/init.php b/init.php
index 436577c36..66d9183ce 100644
--- a/init.php
+++ b/init.php
@@ -181,6 +181,7 @@
require __DIR__ . '/lib/Service/Apps/SecretService.php';
require __DIR__ . '/lib/Service/BalanceService.php';
require __DIR__ . '/lib/Service/BalanceTransactionService.php';
+require __DIR__ . '/lib/Service/Billing/AlertService.php';
require __DIR__ . '/lib/Service/Billing/BillingServiceFactory.php';
require __DIR__ . '/lib/Service/Billing/MeterEventAdjustmentService.php';
require __DIR__ . '/lib/Service/Billing/MeterEventService.php';
diff --git a/lib/Billing/Alert.php b/lib/Billing/Alert.php
index cdcf90c8b..5846efb1a 100644
--- a/lib/Billing/Alert.php
+++ b/lib/Billing/Alert.php
@@ -23,4 +23,113 @@ class Alert extends \Stripe\ApiResource
const STATUS_ACTIVE = 'active';
const STATUS_ARCHIVED = 'archived';
const STATUS_INACTIVE = 'inactive';
+
+ /**
+ * Creates a billing alert.
+ *
+ * @param null|array $params
+ * @param null|array|string $options
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert the created resource
+ */
+ public static function create($params = null, $options = null)
+ {
+ self::_validateParams($params);
+ $url = static::classUrl();
+
+ list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
+ $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
+ $obj->setLastResponse($response);
+
+ return $obj;
+ }
+
+ /**
+ * Lists billing active and inactive alerts.
+ *
+ * @param null|array $params
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Collection<\Stripe\Billing\Alert> of ApiResources
+ */
+ public static function all($params = null, $opts = null)
+ {
+ $url = static::classUrl();
+
+ return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
+ }
+
+ /**
+ * Retrieves a billing alert given an ID.
+ *
+ * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert
+ */
+ public static function retrieve($id, $opts = null)
+ {
+ $opts = \Stripe\Util\RequestOptions::parse($opts);
+ $instance = new static($id, $opts);
+ $instance->refresh();
+
+ return $instance;
+ }
+
+ /**
+ * @param null|array $params
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert the activated alert
+ */
+ public function activate($params = null, $opts = null)
+ {
+ $url = $this->instanceUrl() . '/activate';
+ list($response, $opts) = $this->_request('post', $url, $params, $opts);
+ $this->refreshFrom($response, $opts);
+
+ return $this;
+ }
+
+ /**
+ * @param null|array $params
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert the archived alert
+ */
+ public function archive($params = null, $opts = null)
+ {
+ $url = $this->instanceUrl() . '/archive';
+ list($response, $opts) = $this->_request('post', $url, $params, $opts);
+ $this->refreshFrom($response, $opts);
+
+ return $this;
+ }
+
+ /**
+ * @param null|array $params
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert the deactivated alert
+ */
+ public function deactivate($params = null, $opts = null)
+ {
+ $url = $this->instanceUrl() . '/deactivate';
+ list($response, $opts) = $this->_request('post', $url, $params, $opts);
+ $this->refreshFrom($response, $opts);
+
+ return $this;
+ }
}
diff --git a/lib/Card.php b/lib/Card.php
index b8a6b344a..e41e31d15 100644
--- a/lib/Card.php
+++ b/lib/Card.php
@@ -23,9 +23,9 @@
* @property null|string $address_zip ZIP or postal code.
* @property null|string $address_zip_check If address_zip
was provided, results of the check: pass
, fail
, unavailable
, or unchecked
.
* @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method
when creating a payout.
- * @property string $brand Card brand. Can be American Express
, Diners Club
, Discover
, Eftpos Australia
, JCB
, MasterCard
, UnionPay
, Visa
, or Unknown
.
+ * @property string $brand Card brand. Can be American Express
, Diners Club
, Discover
, Eftpos Australia
, Girocard
, JCB
, MasterCard
, UnionPay
, Visa
, or Unknown
.
* @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
- * @property null|string $currency Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where controller.requirement_collection is application
, which includes Custom accounts.
+ * @property null|string $currency Three-letter ISO code for currency in lowercase. Must be a supported currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where controller.requirement_collection is application
, which includes Custom accounts.
* @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
* @property null|string $cvc_check If a CVC was provided, results of the check: pass
, fail
, unavailable
, or unchecked
. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge.
* @property null|bool $default_for_currency Whether this card is the default external account for its currency. This property is only available for accounts where controller.requirement_collection is application
, which includes Custom accounts.
diff --git a/lib/Charge.php b/lib/Charge.php
index 5198a9997..3f8956a39 100644
--- a/lib/Charge.php
+++ b/lib/Charge.php
@@ -21,7 +21,7 @@
* @property null|string $authorization_code Authorization code on the charge.
* @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).
* @property \Stripe\StripeObject $billing_details
- * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This only works for card payments.
+ * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments.
* @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
@@ -52,8 +52,8 @@
* @property null|\Stripe\StripeObject $shipping Shipping information for the charge.
* @property null|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method
or payment_method_details
instead.
* @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details.
- * @property null|string $statement_descriptor For card charges, use statement_descriptor_suffix
instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
- * @property null|string $statement_descriptor_suffix Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
+ * @property null|string $statement_descriptor For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For a card charge, this value is ignored unless you don't specify a statement_descriptor_suffix
, in which case this value is used as the suffix.
+ * @property null|string $statement_descriptor_suffix Provides information about a card charge. Concatenated to the account's statement descriptor prefix to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor.
* @property string $status The status of the payment is either succeeded
, pending
, or failed
.
* @property null|string|\Stripe\Transfer $transfer ID of the transfer to the destination
account (only applicable if the charge was created using the destination
parameter).
* @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details.
diff --git a/lib/ErrorObject.php b/lib/ErrorObject.php
index 8d3def20e..4c3b04b40 100644
--- a/lib/ErrorObject.php
+++ b/lib/ErrorObject.php
@@ -114,6 +114,7 @@ class ErrorObject extends StripeObject
const CODE_INVALID_CVC = 'invalid_cvc';
const CODE_INVALID_EXPIRY_MONTH = 'invalid_expiry_month';
const CODE_INVALID_EXPIRY_YEAR = 'invalid_expiry_year';
+ const CODE_INVALID_MANDATE_REFERENCE_PREFIX_FORMAT = 'invalid_mandate_reference_prefix_format';
const CODE_INVALID_NUMBER = 'invalid_number';
const CODE_INVALID_SOURCE_USAGE = 'invalid_source_usage';
const CODE_INVALID_TAX_LOCATION = 'invalid_tax_location';
diff --git a/lib/Identity/VerificationSession.php b/lib/Identity/VerificationSession.php
index 8ba9a663c..352b12744 100644
--- a/lib/Identity/VerificationSession.php
+++ b/lib/Identity/VerificationSession.php
@@ -29,6 +29,7 @@
* @property null|\Stripe\StripeObject $options A set of options for the session’s verification checks.
* @property null|\Stripe\StripeObject $provided_details Details provided about the user being verified. These details may be shown to the user.
* @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
+ * @property null|string $related_customer Token referencing a Customer resource.
* @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions.
* @property string $type The type of verification check to be performed.
* @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe.
diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php
index a6f8f1935..392bc9818 100644
--- a/lib/PaymentIntent.php
+++ b/lib/PaymentIntent.php
@@ -49,11 +49,11 @@
* @property null|\Stripe\StripeObject $processing If present, this property tells you about the processing state of the payment.
* @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If receipt_email
is specified for a payment in live mode, a receipt will be sent regardless of your email settings.
* @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any.
- * @property null|string $setup_future_usage
Indicates that you intend to make future payments with this PaymentIntent's payment method.
Providing this parameter will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.
If the payment method is card_present
and isn't a digital wallet, then a generated_card payment method representing the card is created and attached to the Customer instead.
When processing card payments, Stripe also uses setup_future_usage
to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.
Indicates that you intend to make future payments with this PaymentIntent's payment method.
If you provide a Customer with the PaymentIntent, you can use this parameter to attach the payment method to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still attach the payment method to a Customer after the transaction completes.
If the payment method is card_present
and isn't a digital wallet, Stripe creates and attaches a generated_card payment method representing the card to the Customer instead.
When processing card payments, Stripe uses setup_future_usage
to help you comply with regional legislation and network rules, such as SCA.
requires_payment_method
, requires_confirmation
, requires_action
, processing
, requires_capture
, canceled
, or succeeded
. Read more about each PaymentIntent status.
* @property null|\Stripe\StripeObject $transfer_data The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts.
* @property null|string $transfer_group A string that identifies the resulting payment as part of a group. Learn more about the use case for connected accounts.
diff --git a/lib/Service/Billing/AlertService.php b/lib/Service/Billing/AlertService.php
new file mode 100644
index 000000000..8baafb1bf
--- /dev/null
+++ b/lib/Service/Billing/AlertService.php
@@ -0,0 +1,107 @@
+request('post', $this->buildPath('/v1/billing/alerts/%s/activate', $id), $params, $opts);
+ }
+
+ /**
+ * Lists billing active and inactive alerts.
+ *
+ * @param null|array $params
+ * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Collection<\Stripe\Billing\Alert>
+ */
+ public function all($params = null, $opts = null)
+ {
+ return $this->requestCollection('get', '/v1/billing/alerts', $params, $opts);
+ }
+
+ /**
+ * Archives this alert, removing it from the list view and APIs. This is
+ * non-reversible.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert
+ */
+ public function archive($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/billing/alerts/%s/archive', $id), $params, $opts);
+ }
+
+ /**
+ * Creates a billing alert.
+ *
+ * @param null|array $params
+ * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert
+ */
+ public function create($params = null, $opts = null)
+ {
+ return $this->request('post', '/v1/billing/alerts', $params, $opts);
+ }
+
+ /**
+ * Deactivates this alert, preventing it from triggering.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert
+ */
+ public function deactivate($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/billing/alerts/%s/deactivate', $id), $params, $opts);
+ }
+
+ /**
+ * Retrieves a billing alert given an ID.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Billing\Alert
+ */
+ public function retrieve($id, $params = null, $opts = null)
+ {
+ return $this->request('get', $this->buildPath('/v1/billing/alerts/%s', $id), $params, $opts);
+ }
+}
diff --git a/lib/Service/Billing/BillingServiceFactory.php b/lib/Service/Billing/BillingServiceFactory.php
index 234dd822c..809febe62 100644
--- a/lib/Service/Billing/BillingServiceFactory.php
+++ b/lib/Service/Billing/BillingServiceFactory.php
@@ -7,6 +7,7 @@
/**
* Service factory class for API resources in the Billing namespace.
*
+ * @property AlertService $alerts
* @property MeterEventAdjustmentService $meterEventAdjustments
* @property MeterEventService $meterEvents
* @property MeterService $meters
@@ -17,6 +18,7 @@ class BillingServiceFactory extends \Stripe\Service\AbstractServiceFactory
* @var arrayCalculation
object, if the calculation hasn’t
+ * expired.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Tax\Calculation
+ */
+ public function retrieve($id, $params = null, $opts = null)
+ {
+ return $this->request('get', $this->buildPath('/v1/tax/calculations/%s', $id), $params, $opts);
+ }
}
diff --git a/lib/Subscription.php b/lib/Subscription.php
index 1dae9385a..f041a650a 100644
--- a/lib/Subscription.php
+++ b/lib/Subscription.php
@@ -18,7 +18,7 @@
* @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.
+ * @property bool $cancel_at_period_end Whether this subscription will (if status=active
) or did (if status=canceled
) cancel at the end of the current billing period.
* @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end
, canceled_at
will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
* @property null|\Stripe\StripeObject $cancellation_details Details about why this subscription was cancelled
* @property string $collection_method Either charge_automatically
, or send_invoice
. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active
.
diff --git a/lib/Tax/Calculation.php b/lib/Tax/Calculation.php
index 26d9890ad..0e56bfd49 100644
--- a/lib/Tax/Calculation.php
+++ b/lib/Tax/Calculation.php
@@ -52,6 +52,26 @@ public static function create($params = null, $options = null)
return $obj;
}
+ /**
+ * Retrieves a Tax Calculation
object, if the calculation hasn’t
+ * expired.
+ *
+ * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
+ * @param null|array|string $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Tax\Calculation
+ */
+ public static function retrieve($id, $opts = null)
+ {
+ $opts = \Stripe\Util\RequestOptions::parse($opts);
+ $instance = new static($id, $opts);
+ $instance->refresh();
+
+ return $instance;
+ }
+
/**
* @param string $id
* @param null|array $params
diff --git a/lib/Terminal/Reader.php b/lib/Terminal/Reader.php
index 33953963c..abb8a0d56 100644
--- a/lib/Terminal/Reader.php
+++ b/lib/Terminal/Reader.php
@@ -20,7 +20,7 @@
* @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader.
* @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 string $serial_number Serial number of the reader.
- * @property null|string $status The networking status of the reader.
+ * @property null|string $status The networking status of the reader. We do not recommend using this field in flows that may block taking payments.
*/
class Reader extends \Stripe\ApiResource
{