From d0d33bd2666b188bcb5c96ada3c95ccb02a26db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 29 Sep 2023 17:59:24 +0200 Subject: [PATCH 01/11] Fix: Do not bother removing friendsofphp/php-cs-fixer (#1569) --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ad752f5b..76ed4832b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,11 +62,6 @@ jobs: # that, so we hash on "composer.json" instead. key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} - # We run php-cs-fixer in a separate job, but the version we use is not compatible - # with all the versions of PHP that we want to execute PHPStan upon - - name: Trim dependency - run: composer remove --dev --no-update friendsofphp/php-cs-fixer - - name: Validate composer.json run: composer validate From 17b684514d5c1dfa5af9becbfab61b46ae2175f6 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:36:20 +0000 Subject: [PATCH 02/11] Update generated code for v573 --- OPENAPI_VERSION | 2 +- lib/PaymentMethodConfiguration.php | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9678c9f35..788ab53a7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v570 \ No newline at end of file +v573 \ No newline at end of file diff --git a/lib/PaymentMethodConfiguration.php b/lib/PaymentMethodConfiguration.php index e2df26214..d70e0258e 100644 --- a/lib/PaymentMethodConfiguration.php +++ b/lib/PaymentMethodConfiguration.php @@ -5,7 +5,20 @@ namespace Stripe; /** - * An object detailing payment method configurations. + * PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. You can have multiple configurations with different sets of payment methods for different scenarios. + * + * There are two types of PaymentMethodConfigurations. Which is used depends on the charge type: + * + * Direct configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect. + * + * Child configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter. + * + * Child configurations have a parent that sets default values and controls which settings connected accounts may override. You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account’s associated child configuration. Parent configurations are managed in the dashboard and are not available in this API. + * + * Related guides: + * - Payment Method Configurations API + * - Multiple payment method configurations on dynamic payment methods + * - Multiple configurations for your Connect accounts * * @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. @@ -15,7 +28,7 @@ * @property null|\Stripe\StripeObject $afterpay_clearpay * @property null|\Stripe\StripeObject $alipay * @property null|\Stripe\StripeObject $apple_pay - * @property null|string $application The Connect application associated with this configuration. + * @property null|string $application For child configs, the Connect application associated with the configuration. * @property null|\Stripe\StripeObject $au_becs_debit * @property null|\Stripe\StripeObject $bacs_debit * @property null|\Stripe\StripeObject $bancontact @@ -31,18 +44,18 @@ * @property null|\Stripe\StripeObject $grabpay * @property null|\Stripe\StripeObject $id_bank_transfer * @property null|\Stripe\StripeObject $ideal - * @property bool $is_default The default configuration is used whenever no payment method configuration is specified. + * @property bool $is_default The default configuration is used whenever a payment method configuration is not specified. * @property null|\Stripe\StripeObject $jcb * @property null|\Stripe\StripeObject $klarna * @property null|\Stripe\StripeObject $konbini * @property null|\Stripe\StripeObject $link * @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|\Stripe\StripeObject $multibanco - * @property string $name Configuration name. + * @property string $name The configuration's 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|string $parent For child configs, the configuration's parent configuration. * @property null|\Stripe\StripeObject $pay_by_bank * @property null|\Stripe\StripeObject $paynow * @property null|\Stripe\StripeObject $paypal From 5d63384063d3c9638f1c9563b3725a5e982381c3 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:28:50 +0000 Subject: [PATCH 03/11] Update generated code for v575 --- OPENAPI_VERSION | 2 +- init.php | 2 +- .../{InferredBalance.php => AccountInferredBalance.php} | 2 +- lib/Service/FinancialConnections/AccountService.php | 2 +- lib/Util/ObjectTypes.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename lib/FinancialConnections/{InferredBalance.php => AccountInferredBalance.php} (95%) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 788ab53a7..e548d1f86 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v573 \ No newline at end of file +v575 \ No newline at end of file diff --git a/init.php b/init.php index 6e8d58725..f3a35b996 100644 --- a/init.php +++ b/init.php @@ -119,9 +119,9 @@ require __DIR__ . '/lib/File.php'; require __DIR__ . '/lib/FileLink.php'; require __DIR__ . '/lib/FinancialConnections/Account.php'; +require __DIR__ . '/lib/FinancialConnections/AccountInferredBalance.php'; require __DIR__ . '/lib/FinancialConnections/AccountOwner.php'; require __DIR__ . '/lib/FinancialConnections/AccountOwnership.php'; -require __DIR__ . '/lib/FinancialConnections/InferredBalance.php'; require __DIR__ . '/lib/FinancialConnections/Session.php'; require __DIR__ . '/lib/FinancialConnections/Transaction.php'; require __DIR__ . '/lib/FundingInstructions.php'; diff --git a/lib/FinancialConnections/InferredBalance.php b/lib/FinancialConnections/AccountInferredBalance.php similarity index 95% rename from lib/FinancialConnections/InferredBalance.php rename to lib/FinancialConnections/AccountInferredBalance.php index 4b9604344..36e3a39c9 100644 --- a/lib/FinancialConnections/InferredBalance.php +++ b/lib/FinancialConnections/AccountInferredBalance.php @@ -12,7 +12,7 @@ * @property int $as_of The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC. * @property \Stripe\StripeObject $current

The balances owed to (or by) the account holder.

Each key is a three-letter ISO currency code, in lowercase.

Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.

*/ -class InferredBalance extends \Stripe\ApiResource +class AccountInferredBalance extends \Stripe\ApiResource { const OBJECT_NAME = 'financial_connections.account_inferred_balance'; diff --git a/lib/Service/FinancialConnections/AccountService.php b/lib/Service/FinancialConnections/AccountService.php index 637758bde..9f95f967a 100644 --- a/lib/Service/FinancialConnections/AccountService.php +++ b/lib/Service/FinancialConnections/AccountService.php @@ -31,7 +31,7 @@ public function all($params = null, $opts = null) * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection<\Stripe\FinancialConnections\InferredBalance> + * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountInferredBalance> */ public function allInferredBalances($parentId, $params = null, $opts = null) { diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index d33f2af28..a7106d108 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -51,9 +51,9 @@ class ObjectTypes \Stripe\File::OBJECT_NAME => \Stripe\File::class, \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, + \Stripe\FinancialConnections\AccountInferredBalance::OBJECT_NAME => \Stripe\FinancialConnections\AccountInferredBalance::class, \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, - \Stripe\FinancialConnections\InferredBalance::OBJECT_NAME => \Stripe\FinancialConnections\InferredBalance::class, \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, \Stripe\FinancialConnections\Transaction::OBJECT_NAME => \Stripe\FinancialConnections\Transaction::class, \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, From d5a2cf26228c773c41b6b333e1cf28b21e7285c1 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 20:41:39 +0000 Subject: [PATCH 04/11] Update generated code for v576 --- OPENAPI_VERSION | 2 +- init.php | 4 +- lib/InvoiceLineItem.php | 1 + lib/Issuing/Authorization.php | 1 + lib/Issuing/Token.php | 42 +++++++++++++ lib/Issuing/Transaction.php | 1 + lib/Quote.php | 60 +++++++------------ lib/QuotePreviewInvoice.php | 19 ++++++ ...p => QuotePreviewSubscriptionSchedule.php} | 4 +- lib/Service/Issuing/IssuingServiceFactory.php | 2 + lib/Service/Issuing/TokenService.php | 56 +++++++++++++++++ lib/Service/QuoteService.php | 18 +++--- lib/Util/ObjectTypes.php | 3 +- tests/Stripe/GeneratedExamplesTest.php | 4 +- 14 files changed, 161 insertions(+), 56 deletions(-) create mode 100644 lib/Issuing/Token.php rename lib/{QuotePreviewSchedule.php => QuotePreviewSubscriptionSchedule.php} (97%) create mode 100644 lib/Service/Issuing/TokenService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e548d1f86..23f3997c9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v575 \ No newline at end of file +v576 \ No newline at end of file diff --git a/init.php b/init.php index f3a35b996..75fe5a7e8 100644 --- a/init.php +++ b/init.php @@ -138,6 +138,7 @@ require __DIR__ . '/lib/Issuing/Dispute.php'; require __DIR__ . '/lib/Issuing/PersonalizationDesign.php'; require __DIR__ . '/lib/Issuing/PhysicalBundle.php'; +require __DIR__ . '/lib/Issuing/Token.php'; require __DIR__ . '/lib/Issuing/Transaction.php'; require __DIR__ . '/lib/LineItem.php'; require __DIR__ . '/lib/LoginLink.php'; @@ -158,7 +159,7 @@ require __DIR__ . '/lib/QuoteLine.php'; require __DIR__ . '/lib/QuotePhase.php'; require __DIR__ . '/lib/QuotePreviewInvoice.php'; -require __DIR__ . '/lib/QuotePreviewSchedule.php'; +require __DIR__ . '/lib/QuotePreviewSubscriptionSchedule.php'; require __DIR__ . '/lib/Radar/EarlyFraudWarning.php'; require __DIR__ . '/lib/Radar/ValueList.php'; require __DIR__ . '/lib/Radar/ValueListItem.php'; @@ -217,6 +218,7 @@ require __DIR__ . '/lib/Service/Issuing/IssuingServiceFactory.php'; require __DIR__ . '/lib/Service/Issuing/PersonalizationDesignService.php'; require __DIR__ . '/lib/Service/Issuing/PhysicalBundleService.php'; +require __DIR__ . '/lib/Service/Issuing/TokenService.php'; require __DIR__ . '/lib/Service/Issuing/TransactionService.php'; require __DIR__ . '/lib/Service/MandateService.php'; require __DIR__ . '/lib/Service/OrderService.php'; diff --git a/lib/InvoiceLineItem.php b/lib/InvoiceLineItem.php index 3cc8a7de7..67b9bb696 100644 --- a/lib/InvoiceLineItem.php +++ b/lib/InvoiceLineItem.php @@ -16,6 +16,7 @@ * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. * @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the invoice item associated with this line item if any. * @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|(string|\Stripe\StripeObject)[] $margins The margins applied to the line item. When set, the default_margins on the invoice do not apply to the line item. Use expand[]=margins to expand each margin. * @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. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. * @property \Stripe\StripeObject $period * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. diff --git a/lib/Issuing/Authorization.php b/lib/Issuing/Authorization.php index 2e2bda7e1..4beadbdf3 100644 --- a/lib/Issuing/Authorization.php +++ b/lib/Issuing/Authorization.php @@ -31,6 +31,7 @@ * @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 a pending_request authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. * @property string $status The current status of the authorization in its lifecycle. + * @property null|string|\Stripe\Issuing\Token $token Token object used for this authorization. If a network token was not used for this authorization, this field will be null. * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. * @property null|\Stripe\StripeObject $treasury Treasury details related to this authorization if it was created on a FinancialAccount. * @property \Stripe\StripeObject $verification_data diff --git a/lib/Issuing/Token.php b/lib/Issuing/Token.php new file mode 100644 index 000000000..e30137c08 --- /dev/null +++ b/lib/Issuing/Token.php @@ -0,0 +1,42 @@ +card issuer, you can view and manage these tokens through Stripe. + * + * @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 string|\Stripe\Issuing\Card $card Card associated with this token. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $device_fingerprint The hashed ID derived from the device ID from the card network associated with the token + * @property null|string $last4 The last four digits of the token. + * @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 string $network The token service provider / card network associated with the token. + * @property null|\Stripe\StripeObject $network_data + * @property int $network_updated_at Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch. + * @property string $status The usage state of the token. + * @property null|string $wallet_provider The digital wallet for this token, if one was used. + */ +class Token extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.token'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const NETWORK_MASTERCARD = 'mastercard'; + const NETWORK_VISA = 'visa'; + + const STATUS_ACTIVE = 'active'; + const STATUS_DELETED = 'deleted'; + const STATUS_REQUESTED = 'requested'; + const STATUS_SUSPENDED = 'suspended'; + + const WALLET_PROVIDER_APPLE_PAY = 'apple_pay'; + const WALLET_PROVIDER_GOOGLE_PAY = 'google_pay'; + const WALLET_PROVIDER_SAMSUNG_PAY = 'samsung_pay'; +} diff --git a/lib/Issuing/Transaction.php b/lib/Issuing/Transaction.php index 912e253d0..50825c480 100644 --- a/lib/Issuing/Transaction.php +++ b/lib/Issuing/Transaction.php @@ -29,6 +29,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 null|\Stripe\StripeObject $network_data Details about the transaction, such as processing dates, set by the card network. * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. + * @property null|string|\Stripe\Issuing\Token $token Token object used for this transaction. If a network token was not used for this transaction, this field will be null. * @property null|\Stripe\StripeObject $treasury Treasury details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts * @property string $type The nature of the transaction. * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. diff --git a/lib/Quote.php b/lib/Quote.php index 323cafe52..8d2a48aba 100644 --- a/lib/Quote.php +++ b/lib/Quote.php @@ -102,23 +102,6 @@ public function cancel($params = null, $opts = null) return $this; } - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote the drafted quote - */ - public function draftQuote($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/mark_draft'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - /** * @param null|array $params * @param null|array|string $opts @@ -201,9 +184,9 @@ public static function allLines($id, $params = null, $opts = null) * * @return \Stripe\Quote the marked quote */ - public function markStaleQuote($params = null, $opts = null) + public function markDraft($params = null, $opts = null) { - $url = $this->instanceUrl() . '/mark_stale'; + $url = $this->instanceUrl() . '/mark_draft'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); @@ -211,42 +194,39 @@ public function markStaleQuote($params = null, $opts = null) } /** - * @param callable $readBodyChunkCallable * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return void + * @return \Stripe\Quote the marked quote */ - public function pdf($readBodyChunkCallable, $params = null, $opts = null) + public function markStale($params = null, $opts = null) { - $opts = \Stripe\Util\RequestOptions::parse($opts); - if (!isset($opts->apiBase)) { - $opts->apiBase = \Stripe\Stripe::$apiUploadBase; - } - $url = $this->instanceUrl() . '/pdf'; - $this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts); + $url = $this->instanceUrl() . '/mark_stale'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; } /** - * @param string $id - * @param string $preview_invoice + * @param callable $readBodyChunkCallable * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection<\Stripe\InvoiceLineItem> list of invoice line items + * @return void */ - public static function previewInvoiceLines($id, $preview_invoice, $params = null, $opts = null) + public function pdf($readBodyChunkCallable, $params = null, $opts = null) { - $url = static::resourceUrl($id) . '/preview_invoices/' . $preview_invoice . '/lines'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (!isset($opts->apiBase)) { + $opts->apiBase = \Stripe\Stripe::$apiUploadBase; + } + $url = $this->instanceUrl() . '/pdf'; + $this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts); } /** @@ -284,13 +264,13 @@ public static function allPreviewInvoices($id, $params = null, $opts = null) const PATH_PREVIEW_SUBSCRIPTION_SCHEDULES = '/preview_subscription_schedules'; /** - * @param string $id the ID of the quote on which to retrieve the quote preview schedules + * @param string $id the ID of the quote on which to retrieve the quote preview subscription schedules * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection<\Stripe\QuotePreviewSchedule> the list of quote preview schedules + * @return \Stripe\Collection<\Stripe\QuotePreviewSubscriptionSchedule> the list of quote preview subscription schedules */ public static function allPreviewSubscriptionSchedules($id, $params = null, $opts = null) { diff --git a/lib/QuotePreviewInvoice.php b/lib/QuotePreviewInvoice.php index dc9755224..8300213e8 100644 --- a/lib/QuotePreviewInvoice.php +++ b/lib/QuotePreviewInvoice.php @@ -146,4 +146,23 @@ class QuotePreviewInvoice extends ApiResource const STATUS_PAID = 'paid'; const STATUS_UNCOLLECTIBLE = 'uncollectible'; const STATUS_VOID = 'void'; + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\InvoiceLineItem> list of invoice line items + */ + public static function allLines($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/lines'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } } diff --git a/lib/QuotePreviewSchedule.php b/lib/QuotePreviewSubscriptionSchedule.php similarity index 97% rename from lib/QuotePreviewSchedule.php rename to lib/QuotePreviewSubscriptionSchedule.php index f2cf98739..5eaf76ade 100644 --- a/lib/QuotePreviewSchedule.php +++ b/lib/QuotePreviewSubscriptionSchedule.php @@ -27,9 +27,9 @@ * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription schedule belongs to. */ -class QuotePreviewSchedule extends ApiResource +class QuotePreviewSubscriptionSchedule extends ApiResource { - const OBJECT_NAME = 'quote_preview_schedule'; + const OBJECT_NAME = 'quote_preview_subscription_schedule'; use ApiOperations\All; diff --git a/lib/Service/Issuing/IssuingServiceFactory.php b/lib/Service/Issuing/IssuingServiceFactory.php index 2580f19a5..852351d2b 100644 --- a/lib/Service/Issuing/IssuingServiceFactory.php +++ b/lib/Service/Issuing/IssuingServiceFactory.php @@ -13,6 +13,7 @@ * @property DisputeService $disputes * @property PersonalizationDesignService $personalizationDesigns * @property PhysicalBundleService $physicalBundles + * @property TokenService $tokens * @property TransactionService $transactions */ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory @@ -27,6 +28,7 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory 'disputes' => DisputeService::class, 'personalizationDesigns' => PersonalizationDesignService::class, 'physicalBundles' => PhysicalBundleService::class, + 'tokens' => TokenService::class, 'transactions' => TransactionService::class, ]; diff --git a/lib/Service/Issuing/TokenService.php b/lib/Service/Issuing/TokenService.php new file mode 100644 index 000000000..da60d4f06 --- /dev/null +++ b/lib/Service/Issuing/TokenService.php @@ -0,0 +1,56 @@ +Token objects for a given card. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\Token> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/tokens', $params, $opts); + } + + /** + * Retrieves an Issuing Token object. + * + * @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\Token + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/tokens/%s', $id), $params, $opts); + } + + /** + * Attempts to update the specified Issuing Token object to the status + * specified. + * + * @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\Token + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/tokens/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/QuoteService.php b/lib/Service/QuoteService.php index 81fb83e10..d4e687c28 100644 --- a/lib/Service/QuoteService.php +++ b/lib/Service/QuoteService.php @@ -104,7 +104,7 @@ public function allLines($id, $params = null, $opts = null) * * @return \Stripe\Collection<\Stripe\InvoiceLineItem> */ - public function allPreviewInvoiceLines($parentId, $id, $params = null, $opts = null) + public function allLinesPreviewInvoice($parentId, $id, $params = null, $opts = null) { return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices/%s/lines', $parentId, $id), $params, $opts); } @@ -134,7 +134,7 @@ public function allPreviewInvoices($parentId, $params = null, $opts = null) * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection<\Stripe\QuotePreviewSchedule> + * @return \Stripe\Collection<\Stripe\QuotePreviewSubscriptionSchedule> */ public function allPreviewSubscriptionSchedules($parentId, $params = null, $opts = null) { @@ -176,7 +176,7 @@ public function create($params = null, $opts = null) } /** - * Converts a stale quote to draft. + * Finalizes the quote. * * @param string $id * @param null|array $params @@ -186,13 +186,13 @@ public function create($params = null, $opts = null) * * @return \Stripe\Quote */ - public function draftQuote($id, $params = null, $opts = null) + public function finalizeQuote($id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_draft', $id), $params, $opts); + return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts); } /** - * Finalizes the quote. + * Converts a stale quote to draft. * * @param string $id * @param null|array $params @@ -202,9 +202,9 @@ public function draftQuote($id, $params = null, $opts = null) * * @return \Stripe\Quote */ - public function finalizeQuote($id, $params = null, $opts = null) + public function markDraft($id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts); + return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_draft', $id), $params, $opts); } /** @@ -218,7 +218,7 @@ public function finalizeQuote($id, $params = null, $opts = null) * * @return \Stripe\Quote */ - public function markStaleQuote($id, $params = null, $opts = null) + public function markStale($id, $params = null, $opts = null) { return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_stale', $id), $params, $opts); } diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index a7106d108..ec4e96048 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -70,6 +70,7 @@ class ObjectTypes \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, \Stripe\Issuing\PersonalizationDesign::OBJECT_NAME => \Stripe\Issuing\PersonalizationDesign::class, \Stripe\Issuing\PhysicalBundle::OBJECT_NAME => \Stripe\Issuing\PhysicalBundle::class, + \Stripe\Issuing\Token::OBJECT_NAME => \Stripe\Issuing\Token::class, \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, @@ -90,7 +91,7 @@ class ObjectTypes \Stripe\QuoteLine::OBJECT_NAME => \Stripe\QuoteLine::class, \Stripe\QuotePhase::OBJECT_NAME => \Stripe\QuotePhase::class, \Stripe\QuotePreviewInvoice::OBJECT_NAME => \Stripe\QuotePreviewInvoice::class, - \Stripe\QuotePreviewSchedule::OBJECT_NAME => \Stripe\QuotePreviewSchedule::class, + \Stripe\QuotePreviewSubscriptionSchedule::OBJECT_NAME => \Stripe\QuotePreviewSubscriptionSchedule::class, \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class, \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php index bd92ae844..755ad9719 100644 --- a/tests/Stripe/GeneratedExamplesTest.php +++ b/tests/Stripe/GeneratedExamplesTest.php @@ -4192,13 +4192,13 @@ public function testListLineItemsCalculation() static::assertInstanceOf(\Stripe\Tax\CalculationLineItem::class, $result->data[0]); } - public function testListPreviewInvoiceLinesQuote() + public function testListLinesQuotePreviewInvoice() { $this->expectsRequest( 'get', '/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines' ); - $result = $this->client->quotes->allPreviewInvoiceLines( + $result = $this->client->quotes->allLinesPreviewInvoice( 'qt_xyz', 'in_xyz', [] From 8f1a1af045bbc308a0ba47cfcd1f8e98579fdc70 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:13:25 +0000 Subject: [PATCH 05/11] Update generated code for v578 --- OPENAPI_VERSION | 2 +- lib/Quote.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 23f3997c9..29acb3cd5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v576 \ No newline at end of file +v578 \ No newline at end of file diff --git a/lib/Quote.php b/lib/Quote.php index 8d2a48aba..ae519eae9 100644 --- a/lib/Quote.php +++ b/lib/Quote.php @@ -10,6 +10,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 null|bool $allow_backdated_lines Allow quote lines to have starts_at in the past if collection is paused between starts_at and now. * @property int $amount_subtotal Total before any discounts or taxes are applied. * @property int $amount_total Total after discounts and taxes are applied. * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the quote. From 885eeea4604661dbb08c7f3808bfdde09ce56ca9 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:20:37 +0000 Subject: [PATCH 06/11] Update generated code for v579 --- OPENAPI_VERSION | 2 +- lib/BalanceTransaction.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 29acb3cd5..9327696e9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v578 \ No newline at end of file +v579 \ No newline at end of file diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index da8158f5a..97ee2a593 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -12,15 +12,15 @@ * * @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 Gross amount of the transaction (in cents (or local equivalent)). + * @property int $amount Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party. * @property int $available_on The date that the transaction's net funds become available in the Stripe balance. * @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 $description An arbitrary string attached to the object. Often useful for displaying to users. * @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 int $fee Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed. * @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 int $net Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by amount - fee * @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. From 43c5df882f807a43b7cec02bd7da8e72083d7787 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:39:55 +0000 Subject: [PATCH 07/11] Update generated code for v580 --- OPENAPI_VERSION | 2 +- lib/Service/SetupIntentService.php | 4 ++-- lib/SetupIntent.php | 25 ++++++++++++------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9327696e9..f8eb31b2e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v579 \ No newline at end of file +v580 \ No newline at end of file diff --git a/lib/Service/SetupIntentService.php b/lib/Service/SetupIntentService.php index e41f4a0ae..e7f84d7ca 100644 --- a/lib/Service/SetupIntentService.php +++ b/lib/Service/SetupIntentService.php @@ -71,8 +71,8 @@ public function confirm($id, $params = null, $opts = null) /** * Creates a SetupIntent object. * - * After the SetupIntent is created, attach a payment method and confirm to collect any required + * After you create the SetupIntent, attach a payment method and confirm it to collect any required * permissions to charge the payment method later. * * @param null|array $params diff --git a/lib/SetupIntent.php b/lib/SetupIntent.php index ddcc45e14..5bcfa9827 100644 --- a/lib/SetupIntent.php +++ b/lib/SetupIntent.php @@ -6,25 +6,24 @@ /** * 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. + * For example, you can 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 longer be valid. - * The SetupIntent then transitions through multiple statuses as it guides + * Create a SetupIntent when you're ready to collect your customer's payment credentials. + * Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + * The SetupIntent transitions through multiple statuses as it guides * you through the setup process. * * Successful SetupIntents result in payment credentials that are optimized for future payments. - * For example, cardholders in certain regions may need to be run through - * Strong Customer 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. + * For example, cardholders in certain regions might need to be run through + * Strong Customer Authentication during payment method collection + * to streamline later off-session payments. + * If you use the SetupIntent with a Customer, + * it automatically attaches the resulting payment method to that Customer after successful setup. * We recommend using SetupIntents or setup_future_usage on - * PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. + * PaymentIntents to save payment methods 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. + * By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. * * Related guide: Setup Intents API * @@ -48,7 +47,7 @@ * @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 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. * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. From 0547e9cbadfb269626834555544dc6f55d2f602e Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:37:52 +0000 Subject: [PATCH 08/11] Update generated code for v580 --- lib/FinancialConnections/Account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FinancialConnections/Account.php b/lib/FinancialConnections/Account.php index 7704eb5b0..a987a1ad0 100644 --- a/lib/FinancialConnections/Account.php +++ b/lib/FinancialConnections/Account.php @@ -148,7 +148,7 @@ public function unsubscribe($params = null, $opts = null) * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection<\Stripe\FinancialConnections\InferredBalance> the list of financial connections account inferred balances + * @return \Stripe\Collection<\Stripe\FinancialConnections\FinancialConnectionsAccountInferredBalance> the list of financial connections account inferred balances */ public static function allInferredBalances($id, $params = null, $opts = null) { From 2f6df003892a1b80b9a802d1c8062a823ef8bc71 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 20:54:56 +0000 Subject: [PATCH 09/11] Update generated code for v580 --- lib/FinancialConnections/Account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FinancialConnections/Account.php b/lib/FinancialConnections/Account.php index a987a1ad0..7c5575e8c 100644 --- a/lib/FinancialConnections/Account.php +++ b/lib/FinancialConnections/Account.php @@ -148,7 +148,7 @@ public function unsubscribe($params = null, $opts = null) * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection<\Stripe\FinancialConnections\FinancialConnectionsAccountInferredBalance> the list of financial connections account inferred balances + * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountInferredBalance> the list of financial connections account inferred balances */ public static function allInferredBalances($id, $params = null, $opts = null) { From 16985e0d030c297e38802f1f91744908777a47c4 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:09:11 +0000 Subject: [PATCH 10/11] Update generated code for v581 --- OPENAPI_VERSION | 2 +- lib/InvoiceLineItem.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f8eb31b2e..e8f6775c5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v580 \ No newline at end of file +v581 \ No newline at end of file diff --git a/lib/InvoiceLineItem.php b/lib/InvoiceLineItem.php index 67b9bb696..3cc8a7de7 100644 --- a/lib/InvoiceLineItem.php +++ b/lib/InvoiceLineItem.php @@ -16,7 +16,6 @@ * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. * @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the invoice item associated with this line item if any. * @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|(string|\Stripe\StripeObject)[] $margins The margins applied to the line item. When set, the default_margins on the invoice do not apply to the line item. Use expand[]=margins to expand each margin. * @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. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. * @property \Stripe\StripeObject $period * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. From f1ee206056f7eab4637b78ff05f49c720d11c666 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:37:03 -0700 Subject: [PATCH 11/11] Update generated code (#1586) * Update generated code for v570 * Update generated code for v573 * Update generated code for v576 * Update generated code for v579 * Update generated code for v580 * Update generated code for v581 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- init.php | 2 + lib/BalanceTransaction.php | 6 +- lib/Issuing/Authorization.php | 1 + lib/Issuing/Token.php | 42 ++++++++++++++ lib/Issuing/Transaction.php | 1 + lib/PaymentMethodConfiguration.php | 23 ++++++-- lib/Service/Issuing/IssuingServiceFactory.php | 2 + lib/Service/Issuing/TokenService.php | 56 +++++++++++++++++++ lib/Service/SetupIntentService.php | 4 +- lib/Service/TokenService.php | 6 +- lib/SetupIntent.php | 25 ++++----- lib/Token.php | 26 ++++----- lib/Util/ObjectTypes.php | 1 + 14 files changed, 157 insertions(+), 40 deletions(-) create mode 100644 lib/Issuing/Token.php create mode 100644 lib/Service/Issuing/TokenService.php diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d2d999515..e8f6775c5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v563 \ No newline at end of file +v581 \ No newline at end of file diff --git a/init.php b/init.php index 54b48b48a..79dbdeb35 100644 --- a/init.php +++ b/init.php @@ -126,6 +126,7 @@ require __DIR__ . '/lib/Issuing/Card.php'; require __DIR__ . '/lib/Issuing/Cardholder.php'; require __DIR__ . '/lib/Issuing/Dispute.php'; +require __DIR__ . '/lib/Issuing/Token.php'; require __DIR__ . '/lib/Issuing/Transaction.php'; require __DIR__ . '/lib/LineItem.php'; require __DIR__ . '/lib/LoginLink.php'; @@ -188,6 +189,7 @@ require __DIR__ . '/lib/Service/Issuing/CardholderService.php'; require __DIR__ . '/lib/Service/Issuing/DisputeService.php'; require __DIR__ . '/lib/Service/Issuing/IssuingServiceFactory.php'; +require __DIR__ . '/lib/Service/Issuing/TokenService.php'; require __DIR__ . '/lib/Service/Issuing/TransactionService.php'; require __DIR__ . '/lib/Service/MandateService.php'; require __DIR__ . '/lib/Service/PaymentIntentService.php'; diff --git a/lib/BalanceTransaction.php b/lib/BalanceTransaction.php index da8158f5a..97ee2a593 100644 --- a/lib/BalanceTransaction.php +++ b/lib/BalanceTransaction.php @@ -12,15 +12,15 @@ * * @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 Gross amount of the transaction (in cents (or local equivalent)). + * @property int $amount Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party. * @property int $available_on The date that the transaction's net funds become available in the Stripe balance. * @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 $description An arbitrary string attached to the object. Often useful for displaying to users. * @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 int $fee Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed. * @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 int $net Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by amount - fee * @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. diff --git a/lib/Issuing/Authorization.php b/lib/Issuing/Authorization.php index 2e2bda7e1..4beadbdf3 100644 --- a/lib/Issuing/Authorization.php +++ b/lib/Issuing/Authorization.php @@ -31,6 +31,7 @@ * @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 a pending_request authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. * @property string $status The current status of the authorization in its lifecycle. + * @property null|string|\Stripe\Issuing\Token $token Token object used for this authorization. If a network token was not used for this authorization, this field will be null. * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. * @property null|\Stripe\StripeObject $treasury Treasury details related to this authorization if it was created on a FinancialAccount. * @property \Stripe\StripeObject $verification_data diff --git a/lib/Issuing/Token.php b/lib/Issuing/Token.php new file mode 100644 index 000000000..e30137c08 --- /dev/null +++ b/lib/Issuing/Token.php @@ -0,0 +1,42 @@ +card issuer, you can view and manage these tokens through Stripe. + * + * @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 string|\Stripe\Issuing\Card $card Card associated with this token. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $device_fingerprint The hashed ID derived from the device ID from the card network associated with the token + * @property null|string $last4 The last four digits of the token. + * @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 string $network The token service provider / card network associated with the token. + * @property null|\Stripe\StripeObject $network_data + * @property int $network_updated_at Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch. + * @property string $status The usage state of the token. + * @property null|string $wallet_provider The digital wallet for this token, if one was used. + */ +class Token extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.token'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const NETWORK_MASTERCARD = 'mastercard'; + const NETWORK_VISA = 'visa'; + + const STATUS_ACTIVE = 'active'; + const STATUS_DELETED = 'deleted'; + const STATUS_REQUESTED = 'requested'; + const STATUS_SUSPENDED = 'suspended'; + + const WALLET_PROVIDER_APPLE_PAY = 'apple_pay'; + const WALLET_PROVIDER_GOOGLE_PAY = 'google_pay'; + const WALLET_PROVIDER_SAMSUNG_PAY = 'samsung_pay'; +} diff --git a/lib/Issuing/Transaction.php b/lib/Issuing/Transaction.php index f48bf79b8..b9cbf11e4 100644 --- a/lib/Issuing/Transaction.php +++ b/lib/Issuing/Transaction.php @@ -28,6 +28,7 @@ * @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 null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. + * @property null|string|\Stripe\Issuing\Token $token Token object used for this transaction. If a network token was not used for this transaction, this field will be null. * @property null|\Stripe\StripeObject $treasury Treasury details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts * @property string $type The nature of the transaction. * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. diff --git a/lib/PaymentMethodConfiguration.php b/lib/PaymentMethodConfiguration.php index e2df26214..d70e0258e 100644 --- a/lib/PaymentMethodConfiguration.php +++ b/lib/PaymentMethodConfiguration.php @@ -5,7 +5,20 @@ namespace Stripe; /** - * An object detailing payment method configurations. + * PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. You can have multiple configurations with different sets of payment methods for different scenarios. + * + * There are two types of PaymentMethodConfigurations. Which is used depends on the charge type: + * + * Direct configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect. + * + * Child configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter. + * + * Child configurations have a parent that sets default values and controls which settings connected accounts may override. You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account’s associated child configuration. Parent configurations are managed in the dashboard and are not available in this API. + * + * Related guides: + * - Payment Method Configurations API + * - Multiple payment method configurations on dynamic payment methods + * - Multiple configurations for your Connect accounts * * @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. @@ -15,7 +28,7 @@ * @property null|\Stripe\StripeObject $afterpay_clearpay * @property null|\Stripe\StripeObject $alipay * @property null|\Stripe\StripeObject $apple_pay - * @property null|string $application The Connect application associated with this configuration. + * @property null|string $application For child configs, the Connect application associated with the configuration. * @property null|\Stripe\StripeObject $au_becs_debit * @property null|\Stripe\StripeObject $bacs_debit * @property null|\Stripe\StripeObject $bancontact @@ -31,18 +44,18 @@ * @property null|\Stripe\StripeObject $grabpay * @property null|\Stripe\StripeObject $id_bank_transfer * @property null|\Stripe\StripeObject $ideal - * @property bool $is_default The default configuration is used whenever no payment method configuration is specified. + * @property bool $is_default The default configuration is used whenever a payment method configuration is not specified. * @property null|\Stripe\StripeObject $jcb * @property null|\Stripe\StripeObject $klarna * @property null|\Stripe\StripeObject $konbini * @property null|\Stripe\StripeObject $link * @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|\Stripe\StripeObject $multibanco - * @property string $name Configuration name. + * @property string $name The configuration's 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|string $parent For child configs, the configuration's parent configuration. * @property null|\Stripe\StripeObject $pay_by_bank * @property null|\Stripe\StripeObject $paynow * @property null|\Stripe\StripeObject $paypal diff --git a/lib/Service/Issuing/IssuingServiceFactory.php b/lib/Service/Issuing/IssuingServiceFactory.php index a8d5d0f81..b87566c07 100644 --- a/lib/Service/Issuing/IssuingServiceFactory.php +++ b/lib/Service/Issuing/IssuingServiceFactory.php @@ -11,6 +11,7 @@ * @property CardholderService $cardholders * @property CardService $cards * @property DisputeService $disputes + * @property TokenService $tokens * @property TransactionService $transactions */ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory @@ -23,6 +24,7 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory 'cardholders' => CardholderService::class, 'cards' => CardService::class, 'disputes' => DisputeService::class, + 'tokens' => TokenService::class, 'transactions' => TransactionService::class, ]; diff --git a/lib/Service/Issuing/TokenService.php b/lib/Service/Issuing/TokenService.php new file mode 100644 index 000000000..da60d4f06 --- /dev/null +++ b/lib/Service/Issuing/TokenService.php @@ -0,0 +1,56 @@ +Token objects for a given card. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\Token> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/tokens', $params, $opts); + } + + /** + * Retrieves an Issuing Token object. + * + * @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\Token + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/tokens/%s', $id), $params, $opts); + } + + /** + * Attempts to update the specified Issuing Token object to the status + * specified. + * + * @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\Token + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/tokens/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/SetupIntentService.php b/lib/Service/SetupIntentService.php index e41f4a0ae..e7f84d7ca 100644 --- a/lib/Service/SetupIntentService.php +++ b/lib/Service/SetupIntentService.php @@ -71,8 +71,8 @@ public function confirm($id, $params = null, $opts = null) /** * Creates a SetupIntent object. * - * After the SetupIntent is created, attach a payment method and confirm to collect any required + * After you create the SetupIntent, attach a payment method and confirm it to collect any required * permissions to charge the payment method later. * * @param null|array $params diff --git a/lib/Service/TokenService.php b/lib/Service/TokenService.php index 1c72759f6..63d2b2bbb 100644 --- a/lib/Service/TokenService.php +++ b/lib/Service/TokenService.php @@ -7,9 +7,9 @@ class TokenService extends \Stripe\Service\AbstractService { /** - * Creates a single-use token that represents a bank account’s details. This token - * can be used with any API method in place of a bank account dictionary. This - * token can be used only once, by attaching it to a Custom + * Creates a single-use token that represents a bank account’s details. You can use + * this token with any API method in place of a bank account dictionary. You can + * only use this token once. To do so, attach it to a Custom * account. * * @param null|array $params diff --git a/lib/SetupIntent.php b/lib/SetupIntent.php index ddcc45e14..5bcfa9827 100644 --- a/lib/SetupIntent.php +++ b/lib/SetupIntent.php @@ -6,25 +6,24 @@ /** * 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. + * For example, you can 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 longer be valid. - * The SetupIntent then transitions through multiple statuses as it guides + * Create a SetupIntent when you're ready to collect your customer's payment credentials. + * Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + * The SetupIntent transitions through multiple statuses as it guides * you through the setup process. * * Successful SetupIntents result in payment credentials that are optimized for future payments. - * For example, cardholders in certain regions may need to be run through - * Strong Customer 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. + * For example, cardholders in certain regions might need to be run through + * Strong Customer Authentication during payment method collection + * to streamline later off-session payments. + * If you use the SetupIntent with a Customer, + * it automatically attaches the resulting payment method to that Customer after successful setup. * We recommend using SetupIntents or setup_future_usage on - * PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. + * PaymentIntents to save payment methods 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. + * By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. * * Related guide: Setup Intents API * @@ -48,7 +47,7 @@ * @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 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. * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. diff --git a/lib/Token.php b/lib/Token.php index 2a2621d64..578f343d9 100644 --- a/lib/Token.php +++ b/lib/Token.php @@ -8,21 +8,21 @@ * Tokenization is the process Stripe uses to collect sensitive card or bank * account details, or personally identifiable information (PII), directly from * your customers in a secure manner. A token representing this information is - * returned to your server to use. You should use our + * returned to your server to use. Use our * recommended payments integrations to perform this process - * client-side. This ensures that no sensitive card data touches your server, + * on the client-side. This guarantees that no sensitive card data touches your server, * and allows your integration to operate in a PCI-compliant way. * - * If you cannot use client-side tokenization, you can also create tokens using - * the API with either your publishable or secret API key. Keep in mind that if - * your integration uses this method, you are responsible for any PCI compliance - * that may be required, and you must keep your secret API key safe. Unlike with - * client-side tokenization, your customer's information is not sent directly to - * Stripe, so we cannot determine how it is handled or stored. + * If you can't use client-side tokenization, you can also create tokens using + * the API with either your publishable or secret API key. If + * your integration uses this method, you're responsible for any PCI compliance + * that it might require, and you must keep your secret API key safe. Unlike with + * client-side tokenization, your customer's information isn't sent directly to + * Stripe, so we can't determine how it's handled or stored. * - * Tokens cannot be stored or used more than once. To store card or bank account - * information for later use, you can create Customer - * objects or Custom accounts. Note that + * You can't store or use tokens more than once. To store card or bank account + * information for later use, create Customer + * objects or Custom accounts. * Radar, our integrated solution for automatic fraud protection, * performs best with integrations that use client-side tokenization. * @@ -30,11 +30,11 @@ * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|\Stripe\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

On the other hand External Accounts are transfer destinations on Account objects for Custom accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

Related guide: Bank debits and transfers

* @property null|\Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card payments with Sources

- * @property null|string $client_ip IP address of the client that generated the token. + * @property null|string $client_ip IP address of the client that generates the token. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @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 string $type Type of the token: account, bank_account, card, or pii. - * @property bool $used Whether this token has already been used (tokens can be used only once). + * @property bool $used Determines if you have already used this token (you can only use tokens once). */ class Token extends ApiResource { diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index 215e28afc..ca5f58024 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -59,6 +59,7 @@ class ObjectTypes \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\Token::OBJECT_NAME => \Stripe\Issuing\Token::class, \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class,