Summary:
statement_description parameter is deprecated in latest Stripe API
Detailed Description:
While testing this module the test transactions always failed with a
non-specific error message saying the transaction could not be completed.
Checking in the Stripe dashboard logs showed
type: "invalid_request_error"
message: "Received unknown parameter: statement_description"
param: "statement_description"
Checking on the Stripe API updates I found
The statement_description parameter on charges, invoices, transfers, and plans
is now deprecated in favor of the statement_descriptor parameter, which allows
you to specify the full descriptor that appears on your customer’s statement for
the transaction. Specifying statement_descriptor without upgrading to this API
version will still prepend your account’s statement descriptor to the
transaction’s statement descriptor.
I checked the StripeGateway.module.php file and found this at line 404
'statement_description'=>substr(cge_utils::get_param($this->_data,'description'),0,15),
Which I changed to
'statement_descriptor'=>substr(cge_utils::get_param($this->_data,'description'),0,15),
I still received the error message and the error was still logged on the Stripe
dashboard so I downloaded the latest API files from
https://github.com/stripe/stripe-php/releases and swapped then for the files in
the lib/ directory.
Now when I test a purchase I get no error log in Stripe but the post-transaction
landing page is blank.
Additionally I see these errors in the Apache logs.
[Wed Jan 20 08:30:54.199049 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP Fatal error: Class 'Stripe' not found in
/var/www/html/tpb/modules/StripeGateway/action.create_charge.php on line 57
[Wed Jan 20 08:30:54.199126 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP Stack trace:
[Wed Jan 20 08:30:54.199149 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 1. {main}() /var/www/html/tpb/index.php:0
[Wed Jan 20 08:30:54.199161 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 2. Smarty_CMS->fetch()
/var/www/html/tpb/index.php:243
[Wed Jan 20 08:30:54.199171 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 3. Smarty_Internal_TemplateBase->fetch()
/var/www/html/tpb/lib/classes/class.Smarty_CMS.php:341
[Wed Jan 20 08:30:54.199180 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 4. content_569f88bd6fecc2_28243531()
/var/www/html/tpb/lib/smarty/libs/sysplugins/smarty_internal_templatebase.php:182
[Wed Jan 20 08:30:54.199191 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 5.
CMS_Content_Block::smarty_internal_fetch_contentblock()
/var/www/html/tpb/tmp/templates_c/1ed9b7e2d86c34f9dab8c572f920035e590a161e.tpl_body.27.php:60
[Wed Jan 20 08:30:54.199201 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 6. CMSModule->DoActionBase()
/var/www/html/tpb/lib/classes/class.CMS_Content_Block.php:284
[Wed Jan 20 08:30:54.199210 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 7. StripeGateway->DoAction()
/var/www/html/tpb/lib/classes/class.CMSModule.php:1799
[Wed Jan 20 08:30:54.199218 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 8. CGExtensions->DoAction()
/var/www/html/tpb/modules/StripeGateway/StripeGateway.module.php:294
[Wed Jan 20 08:30:54.199227 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 9. CMSModule->DoAction()
/var/www/html/tpb/modules/CGExtensions/CGExtensions.module.php:694
[Wed Jan 20 08:30:54.199235 2016] [:error] [pid 7733] [client
146.185.20.156:65174] PHP 10. include()
/var/www/html/tpb/lib/classes/class.CMSModule.php:1732