source_types
property.
- * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types
property.
- * @property null|\Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts.
+ * @property \Stripe\StripeObject[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the Transfers API or Payouts API. You can find the available balance for each currency and payment type in the source_types
property.
+ * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the source_types
property.
+ * @property null|\Stripe\StripeObject[] $instant_available Funds that you can pay out using Instant Payouts.
* @property null|\Stripe\StripeObject $issuing
* @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[] $pending Funds that are not yet available in the balance. The pending balance for each currency, and for each payment type, can be found in the source_types
property.
+ * @property \Stripe\StripeObject[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the source_types
property.
*/
class Balance extends SingletonApiResource
{
diff --git a/lib/ErrorObject.php b/lib/ErrorObject.php
index c5a8cfa688..ec0ed43178 100644
--- a/lib/ErrorObject.php
+++ b/lib/ErrorObject.php
@@ -186,6 +186,7 @@ class ErrorObject extends StripeObject
const CODE_SKU_INACTIVE = 'sku_inactive';
const CODE_STATE_UNSUPPORTED = 'state_unsupported';
const CODE_STATUS_TRANSITION_INVALID = 'status_transition_invalid';
+ const CODE_STRIPE_TAX_INACTIVE = 'stripe_tax_inactive';
const CODE_TAX_ID_INVALID = 'tax_id_invalid';
const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed';
const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported';
diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php
index 3c13d008c0..34346a1eb7 100644
--- a/lib/Service/CustomerService.php
+++ b/lib/Service/CustomerService.php
@@ -179,7 +179,7 @@ public function createSource($parentId, $params = null, $opts = null)
}
/**
- * Creates a new TaxID
object for a customer.
+ * Creates a new tax_id
object for a customer.
*
* @param string $parentId
* @param null|array $params
@@ -245,7 +245,7 @@ public function deleteSource($parentId, $id, $params = null, $opts = null)
}
/**
- * Deletes an existing TaxID
object.
+ * Deletes an existing tax_id
object.
*
* @param string $parentId
* @param string $id
@@ -364,7 +364,7 @@ public function retrieveSource($parentId, $id, $params = null, $opts = null)
}
/**
- * Retrieves the TaxID
object with the given identifier.
+ * Retrieves the tax_id
object with the given identifier.
*
* @param string $parentId
* @param string $id
diff --git a/lib/Service/PaymentIntentService.php b/lib/Service/PaymentIntentService.php
index a276519575..a3fd8d133b 100644
--- a/lib/Service/PaymentIntentService.php
+++ b/lib/Service/PaymentIntentService.php
@@ -196,12 +196,12 @@ public function incrementAuthorization($id, $params = null, $opts = null)
/**
* Retrieves the details of a PaymentIntent that has previously been created.
*
- * Client-side retrieval using a publishable key is allowed when the
- * client_secret
is provided in the query string.
+ * You can retrieve a PaymentIntent client-side using a publishable key when the
+ * client_secret
is in the query string.
*
- * When retrieved with a publishable key, only a subset of properties will be
- * returned. Please refer to the payment
- * intent object reference for more details.
+ * If you retrieve a PaymentIntent with a publishable key, it only returns a subset
+ * of properties. Refer to the payment intent
+ * object reference for more details.
*
* @param string $id
* @param null|array $params
diff --git a/lib/Service/TestHelpers/Issuing/AuthorizationService.php b/lib/Service/TestHelpers/Issuing/AuthorizationService.php
new file mode 100644
index 0000000000..73de27cb99
--- /dev/null
+++ b/lib/Service/TestHelpers/Issuing/AuthorizationService.php
@@ -0,0 +1,87 @@
+request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/capture', $id), $params, $opts);
+ }
+
+ /**
+ * Create a test-mode authorization.
+ *
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Issuing\Authorization
+ */
+ public function create($params = null, $opts = null)
+ {
+ return $this->request('post', '/v1/test_helpers/issuing/authorizations', $params, $opts);
+ }
+
+ /**
+ * Expire a test-mode Authorization.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Issuing\Authorization
+ */
+ public function expire($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/expire', $id), $params, $opts);
+ }
+
+ /**
+ * Increment a test-mode Authorization.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Issuing\Authorization
+ */
+ public function increment($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/increment', $id), $params, $opts);
+ }
+
+ /**
+ * Reverse a test-mode Authorization.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\Issuing\Authorization
+ */
+ public function reverse($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/authorizations/%s/reverse', $id), $params, $opts);
+ }
+}
diff --git a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php
index a202ec33f0..e15a7c87c8 100644
--- a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php
+++ b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php
@@ -7,7 +7,9 @@
/**
* Service factory class for API resources in the Issuing namespace.
*
+ * @property AuthorizationService $authorizations
* @property CardService $cards
+ * @property TransactionService $transactions
*/
class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
@@ -15,7 +17,9 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory
* @var arrayamount
in currency A, times exchange_rate
, would be the amount
in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's amount
would be 1000
and currency
would be eur
. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's amount
would be 1234
, currency
would be usd
, and exchange_rate
would be 1.234
.
+ * @property null|float $exchange_rate If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the amount
in currency A, multipled by the exchange_rate
, equals the amount
in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's amount
is 1000
and currency
is eur
. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's amount
is 1234
, its currency
is usd
, and the exchange_rate
is 1.234
.
* @property int $fee Fees (in cents (or local equivalent)) paid for this transaction.
* @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.
- * @property int $net Net amount of the transaction, in cents (or local equivalent).
- * @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 The Stripe object to which this transaction is related.
- * @property string $status If the transaction's net funds are available in the Stripe balance yet. 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. If you are looking to classify transactions for accounting purposes, you might want to consider reporting_category
instead.
+ * @property int $net Net amount of the transaction (in cents (or local equivalent)).
+ * @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 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.
*/
class BalanceTransaction extends ApiResource
{
diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php
index b1ed61e5d7..302191c6f5 100644
--- a/lib/Checkout/Session.php
+++ b/lib/Checkout/Session.php
@@ -52,6 +52,7 @@
* @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment
mode.
* @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this Session.
* @property null|string $payment_method_collection Configure whether a Checkout Session should collect a payment method.
+ * @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this Checkout session if using dynamic payment methods.
* @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
* @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
* @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.
diff --git a/lib/Customer.php b/lib/Customer.php
index 7d3f8983c7..3e2855906e 100644
--- a/lib/Customer.php
+++ b/lib/Customer.php
@@ -5,38 +5,38 @@
namespace Stripe;
/**
- * This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer.
+ * This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer.
*
* Related guide: Save a card during payment
*
* @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 $address The customer's address.
- * @property null|int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
- * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. These funds can be applied towards payment intents with source "cash_balance". The settings[reconciliation_mode] field describes whether these funds are applied to such payment intents manually or automatically.
+ * @property null|int $balance The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize.
+ * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The settings[reconciliation_mode]
field describes if these funds apply to these payment intents manually or automatically.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.
- * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the customer.
If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.
- * @property null|bool $delinquentWhen the customer's latest invoice is billed by charging automatically, delinquent
is true
if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent
is true
if the invoice isn't paid by its due date.
If an invoice is marked uncollectible by dunning, delinquent
doesn't get reset to false
.
ID of the default payment source for the customer.
If you use payment methods created through the PaymentMethods API, see the invoice_settings.default_payment_method field instead.
+ * @property null|bool $delinquentIf Stripe bills the customer's latest invoice by automatically charging and the latest charge fails, it sets delinquent`` to
true. If Stripe bills the invoice by sending it, and the invoice isn't paid by the due date, it also sets `delinquent
to true
.
If an invoice becomes uncollectible by dunning, delinquent
doesn't reset to false
.
true
if the object exists in live mode or the value false
if the object exists in test mode.
* @property null|\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 $name The customer's full name or business name.
- * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001.
+ * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number (for example, 0001).
* @property null|string $phone The customer's phone number.
* @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference.
* @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
* @property null|\Stripe\Collection<\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> $sources The customer's payment sources, if any.
* @property null|\Stripe\Collection<\Stripe\Subscription> $subscriptions The customer's current subscriptions, if any.
* @property null|\Stripe\StripeObject $tax
- * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none
, exempt
, or reverse
. When set to reverse
, invoice and receipt PDFs include the text "Reverse charge".
+ * @property null|string $tax_exempt Describes the customer's tax exemption status, which is none
, exempt
, or reverse
. When set to reverse
, invoice and receipt PDFs include the following text: "Reverse charge".
* @property null|\Stripe\Collection<\Stripe\TaxId> $tax_ids The customer's tax IDs.
- * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this customer belongs to.
+ * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock that this customer belongs to.
*/
class Customer extends ApiResource
{
diff --git a/lib/Dispute.php b/lib/Dispute.php
index 62c99c15a3..55cc06a5a6 100644
--- a/lib/Dispute.php
+++ b/lib/Dispute.php
@@ -6,29 +6,27 @@
/**
* A dispute occurs when a customer questions your charge with their card issuer.
- * When this happens, you're given the opportunity to respond to the dispute with
- * evidence that shows that the charge is legitimate. You can find more
- * information about the dispute process in our Disputes and
- * Fraud documentation.
+ * When this happens, you have the opportunity to respond to the dispute with
+ * evidence that shows that the charge is legitimate.
*
* Related guide: Disputes and fraud
*
* @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 Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed).
+ * @property int $amount Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed).
* @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute.
- * @property string|\Stripe\Charge $charge ID of the charge that was disputed.
+ * @property string|\Stripe\Charge $charge ID of the charge that's disputed.
* @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 \Stripe\StripeObject $evidence
* @property \Stripe\StripeObject $evidence_details
- * @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute.
+ * @property bool $is_charge_refundable If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute.
* @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 $network_reason_code Network-dependent reason code for the dispute.
- * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed.
+ * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that's disputed.
* @property null|\Stripe\StripeObject $payment_method_details
- * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process
, check_returned
, credit_not_processed
, customer_initiated
, debit_not_authorized
, duplicate
, fraudulent
, general
, incorrect_account_details
, insufficient_funds
, product_not_received
, product_unacceptable
, subscription_canceled
, or unrecognized
. Read more about dispute reasons.
+ * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process
, check_returned
, credit_not_processed
, customer_initiated
, debit_not_authorized
, duplicate
, fraudulent
, general
, incorrect_account_details
, insufficient_funds
, product_not_received
, product_unacceptable
, subscription_canceled
, or unrecognized
. Learn more about dispute reasons.
* @property string $status Current status of dispute. Possible values are warning_needs_response
, warning_under_review
, warning_closed
, needs_response
, under_review
, won
, or lost
.
*/
class Dispute extends ApiResource
diff --git a/lib/Event.php b/lib/Event.php
index 77354f3b4d..e01074ae95 100644
--- a/lib/Event.php
+++ b/lib/Event.php
@@ -8,46 +8,47 @@
* Events are our way of letting you know when something interesting happens in
* your account. When an interesting event occurs, we create a new Event
* object. For example, when a charge succeeds, we create a charge.succeeded
- * event; and when an invoice payment attempt fails, we create an
- * invoice.payment_failed
event. Note that many API requests may cause multiple
- * events to be created. For example, if you create a new subscription for a
- * customer, you will receive both a customer.subscription.created
event and a
+ * event, and when an invoice payment attempt fails, we create an
+ * invoice.payment_failed
event. Certain API requests might create multiple
+ * events. For example, if you create a new subscription for a
+ * customer, you receive both a customer.subscription.created
event and a
* charge.succeeded
event.
*
- * Events occur when the state of another API resource changes. The state of that
- * resource at the time of the change is embedded in the event's data field. For
- * example, a charge.succeeded
event will contain a charge, and an
- * invoice.payment_failed
event will contain an invoice.
+ * Events occur when the state of another API resource changes. The event's data
+ * field embeds the resource's state at the time of the change. For
+ * example, a charge.succeeded
event contains a charge, and an
+ * invoice.payment_failed
event contains an invoice.
*
* As with other API resources, you can use endpoints to retrieve an
* individual event or a list of events
* from the API. We also have a separate
* webhooks system for sending the
- * Event
objects directly to an endpoint on your server. Webhooks are managed
- * in your
- * account settings,
- * and our Using Webhooks guide will help you get set up.
+ * Event
objects directly to an endpoint on your server. You can manage
+ * webhooks in your
+ * account settings. Learn how
+ * to [listen for events]
+ * (/docs/webhooks) so that your integration can automatically trigger reactions.
*
- * When using Connect, you can also receive notifications of
- * events that occur in connected accounts. For these events, there will be an
+ * When using Connect, you can also receive event notifications
+ * that occur in connected accounts. For these events, there's an
* additional account
attribute in the received Event
object.
*
- * NOTE: Right now, access to events through the Retrieve Event API is
- * guaranteed only for 30 days.
+ * We only guarantee access to events through the Retrieve Event API
+ * for 30 days.
*
* This class includes constants for the possible string representations of
* event types. See https://stripe.com/docs/api#event_types for more details.
*
* @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|string $account The connected account that originated the event.
- * @property null|string $api_version The Stripe API version used to render data
. Note: This property is populated only for events on or after October 31, 2014.
+ * @property null|string $account The connected account that originates the event.
+ * @property null|string $api_version The Stripe API version used to render data
. This property is populated only for events on or after October 31, 2014.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property \Stripe\StripeObject $data
* @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 $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified.
- * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event.
- * @property string $type Description of the event (e.g., invoice.created
or charge.refunded
).
+ * @property int $pending_webhooks Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify.
+ * @property null|\Stripe\StripeObject $request Information on the API request that triggers the event.
+ * @property string $type Description of the event (for example, invoice.created
or charge.refunded
).
*/
class Event extends ApiResource
{
diff --git a/lib/PaymentIntent.php b/lib/PaymentIntent.php
index 563521df6b..661d349026 100644
--- a/lib/PaymentIntent.php
+++ b/lib/PaymentIntent.php
@@ -43,6 +43,7 @@
* @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.
* @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details.
* @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used in this PaymentIntent.
+ * @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this PaymentIntent.
* @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this PaymentIntent.
* @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.
* @property null|\Stripe\StripeObject $processing If present, this property tells you about the processing state of the payment.
diff --git a/lib/PaymentMethodConfiguration.php b/lib/PaymentMethodConfiguration.php
new file mode 100644
index 0000000000..e2df262148
--- /dev/null
+++ b/lib/PaymentMethodConfiguration.php
@@ -0,0 +1,64 @@
+true if the object exists in live mode or the value false
if the object exists in test mode.
+ * @property null|\Stripe\StripeObject $multibanco
+ * @property string $name Configuration name.
+ * @property null|\Stripe\StripeObject $netbanking
+ * @property null|\Stripe\StripeObject $oxxo
+ * @property null|\Stripe\StripeObject $p24
+ * @property null|string $parent The configuration's parent configuration.
+ * @property null|\Stripe\StripeObject $pay_by_bank
+ * @property null|\Stripe\StripeObject $paynow
+ * @property null|\Stripe\StripeObject $paypal
+ * @property null|\Stripe\StripeObject $promptpay
+ * @property null|\Stripe\StripeObject $sepa_debit
+ * @property null|\Stripe\StripeObject $sofort
+ * @property null|\Stripe\StripeObject $upi
+ * @property null|\Stripe\StripeObject $us_bank_account
+ * @property null|\Stripe\StripeObject $wechat_pay
+ */
+class PaymentMethodConfiguration extends ApiResource
+{
+ const OBJECT_NAME = 'payment_method_configuration';
+
+ use ApiOperations\All;
+ use ApiOperations\Create;
+ use ApiOperations\Retrieve;
+ use ApiOperations\Update;
+}
diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php
index 2082398b95..b656a355b3 100644
--- a/lib/Service/CoreServiceFactory.php
+++ b/lib/Service/CoreServiceFactory.php
@@ -37,6 +37,7 @@
* @property OAuthService $oauth
* @property PaymentIntentService $paymentIntents
* @property PaymentLinkService $paymentLinks
+ * @property PaymentMethodConfigurationService $paymentMethodConfigurations
* @property PaymentMethodDomainService $paymentMethodDomains
* @property PaymentMethodService $paymentMethods
* @property PayoutService $payouts
@@ -104,6 +105,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
'oauth' => OAuthService::class,
'paymentIntents' => PaymentIntentService::class,
'paymentLinks' => PaymentLinkService::class,
+ 'paymentMethodConfigurations' => PaymentMethodConfigurationService::class,
'paymentMethodDomains' => PaymentMethodDomainService::class,
'paymentMethods' => PaymentMethodService::class,
'payouts' => PayoutService::class,
diff --git a/lib/Service/PaymentMethodConfigurationService.php b/lib/Service/PaymentMethodConfigurationService.php
new file mode 100644
index 0000000000..8bdf4e8e7f
--- /dev/null
+++ b/lib/Service/PaymentMethodConfigurationService.php
@@ -0,0 +1,70 @@
+
+ */
+ public function all($params = null, $opts = null)
+ {
+ return $this->requestCollection('get', '/v1/payment_method_configurations', $params, $opts);
+ }
+
+ /**
+ * Creates a payment method configuration.
+ *
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\PaymentMethodConfiguration
+ */
+ public function create($params = null, $opts = null)
+ {
+ return $this->request('post', '/v1/payment_method_configurations', $params, $opts);
+ }
+
+ /**
+ * Retrieve payment method configuration.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\PaymentMethodConfiguration
+ */
+ public function retrieve($id, $params = null, $opts = null)
+ {
+ return $this->request('get', $this->buildPath('/v1/payment_method_configurations/%s', $id), $params, $opts);
+ }
+
+ /**
+ * Update payment method configuration.
+ *
+ * @param string $id
+ * @param null|array $params
+ * @param null|array|\Stripe\Util\RequestOptions $opts
+ *
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
+ *
+ * @return \Stripe\PaymentMethodConfiguration
+ */
+ public function update($id, $params = null, $opts = null)
+ {
+ return $this->request('post', $this->buildPath('/v1/payment_method_configurations/%s', $id), $params, $opts);
+ }
+}
diff --git a/lib/SetupIntent.php b/lib/SetupIntent.php
index 8b37aeeba7..ddcc45e146 100644
--- a/lib/SetupIntent.php
+++ b/lib/SetupIntent.php
@@ -47,6 +47,7 @@
* @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
* @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended.
* @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent.
+ * @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this Setup Intent.
* @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this SetupIntent.
* @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
* @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent.
diff --git a/lib/StripeClient.php b/lib/StripeClient.php
index 8d3eb413db..3540b6662d 100644
--- a/lib/StripeClient.php
+++ b/lib/StripeClient.php
@@ -37,6 +37,7 @@
* @property \Stripe\Service\OAuthService $oauth
* @property \Stripe\Service\PaymentIntentService $paymentIntents
* @property \Stripe\Service\PaymentLinkService $paymentLinks
+ * @property \Stripe\Service\PaymentMethodConfigurationService $paymentMethodConfigurations
* @property \Stripe\Service\PaymentMethodDomainService $paymentMethodDomains
* @property \Stripe\Service\PaymentMethodService $paymentMethods
* @property \Stripe\Service\PayoutService $payouts
diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php
index b1e4b50987..14e001a00f 100644
--- a/lib/Util/ObjectTypes.php
+++ b/lib/Util/ObjectTypes.php
@@ -65,6 +65,7 @@ class ObjectTypes
\Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class,
\Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class,
\Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class,
+ \Stripe\PaymentMethodConfiguration::OBJECT_NAME => \Stripe\PaymentMethodConfiguration::class,
\Stripe\PaymentMethodDomain::OBJECT_NAME => \Stripe\PaymentMethodDomain::class,
\Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class,
\Stripe\Person::OBJECT_NAME => \Stripe\Person::class,
diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php
index ea37f68a69..a693ad1c14 100644
--- a/tests/Stripe/GeneratedExamplesTest.php
+++ b/tests/Stripe/GeneratedExamplesTest.php
@@ -4260,4 +4260,312 @@ function () {},
);
// TODO: assert proper instance, {"shape":"file"}
}
+
+ public function testListPaymentMethodConfiguration()
+ {
+ $this->expectsRequest('get', '/v1/payment_method_configurations');
+ $result = $this->client->paymentMethodConfigurations->all([
+ 'application' => 'foo',
+ ]);
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result->data[0]);
+ }
+
+ public function testCreatePaymentMethodConfiguration()
+ {
+ $this->expectsRequest('post', '/v1/payment_method_configurations');
+ $result = $this->client->paymentMethodConfigurations->create([
+ 'acss_debit' => ['display_preference' => ['preference' => 'none']],
+ 'affirm' => ['display_preference' => ['preference' => 'none']],
+ ]);
+ static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result);
+ }
+
+ public function testRetrievePaymentMethodConfiguration()
+ {
+ $this->expectsRequest('get', '/v1/payment_method_configurations/foo');
+ $result = $this->client->paymentMethodConfigurations->retrieve(
+ 'foo',
+ []
+ );
+ static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result);
+ }
+
+ public function testUpdatePaymentMethodConfiguration()
+ {
+ $this->expectsRequest('post', '/v1/payment_method_configurations/foo');
+ $result = $this->client->paymentMethodConfigurations->update(
+ 'foo',
+ ['acss_debit' => ['display_preference' => ['preference' => 'on']]]
+ );
+ static::assertInstanceOf(\Stripe\PaymentMethodConfiguration::class, $result);
+ }
+
+ public function testCreateAuthorization()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/authorizations'
+ );
+ $result = $this->client->testHelpers->issuing->authorizations->create([
+ 'amount' => 100,
+ 'amount_details' => [
+ 'atm_fee' => 10,
+ 'cashback_amount' => 5,
+ ],
+ 'authorization_method' => 'chip',
+ 'card' => 'foo',
+ 'currency' => 'usd',
+ 'is_amount_controllable' => true,
+ 'merchant_data' => [
+ 'category' => 'ac_refrigeration_repair',
+ 'city' => 'foo',
+ 'country' => 'bar',
+ 'name' => 'foo',
+ 'network_id' => 'bar',
+ 'postal_code' => 'foo',
+ 'state' => 'bar',
+ 'terminal_id' => 'foo',
+ ],
+ 'network_data' => ['acquiring_institution_id' => 'foo'],
+ 'verification_data' => [
+ 'address_line1_check' => 'mismatch',
+ 'address_postal_code_check' => 'match',
+ 'cvc_check' => 'match',
+ 'expiry_check' => 'mismatch',
+ ],
+ 'wallet' => 'apple_pay',
+ ]);
+ static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result);
+ }
+
+ public function testCaptureAuthorization()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/authorizations/example_authorization/capture'
+ );
+ $result = $this->client->testHelpers->issuing->authorizations->capture(
+ 'example_authorization',
+ [
+ 'capture_amount' => 100,
+ 'close_authorization' => true,
+ 'purchase_details' => [
+ 'flight' => [
+ 'departure_at' => 1633651200,
+ 'passenger_name' => 'John Doe',
+ 'refundable' => true,
+ 'segments' => [
+ [
+ 'arrival_airport_code' => 'SFO',
+ 'carrier' => 'Delta',
+ 'departure_airport_code' => 'LAX',
+ 'flight_number' => 'DL100',
+ 'service_class' => 'Economy',
+ 'stopover_allowed' => true,
+ ],
+ ],
+ 'travel_agency' => 'Orbitz',
+ ],
+ 'fuel' => [
+ 'type' => 'diesel',
+ 'unit' => 'liter',
+ 'unit_cost_decimal' => '3.5',
+ 'volume_decimal' => '10',
+ ],
+ 'lodging' => [
+ 'check_in_at' => 1633651200,
+ 'nights' => 2,
+ ],
+ 'receipt' => [
+ [
+ 'description' => 'Room charge',
+ 'quantity' => '1',
+ 'total' => 200,
+ 'unit_cost' => 200,
+ ],
+ ],
+ 'reference' => 'foo',
+ ],
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result);
+ }
+
+ public function testExpireAuthorization()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/authorizations/example_authorization/expire'
+ );
+ $result = $this->client->testHelpers->issuing->authorizations->expire(
+ 'example_authorization',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result);
+ }
+
+ public function testIncrementAuthorization()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/authorizations/example_authorization/increment'
+ );
+ $result = $this->client->testHelpers->issuing->authorizations->increment(
+ 'example_authorization',
+ [
+ 'increment_amount' => 50,
+ 'is_amount_controllable' => true,
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result);
+ }
+
+ public function testReverseAuthorization()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/authorizations/example_authorization/reverse'
+ );
+ $result = $this->client->testHelpers->issuing->authorizations->reverse(
+ 'example_authorization',
+ ['reverse_amount' => 20]
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result);
+ }
+
+ public function testCreateForceCaptureTransaction()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/transactions/create_force_capture'
+ );
+ $result = $this->client->testHelpers->issuing->transactions->createForceCapture([
+ 'amount' => 100,
+ 'card' => 'foo',
+ 'currency' => 'usd',
+ 'merchant_data' => [
+ 'category' => 'ac_refrigeration_repair',
+ 'city' => 'foo',
+ 'country' => 'US',
+ 'name' => 'foo',
+ 'network_id' => 'bar',
+ 'postal_code' => '10001',
+ 'state' => 'NY',
+ 'terminal_id' => 'foo',
+ ],
+ 'purchase_details' => [
+ 'flight' => [
+ 'departure_at' => 1633651200,
+ 'passenger_name' => 'John Doe',
+ 'refundable' => true,
+ 'segments' => [
+ [
+ 'arrival_airport_code' => 'SFO',
+ 'carrier' => 'Delta',
+ 'departure_airport_code' => 'LAX',
+ 'flight_number' => 'DL100',
+ 'service_class' => 'Economy',
+ 'stopover_allowed' => true,
+ ],
+ ],
+ 'travel_agency' => 'Orbitz',
+ ],
+ 'fuel' => [
+ 'type' => 'diesel',
+ 'unit' => 'liter',
+ 'unit_cost_decimal' => '3.5',
+ 'volume_decimal' => '10',
+ ],
+ 'lodging' => [
+ 'check_in_at' => 1533651200,
+ 'nights' => 2,
+ ],
+ 'receipt' => [
+ [
+ 'description' => 'Room charge',
+ 'quantity' => '1',
+ 'total' => 200,
+ 'unit_cost' => 200,
+ ],
+ ],
+ 'reference' => 'foo',
+ ],
+ ]);
+ static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result);
+ }
+
+ public function testCreateUnlinkedRefundTransaction()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/transactions/create_unlinked_refund'
+ );
+ $result = $this->client->testHelpers->issuing->transactions->createUnlinkedRefund([
+ 'amount' => 100,
+ 'card' => 'foo',
+ 'currency' => 'usd',
+ 'merchant_data' => [
+ 'category' => 'ac_refrigeration_repair',
+ 'city' => 'foo',
+ 'country' => 'bar',
+ 'name' => 'foo',
+ 'network_id' => 'bar',
+ 'postal_code' => 'foo',
+ 'state' => 'bar',
+ 'terminal_id' => 'foo',
+ ],
+ 'purchase_details' => [
+ 'flight' => [
+ 'departure_at' => 1533651200,
+ 'passenger_name' => 'John Doe',
+ 'refundable' => true,
+ 'segments' => [
+ [
+ 'arrival_airport_code' => 'SFO',
+ 'carrier' => 'Delta',
+ 'departure_airport_code' => 'LAX',
+ 'flight_number' => 'DL100',
+ 'service_class' => 'Economy',
+ 'stopover_allowed' => true,
+ ],
+ ],
+ 'travel_agency' => 'Orbitz',
+ ],
+ 'fuel' => [
+ 'type' => 'diesel',
+ 'unit' => 'liter',
+ 'unit_cost_decimal' => '3.5',
+ 'volume_decimal' => '10',
+ ],
+ 'lodging' => [
+ 'check_in_at' => 1533651200,
+ 'nights' => 2,
+ ],
+ 'receipt' => [
+ [
+ 'description' => 'Room charge',
+ 'quantity' => '1',
+ 'total' => 200,
+ 'unit_cost' => 200,
+ ],
+ ],
+ 'reference' => 'foo',
+ ],
+ ]);
+ static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result);
+ }
+
+ public function testRefundTransaction()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/transactions/example_transaction/refund'
+ );
+ $result = $this->client->testHelpers->issuing->transactions->refund(
+ 'example_transaction',
+ ['refund_amount' => 50]
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result);
+ }
}
From 260aad072f92ddb05e03d47af13b3616d99b3444 Mon Sep 17 00:00:00 2001
From: Richard Marmorstein