Stripe\Stripe::setApiVersion PHP Method

setApiVersion() public static method

public static setApiVersion ( string $apiVersion )
$apiVersion string The API version to use for requests.
    public static function setApiVersion($apiVersion)
    {
        self::$apiVersion = $apiVersion;
    }

Usage Example

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     /*
      * Load Stripe configuration
      *
      * API keys should be utilizing Laravel's "dot files" to keep them out of source
      * control and making them easily overridable on dev environments
      *
      * Read more: http://laravel.com/docs/configuration#environment-configuration
      */
     $api_key = isset($_ENV['stripe.api_key']) ? $_ENV['stripe.api_key'] : $this->app['config']->get('services.stripe')['api_key'];
     \Stripe\Stripe::setApiKey($api_key);
     // Set API Version (optional)
     $api_version = isset($_ENV['stripe.api_version']) ? $_ENV['stripe.api_version'] : $this->app['config']->get('services.stripe')['api_version'];
     if ($api_version !== null) {
         \Stripe\Stripe::setApiVersion($api_version);
     }
     $publishableKey = isset($_ENV['stripe.publishable_key']) ? $_ENV['stripe.publishable_key'] : $this->app['config']->get('services.stripe')['publishable_key'];
     /*
      * Register blade compiler for the Stripe publishable key.
      */
     $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler();
     $blade->extend(function ($value, $compiler) use($publishableKey) {
         $matcher = "/(?<!\\w)(\\s*)@stripeKey/";
         return preg_replace($matcher, $publishableKey, $value);
     });
 }
All Usage Examples Of Stripe\Stripe::setApiVersion