diff --git a/CHANGELOG.md b/CHANGELOG.md index 3027e47..11ea421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * [BC] Set default Stripe API to "2015-02-18" version (note: this version brings several important breaking changes in how you use Stripe API). +* Fix a bug when changing the API version at runtime did not properly updated the descriptor. # 2.13.0 diff --git a/src/Client/StripeClient.php b/src/Client/StripeClient.php index c04b2cd..e585321 100644 --- a/src/Client/StripeClient.php +++ b/src/Client/StripeClient.php @@ -312,6 +312,8 @@ public function setApiVersion($version) $descriptor = __DIR__ . '/ServiceDescription/Stripe-v1.3.php'; } + // Note that we need to recreate a whole new CompositeFactory whenever the version is changed + $this->setCommandFactory(new CompositeFactory()); $this->setDescription(ServiceDescription::factory($descriptor)); }