public function setApiVersion($version)
    {
        if (!in_array($version, $this->availableVersions, true)) {
            throw new UnsupportedStripeVersionException(sprintf(
                'The given Stripe version ("%s") is not supported by ZfrStripe. Value must be one of the following: "%s"',
                $version,
                implode(', ', $this->availableVersions)
            ));
        }

        $this->version = (string) $version;
        $this->setDefaultOption('headers', ['Stripe-Version' => $this->version]);

        if ($this->version < '2015-08-19') {
            $descriptor = __DIR__ . '/ServiceDescription/Stripe-v1.0.php';
        } else {
            $descriptor = __DIR__ . '/ServiceDescription/Stripe-v1.1.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));
    }
public function setApiVersion($version)
    {
        if (!in_array($version, $this->availableVersions, true)) {
            throw new UnsupportedStripeVersionException(sprintf(
                'The given Stripe version ("%s") is not supported by ZfrStripe. Value must be one of the following: "%s"',
                $version,
                implode(', ', $this->availableVersions)
            ));
        }

        $this->version = (string) $version;
        $this->setDefaultOption('headers', ['Stripe-Version' => $this->version]);

        if ($this->version < '2015-08-19') {
            $descriptor = __DIR__ . '/ServiceDescription/Stripe-v1.0.php';
        } else {
            $descriptor = __DIR__ . '/ServiceDescription/Stripe-v1.1.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));
    }
public function setApiVersion ( $ version ) { if ( ! in_array ( $ version , $ this -> availableVersions , true ) ) { throw new UnsupportedStripeVersionException ( sprintf ( 'The given Stripe version ("%s") is not supported by ZfrStripe. Value must be one of the following: "%s"' , $ version , implode ( ', ' , $ this -> availableVersions ) ) ) ; } $ this -> version = ( string ) $ version ; $ this -> setDefaultOption ( 'headers' , [ 'Stripe-Version' => $ this -> version ] ) ; if ( $ this -> version < '2015-08-19' ) { $ descriptor = __DIR__ . '/ServiceDescription/Stripe-v1.0.php' ; } else { $ descriptor = __DIR__ . '/ServiceDescription/Stripe-v1.1.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 ) ) ; }
Set the Stripe API version

This method forces to add a Stripe-Version header, so that you can use the wanted version no matter
what the setting is on Stripe

@param  string $version
@return void
Set the Stripe API version