diff --git a/lib/Account.php b/lib/Account.php index 79a009b47..9d86525bb 100644 --- a/lib/Account.php +++ b/lib/Account.php @@ -174,6 +174,24 @@ public function deauthorize($clientId = null, $opts = null) return OAuth::deauthorize($params, $opts); } + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of persons + */ + public function persons($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/persons'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + /** * @param null|array $params * @param null|array|string $opts @@ -336,24 +354,6 @@ public static function createLoginLink($id, $params = null, $opts = null) const PATH_PERSONS = '/persons'; - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of persons - */ - public function persons($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/persons'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - /** * @param string $id the ID of the account on which to retrieve the persons * @param null|array $params diff --git a/lib/Capability.php b/lib/Capability.php index 2d791eecb..d02154cfe 100644 --- a/lib/Capability.php +++ b/lib/Capability.php @@ -23,11 +23,6 @@ class Capability extends ApiResource use ApiOperations\Update; - /** - * Possible string representations of a capability's status. - * - * @see https://stripe.com/docs/api/capabilities/object#capability_object-status - */ const STATUS_ACTIVE = 'active'; const STATUS_INACTIVE = 'inactive'; const STATUS_PENDING = 'pending'; diff --git a/lib/Card.php b/lib/Card.php index 694220f66..b33b6f5fd 100644 --- a/lib/Card.php +++ b/lib/Card.php @@ -31,7 +31,7 @@ * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number. * @property int $exp_month Two-digit number representing the card's expiration month. * @property int $exp_year Four-digit number representing the card's expiration year. - * @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. + * @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number,for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. * @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. * @property string $last4 The last four digits of the card. * @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. diff --git a/lib/Charge.php b/lib/Charge.php index d89eab09b..eaf02cde2 100644 --- a/lib/Charge.php +++ b/lib/Charge.php @@ -13,7 +13,7 @@ * * @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 Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. diff --git a/lib/CreditNoteLineItem.php b/lib/CreditNoteLineItem.php index 8e274b977..3751e23fc 100644 --- a/lib/CreditNoteLineItem.php +++ b/lib/CreditNoteLineItem.php @@ -3,21 +3,19 @@ namespace Stripe; /** - * Class InvoiceLineItem. - * - * @property string $id - * @property string $object - * @property int $amount - * @property string $description - * @property int $discount_amount - * @property string $invoice_line_item - * @property bool $livemode - * @property int $quantity - * @property array $tax_amounts - * @property array $tax_rates - * @property string $type - * @property null|int $unit_amount - * @property null|string $unit_amount_decimal + * @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 The integer amount in %s representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. + * @property null|string $description Description of the item being credited. + * @property int $discount_amount The integer amount in %s representing the discount being credited for this line item. + * @property string $invoice_line_item ID of the invoice line item being credited + * @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|int $quantity The number of units of product being credited. + * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. + * @property null|int $unit_amount The cost of each unit of product being credited. + * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. */ class CreditNoteLineItem extends ApiResource { diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php index d8d42a8ce..2b92144e9 100644 --- a/lib/CustomerBalanceTransaction.php +++ b/lib/CustomerBalanceTransaction.php @@ -33,12 +33,7 @@ class CustomerBalanceTransaction extends ApiResource { const OBJECT_NAME = 'customer_balance_transaction'; - /** - * Possible string representations of a balance transaction's type. - * - * @see https://stripe.com/docs/api/customers/customer_balance_transaction_object#customer_balance_transaction_object-type - */ - const TYPE_ADJUSTEMENT = 'adjustment'; + const TYPE_ADJUSTMENT = 'adjustment'; const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; const TYPE_CREDIT_NOTE = 'credit_note'; const TYPE_INITIAL = 'initial'; diff --git a/lib/Issuing/Authorization.php b/lib/Issuing/Authorization.php index 1e5e3bad0..374d4f6ee 100644 --- a/lib/Issuing/Authorization.php +++ b/lib/Issuing/Authorization.php @@ -5,14 +5,16 @@ /** * When an issued card is used to * make a purchase, an Issuing Authorization object is created. Authorizations must be - * approved for the purchase to be completed successfully. + * href="https://stripe.com/docs/issuing/purchases/authorizations">Authorizations + * must be approved for the purchase to be completed successfully. * - * Related guide: Issued - * Card Authorizations. + * Related guide: Issued Card + * Authorizations. * * @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 The total amount in the card's currency that was authorized or rejected. * @property bool $approved Whether the authorization has been approved. * @property string $authorization_method How the card details were provided. * @property int $authorized_amount The amount that has been authorized. This will be 0 when the object is created, and increase after it has been approved. @@ -21,15 +23,19 @@ * @property \Stripe\Issuing\Card $card You can create physical or virtual cards that are issued to cardholders. * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. * @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. * @property int $held_amount The amount the authorization is expected to be in held_currency. When Stripe holds funds from you, this is the amount reserved for the authorization. This will be 0 when the object is created, and increase after it has been approved. For multi-currency transactions, held_amount can be used to determine the expected exchange rate. * @property string $held_currency The currency of the held amount. This will always be the card currency. * @property bool $is_held_amount_controllable If set true, you may provide held_amount to control how much to hold for the authorization. * @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 int $merchant_amount The total amount that was authorized or rejected in the local merchant_currency. + * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property \Stripe\StripeObject $merchant_data * @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 int $pending_authorized_amount The amount the user is requesting to be authorized. This field will only be non-zero during an issuing.authorization.request webhook. * @property int $pending_held_amount The additional amount Stripe will hold if the authorization is approved. This field will only be non-zero during an issuing.authorization.request webhook. - * @property \Stripe\StripeObject[] $request_history History of every time the authorization was approved/denied (whether approved/denied by you directly, or by Stripe based on your authorization_controls). If the merchant changes the authorization by performing an incremental authorization or partial capture, you can look at request_history to see the previous states of the authorization. + * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing.authorization.request webhook. + * @property \Stripe\StripeObject[] $request_history History of every time the authorization was approved/denied (whether approved/denied by you directly, or by Stripe based on your authorization_controls). If the merchant changes the authorization by performing an incremental authorization or partial capture, you can look at request_history to see the previous states of the authorization. * @property string $status The current status of the authorization in its lifecycle. * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. * @property \Stripe\StripeObject $verification_data diff --git a/lib/Issuing/Card.php b/lib/Issuing/Card.php index 891338725..71c7be622 100644 --- a/lib/Issuing/Card.php +++ b/lib/Issuing/Card.php @@ -20,6 +20,7 @@ * @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 $name The name of the cardholder, printed on the card. * @property null|\Stripe\StripeObject $pin Metadata about the PIN on the card. + * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. * @property null|string $replacement_reason The reason why the previous card needed to be replaced. * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. diff --git a/lib/Issuing/Cardholder.php b/lib/Issuing/Cardholder.php index ff4cd8946..9a271cdc3 100644 --- a/lib/Issuing/Cardholder.php +++ b/lib/Issuing/Cardholder.php @@ -12,9 +12,9 @@ * * @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 null|\Stripe\StripeObject $authorization_controls Spending rules that give you some control over how this cardholder's cards can be used. Refer to our authorizations documentation for more details. + * @property null|\Stripe\StripeObject $authorization_controls Spending rules that give you some control over how this cardholder's cards can be used. Refer to our authorizations documentation for more details. * @property \Stripe\StripeObject $billing - * @property null|\Stripe\StripeObject $company Additional information about a business_entity cardholder. + * @property null|\Stripe\StripeObject $company Additional information about a company cardholder. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $email The cardholder's email address. * @property null|\Stripe\StripeObject $individual Additional information about an individual cardholder. @@ -25,7 +25,7 @@ * @property null|string $phone_number The cardholder's phone number. * @property \Stripe\StripeObject $requirements * @property string $status Specifies whether to permit authorizations on this cardholder's cards. - * @property string $type One of individual or business_entity. + * @property string $type One of individual or company. */ class Cardholder extends \Stripe\ApiResource { diff --git a/lib/Issuing/Dispute.php b/lib/Issuing/Dispute.php index d498a3e4b..56a89d867 100644 --- a/lib/Issuing/Dispute.php +++ b/lib/Issuing/Dispute.php @@ -4,10 +4,12 @@ /** * As a card issuer, you can dispute transactions that - * you do not recognize, suspect to be fraudulent, or have some other issue. + * href="https://stripe.com/docs/issuing/purchases/disputes">dispute + * transactions that you do not recognize, suspect to be fraudulent, or have some + * other issue. * - * Related guide: Disputing + * Related guide: Disputing * Transactions * * @property string $id Unique identifier for the object. diff --git a/lib/Issuing/Transaction.php b/lib/Issuing/Transaction.php index f8ec46423..8a1505d47 100644 --- a/lib/Issuing/Transaction.php +++ b/lib/Issuing/Transaction.php @@ -8,8 +8,9 @@ * purchase or refund, is represented by an Issuing Transaction * object. * - * Related guide: Issued - * Card Transactions. + * Related guide: Issued Card + * Transactions. * * @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/PaymentIntent.php b/lib/PaymentIntent.php index 687126df0..aae2fc637 100644 --- a/lib/PaymentIntent.php +++ b/lib/PaymentIntent.php @@ -31,7 +31,7 @@ * @property string $confirmation_method * @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. - * @property null|string|\Stripe\Customer $customer

ID of the Customer this PaymentIntent belongs to, if one exists.

If present, payment methods used with this PaymentIntent can only be attached to this Customer, and payment methods attached to other Customers cannot be used with this PaymentIntent.

+ * @property null|string|\Stripe\Customer $customer

ID of the Customer this PaymentIntent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this PaymentIntent.

If present in combination with setup_future_usage, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. * @property null|\Stripe\ErrorObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. @@ -44,7 +44,7 @@ * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. * @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. * @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.

If present, the payment method used with this PaymentIntent can be attached to a Customer, even after the transaction completes.

For more, learn to save card details during payment.

Stripe uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer.

+ * @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.

For more, learn to save card details during payment.

Stripe uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer.

* @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent. * @property null|string|\Stripe\StripeObject $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. diff --git a/lib/Person.php b/lib/Person.php index 89ab2094e..b48c095e2 100644 --- a/lib/Person.php +++ b/lib/Person.php @@ -41,19 +41,9 @@ class Person extends ApiResource use ApiOperations\Delete; use ApiOperations\Update; - /** - * Possible string representations of a person's gender. - * - * @see https://stripe.com/docs/api/persons/object#person_object-gender - */ - const GENDER_MALE = 'male'; const GENDER_FEMALE = 'female'; + const GENDER_MALE = 'male'; - /** - * Possible string representations of a person's verification status. - * - * @see https://stripe.com/docs/api/persons/object#person_object-verification-status - */ const VERIFICATION_STATUS_PENDING = 'pending'; const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; const VERIFICATION_STATUS_VERIFIED = 'verified'; diff --git a/lib/SetupIntent.php b/lib/SetupIntent.php index 3f52d22ff..af08860dd 100644 --- a/lib/SetupIntent.php +++ b/lib/SetupIntent.php @@ -3,11 +3,12 @@ namespace Stripe; /** - * A SetupIntent guides you through the process of setting up a customer's payment - * credentials for future payments. For example, you could use a SetupIntent to set - * up your customer's card without immediately collecting a payment. Later, you can - * use PaymentIntents to - * drive the payment flow. + * A SetupIntent guides you through the process of setting up and saving a + * customer's payment credentials for future payments. For example, you could use a + * SetupIntent to set up and save your customer's card without immediately + * collecting a payment. Later, you can use PaymentIntents to drive + * the payment flow. * * Create a SetupIntent as soon as you're ready to collect your customer's payment * credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no @@ -23,6 +24,13 @@ * Authentication at the time of payment method collection in order to * streamline later off-session payments. + * If the SetupIntent is used with a Customer, + * upon success, it will automatically attach the resulting payment method to that + * Customer. We recommend using SetupIntents or setup_future_usage + * on PaymentIntents to save payment methods in order to prevent saving invalid or + * unoptimized payment methods. * * By using SetupIntents, you ensure that your customers experience the minimum set * of required friction, even as regulations change over time. @@ -36,7 +44,7 @@ * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. * @property null|string $client_secret

The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer

ID of the Customer this SetupIntent belongs to, if one exists.

If present, payment methods used with this SetupIntent can only be attached to this Customer, and payment methods attached to other Customers cannot be used with this SetupIntent.

+ * @property null|string|\Stripe\Customer $customer

ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. * @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. diff --git a/lib/Subscription.php b/lib/Subscription.php index e2e35531c..a31badd86 100644 --- a/lib/Subscription.php +++ b/lib/Subscription.php @@ -33,6 +33,7 @@ * @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|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. + * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. diff --git a/lib/TaxId.php b/lib/TaxId.php index 474083ad3..70414e607 100644 --- a/lib/TaxId.php +++ b/lib/TaxId.php @@ -26,11 +26,6 @@ class TaxId extends ApiResource use ApiOperations\Delete; - /** - * Possible string representations of a tax id's type. - * - * @see https://stripe.com/docs/api/customer_tax_ids/object#tax_id_object-type - */ const TYPE_AU_ABN = 'au_abn'; const TYPE_CA_BN = 'ca_bn'; const TYPE_CA_QST = 'ca_qst'; @@ -51,15 +46,10 @@ class TaxId extends ApiResource const TYPE_SG_UEN = 'sg_uen'; const TYPE_TH_VAT = 'th_vat'; const TYPE_TW_VAT = 'tw_vat'; - const TYPE_US_EIN = 'us_ein'; const TYPE_UNKNOWN = 'unknown'; + const TYPE_US_EIN = 'us_ein'; const TYPE_ZA_VAT = 'za_vat'; - /** - * Possible string representations of the verification status. - * - * @see https://stripe.com/docs/api/customer_tax_ids/object#tax_id_object-verification - */ const VERIFICATION_STATUS_PENDING = 'pending'; const VERIFICATION_STATUS_UNAVAILABLE = 'unavailable'; const VERIFICATION_STATUS_UNVERIFIED = 'unverified';