- πΊπΈUnited States TomTech
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.
We ran into this issue today after upgrading to PHP7 and a database-backed cache backend.
The result was that a Stripe payment would actually be successful (and captured as shown in the Stripe backend) but the user was unable to complete checkout, and subsequently, no payment was saved to the order. (Usually, the customer would try a second time, and that time would be successful.)
From what we can tell, this is a MYSQL error (it's actually a PDOException) that is leaking into the credit card form's error catch/handler ($e->getMessage()). One hunch is that the db_transaction that is used to save the initial pending payment transaction is destroyed, and so further saves to the same transaction will, on occasion fail.
Here is the full exception:
PDOException: There is no active transaction in CommercePaymentTransactionEntityController->save() (line 118 of commerce/modules/payment/includes/commerce_payment_transaction.controller.inc).
Line 118 is where the controller calls parent::save($transaction, $db_transaction), and for the most part only seems to affect users who are checking out with a stored Card on File. For now (testing purposes) I'm removing the additional call to _commerce_stripe_commerce_payment_transaction_save() to see if that has any impact. Otherwise I think we might need to find a better way of saving pending transactions, or just not save them at all.
I have also slightly reorganized the two hunks of code that perform charging via the Stripe API so that the transaction is only saved near the end of the operation. Not sure that will help much but it's worth investigating.
Closed: outdated
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.