We'll want to explicitly target an api version. The code below targets the currently compatible version but we can update the gateway to handle a more recent version and update to target it.
In components/gateways/merchant/stripe_payments/stripe_payments.php change
/**
* Loads the API if not already loaded
*/
private function loadApi()
{
Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php');
Stripe\Stripe::setApiKey((isset($this->meta['secret_key']) ? $this->meta['secret_key'] : null));
// Include identifying information about this being a gateway for Blesta
Stripe\Stripe::setAppInfo('Blesta ' . $this->getName(), $this->getVersion(), 'https://blesta.com');
}
To
/**
* Loads the API if not already loaded
*/
private function loadApi()
{
Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php');
Stripe\Stripe::setApiKey((isset($this->meta['secret_key']) ? $this->meta['secret_key'] : null));
// Include identifying information about this being a gateway for Blesta
Stripe\Stripe::setAppInfo('Blesta ' . $this->getName(), $this->getVersion(), 'https://blesta.com');
// Set API version
Stripe\Stripe::setApiVersion('2022-08-01');
}
Jonathan Reissmueller
added a comment - - edited We'll want to explicitly target an api version. The code below targets the currently compatible version but we can update the gateway to handle a more recent version and update to target it.
In components/gateways/merchant/stripe_payments/stripe_payments.php change
/**
* Loads the API if not already loaded
*/
private function loadApi()
{
Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php');
Stripe\Stripe::setApiKey((isset($ this ->meta['secret_key']) ? $ this ->meta['secret_key'] : null ));
// Include identifying information about this being a gateway for Blesta
Stripe\Stripe::setAppInfo('Blesta ' . $ this ->getName(), $ this ->getVersion(), 'https: //blesta.com');
}
To
/**
* Loads the API if not already loaded
*/
private function loadApi()
{
Loader::load(dirname(__FILE__) . DS . 'vendor' . DS . 'stripe' . DS . 'stripe-php' . DS . 'init.php');
Stripe\Stripe::setApiKey((isset($ this ->meta['secret_key']) ? $ this ->meta['secret_key'] : null ));
// Include identifying information about this being a gateway for Blesta
Stripe\Stripe::setAppInfo('Blesta ' . $ this ->getName(), $ this ->getVersion(), 'https: //blesta.com');
// Set API version
Stripe\Stripe::setApiVersion('2022-08-01');
}
We'll want to explicitly target an api version. The code below targets the currently compatible version but we can update the gateway to handle a more recent version and update to target it.
In components/gateways/merchant/stripe_payments/stripe_payments.php change
To