From db2c0409e45e0cb4c9575f00b71e94f4c268c388 Mon Sep 17 00:00:00 2001 From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> Date: Thu, 2 Mar 2023 12:59:50 -0800 Subject: [PATCH 1/5] Codegen for openapi v237 (#1447) --- OPENAPI_VERSION | 2 +- lib/Payout.php | 5 +++++ lib/TaxRate.php | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3c2b47ae7..eb6678972 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v232 \ No newline at end of file +v237 \ No newline at end of file diff --git a/lib/Payout.php b/lib/Payout.php index f3d20f796..c135d9315 100644 --- a/lib/Payout.php +++ b/lib/Payout.php @@ -31,6 +31,7 @@ * @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 string $method The method used to send this payout, which can be standard or instant. instant is only supported for payouts to debit cards. (See Instant payouts for marketplaces for more information.) * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout. + * @property string $reconciliation_status If completed, the Balance Transactions API may be used to list all Balance Transactions that were paid out in this payout. * @property null|string|\Stripe\Payout $reversed_by If the payout was reversed, this is the ID of the payout that reverses this payout. * @property string $source_type The source balance this payout came from. One of card, fpx, or bank_account. * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement. @@ -65,6 +66,10 @@ class Payout extends ApiResource const METHOD_INSTANT = 'instant'; const METHOD_STANDARD = 'standard'; + const RECONCILIATION_STATUS_COMPLETED = 'completed'; + const RECONCILIATION_STATUS_IN_PROGRESS = 'in_progress'; + const RECONCILIATION_STATUS_NOT_APPLICABLE = 'not_applicable'; + const STATUS_CANCELED = 'canceled'; const STATUS_FAILED = 'failed'; const STATUS_IN_TRANSIT = 'in_transit'; diff --git a/lib/TaxRate.php b/lib/TaxRate.php index fa7cc84d8..d083dac31 100644 --- a/lib/TaxRate.php +++ b/lib/TaxRate.php @@ -43,6 +43,7 @@ class TaxRate extends ApiResource const TAX_TYPE_HST = 'hst'; const TAX_TYPE_IGST = 'igst'; const TAX_TYPE_JCT = 'jct'; + const TAX_TYPE_LEASE_TAX = 'lease_tax'; const TAX_TYPE_PST = 'pst'; const TAX_TYPE_QST = 'qst'; const TAX_TYPE_RST = 'rst'; From 0783c59483641452b957f4b75f9e370f1215a803 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 2 Mar 2023 13:27:35 -0800 Subject: [PATCH 2/5] Bump version to 10.8.0 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- lib/Stripe.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8452e4e6d..04d49819a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 10.8.0 - 2023-03-02 +* [#1447](https://github.com/stripe/stripe-php/pull/1447) API Updates + * Add support for `reconciliation_status` on `Payout` + * Add support for new value `lease_tax` on enum `TaxRate.tax_type` + ## 10.7.0 - 2023-02-23 * [#1444](https://github.com/stripe/stripe-php/pull/1444) API Updates * Add support for new value `igst` on enum `TaxRate.tax_type` diff --git a/VERSION b/VERSION index 1bcdaf5fe..2a3262d8a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.7.0 +10.8.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index db9f5d032..6925fad25 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '10.7.0'; + const VERSION = '10.8.0'; /** * @return string the API key used for requests From c72624111a73d6f1cdf2fea1671b1949001b7e2c Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 2 Mar 2023 14:47:01 -0800 Subject: [PATCH 3/5] Set version to 10.8.0 to simplify merge --- VERSION | 2 +- lib/Stripe.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 9b0f0c902..2a3262d8a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.8.0-beta.1 +10.8.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index 9ac404af5..6925fad25 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '10.8.0-beta.1'; + const VERSION = '10.8.0'; /** * @return string the API key used for requests From 407b026cf03af00f6aca280c6273f70810908380 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 2 Mar 2023 14:47:01 -0800 Subject: [PATCH 4/5] Reset version to 10.8.0-beta.1 --- VERSION | 2 +- lib/Stripe.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 2a3262d8a..9b0f0c902 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.8.0 +10.8.0-beta.1 diff --git a/lib/Stripe.php b/lib/Stripe.php index 6925fad25..9ac404af5 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '10.8.0'; + const VERSION = '10.8.0-beta.1'; /** * @return string the API key used for requests From 287ce73d97e55804be9bbaa30ddc0ebd78c71cdc Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 2 Mar 2023 14:47:21 -0800 Subject: [PATCH 5/5] Codegen for openapi v237 --- init.php | 5 ++ lib/Event.php | 3 + lib/Issuing/Card.php | 1 + lib/Issuing/CardBundle.php | 32 +++++++++++ lib/Issuing/CardDesign.php | 35 ++++++++++++ lib/Service/Issuing/CardBundleService.php | 40 +++++++++++++ lib/Service/Issuing/CardDesignService.php | 56 +++++++++++++++++++ lib/Service/Issuing/IssuingServiceFactory.php | 4 ++ .../TestHelpers/Issuing/CardDesignService.php | 42 ++++++++++++++ .../Issuing/IssuingServiceFactory.php | 2 + lib/Util/ObjectTypes.php | 2 + 11 files changed, 222 insertions(+) create mode 100644 lib/Issuing/CardBundle.php create mode 100644 lib/Issuing/CardDesign.php create mode 100644 lib/Service/Issuing/CardBundleService.php create mode 100644 lib/Service/Issuing/CardDesignService.php create mode 100644 lib/Service/TestHelpers/Issuing/CardDesignService.php diff --git a/init.php b/init.php index 17327513e..2659b9109 100644 --- a/init.php +++ b/init.php @@ -130,6 +130,8 @@ require __DIR__ . '/lib/InvoiceLineItem.php'; require __DIR__ . '/lib/Issuing/Authorization.php'; require __DIR__ . '/lib/Issuing/Card.php'; +require __DIR__ . '/lib/Issuing/CardBundle.php'; +require __DIR__ . '/lib/Issuing/CardDesign.php'; require __DIR__ . '/lib/Issuing/CardDetails.php'; require __DIR__ . '/lib/Issuing/Cardholder.php'; require __DIR__ . '/lib/Issuing/Dispute.php'; @@ -234,6 +236,8 @@ require __DIR__ . '/lib/Service/InvoiceItemService.php'; require __DIR__ . '/lib/Service/Issuing/AuthorizationService.php'; require __DIR__ . '/lib/Service/Issuing/CardService.php'; +require __DIR__ . '/lib/Service/Issuing/CardBundleService.php'; +require __DIR__ . '/lib/Service/Issuing/CardDesignService.php'; require __DIR__ . '/lib/Service/Issuing/CardholderService.php'; require __DIR__ . '/lib/Service/Issuing/DisputeService.php'; require __DIR__ . '/lib/Service/Issuing/TransactionService.php'; @@ -276,6 +280,7 @@ require __DIR__ . '/lib/Service/Terminal/ReaderService.php'; require __DIR__ . '/lib/Service/TestHelpers/CustomerService.php'; require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardService.php'; +require __DIR__ . '/lib/Service/TestHelpers/Issuing/CardDesignService.php'; require __DIR__ . '/lib/Service/TestHelpers/RefundService.php'; require __DIR__ . '/lib/Service/TestHelpers/Terminal/ReaderService.php'; require __DIR__ . '/lib/Service/TestHelpers/TestClockService.php'; diff --git a/lib/Event.php b/lib/Event.php index 2f4e2e87a..b86be8dda 100644 --- a/lib/Event.php +++ b/lib/Event.php @@ -166,6 +166,9 @@ class Event extends ApiResource const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; const ISSUING_CARD_CREATED = 'issuing_card.created'; const ISSUING_CARD_UPDATED = 'issuing_card.updated'; + const ISSUING_CARD_DESIGN_ACTIVATED = 'issuing_card_design.activated'; + const ISSUING_CARD_DESIGN_DEACTIVATED = 'issuing_card_design.deactivated'; + const ISSUING_CARD_DESIGN_UPDATED = 'issuing_card_design.updated'; const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created'; const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated'; const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; diff --git a/lib/Issuing/Card.php b/lib/Issuing/Card.php index 16d6e9d3d..427b8104f 100644 --- a/lib/Issuing/Card.php +++ b/lib/Issuing/Card.php @@ -12,6 +12,7 @@ * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string $brand The brand of the card. * @property null|string $cancellation_reason The reason why the card was canceled. + * @property null|string|\Stripe\Issuing\CardDesign $card_design The card design object belonging to this card. * @property \Stripe\Issuing\Cardholder $cardholder

An Issuing Cardholder object represents an individual or business entity who is issued cards.

Related guide: How to create a Cardholder

* @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. Supported currencies are usd in the US, eur in the EU, and gbp in the UK. diff --git a/lib/Issuing/CardBundle.php b/lib/Issuing/CardBundle.php new file mode 100644 index 000000000..06d11c00b --- /dev/null +++ b/lib/Issuing/CardBundle.php @@ -0,0 +1,32 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $name Friendly display name. + * @property string $status Whether this card bundle can be used to create cards. + * @property string $type Whether this card bundle is a standard Stripe offering or custom-made for you. + */ +class CardBundle extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.card_bundle'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_REVIEW = 'review'; + + const TYPE_CUSTOM = 'custom'; + const TYPE_STANDARD = 'standard'; +} diff --git a/lib/Issuing/CardDesign.php b/lib/Issuing/CardDesign.php new file mode 100644 index 000000000..383ca3bed --- /dev/null +++ b/lib/Issuing/CardDesign.php @@ -0,0 +1,35 @@ +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 Friendly display name. + * @property string $preference Whether this card design is used to create cards when one is not specified. + * @property string $status Whether this card design can be used to create cards. + */ +class CardDesign extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.card_design'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const PREFERENCE_DEFAULT = 'default'; + const PREFERENCE_NONE = 'none'; + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_REJECTED = 'rejected'; + const STATUS_REVIEW = 'review'; +} diff --git a/lib/Service/Issuing/CardBundleService.php b/lib/Service/Issuing/CardBundleService.php new file mode 100644 index 000000000..5f34874ac --- /dev/null +++ b/lib/Service/Issuing/CardBundleService.php @@ -0,0 +1,40 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/card_bundles', $params, $opts); + } + + /** + * Retrieves a card bundle 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\CardBundle + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/card_bundles/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/Issuing/CardDesignService.php b/lib/Service/Issuing/CardDesignService.php new file mode 100644 index 000000000..eca9bde30 --- /dev/null +++ b/lib/Service/Issuing/CardDesignService.php @@ -0,0 +1,56 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/card_designs', $params, $opts); + } + + /** + * Retrieves a card design 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\CardDesign + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/card_designs/%s', $id), $params, $opts); + } + + /** + * Updates a card design 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\CardDesign + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/card_designs/%s', $id), $params, $opts); + } +} diff --git a/lib/Service/Issuing/IssuingServiceFactory.php b/lib/Service/Issuing/IssuingServiceFactory.php index a8d5d0f81..172b71114 100644 --- a/lib/Service/Issuing/IssuingServiceFactory.php +++ b/lib/Service/Issuing/IssuingServiceFactory.php @@ -8,6 +8,8 @@ * Service factory class for API resources in the Issuing namespace. * * @property AuthorizationService $authorizations + * @property CardBundleService $cardBundles + * @property CardDesignService $cardDesigns * @property CardholderService $cardholders * @property CardService $cards * @property DisputeService $disputes @@ -20,6 +22,8 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory */ private static $classMap = [ 'authorizations' => AuthorizationService::class, + 'cardBundles' => CardBundleService::class, + 'cardDesigns' => CardDesignService::class, 'cardholders' => CardholderService::class, 'cards' => CardService::class, 'disputes' => DisputeService::class, diff --git a/lib/Service/TestHelpers/Issuing/CardDesignService.php b/lib/Service/TestHelpers/Issuing/CardDesignService.php new file mode 100644 index 000000000..88fff843b --- /dev/null +++ b/lib/Service/TestHelpers/Issuing/CardDesignService.php @@ -0,0 +1,42 @@ +status of the specified testmode card design object to + * active. + * + * @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\CardDesign + */ + public function activateTestmode($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/card_designs/%s/status/activate', $id), $params, $opts); + } + + /** + * Updates the status of the specified testmode card design object to + * inactive. + * + * @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\CardDesign + */ + public function deactivateTestmode($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/card_designs/%s/status/deactivate', $id), $params, $opts); + } +} diff --git a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php index a202ec33f..1b3a24ef6 100644 --- a/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php +++ b/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php @@ -7,6 +7,7 @@ /** * Service factory class for API resources in the Issuing namespace. * + * @property CardDesignService $cardDesigns * @property CardService $cards */ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory @@ -15,6 +16,7 @@ class IssuingServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'cardDesigns' => CardDesignService::class, 'cards' => CardService::class, ]; diff --git a/lib/Util/ObjectTypes.php b/lib/Util/ObjectTypes.php index 2e63d3c46..ba403033e 100644 --- a/lib/Util/ObjectTypes.php +++ b/lib/Util/ObjectTypes.php @@ -62,6 +62,8 @@ class ObjectTypes \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, + \Stripe\Issuing\CardBundle::OBJECT_NAME => \Stripe\Issuing\CardBundle::class, + \Stripe\Issuing\CardDesign::OBJECT_NAME => \Stripe\Issuing\CardDesign::class, \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class,