202-ecommerce / stripe_official

After years of hard work with Stripe connector for PrestaShop, 202 ecommerce stop the development of Stripe module on January 9th 2023. Thanks for all contributors that help us!
20 stars 20 forks source link

Card payment stays uncaptured #71

Closed zorrobiwan closed 2 years ago

zorrobiwan commented 3 years ago

PS 1.6.1.7 Module Stripe: 2.3.2

TEST mode

Trying to make a payement with fake card 4242... Payment is initiated but stays uncaptured in Stripe (as payment method is card and capture method is manual in your code)

Order is in payment accepted status in BO but payment has to be captured manually in Stripe...

Payment should be captured

nb: module is not configure with catch and authorize

mribeiro202 commented 3 years ago

Hi @zorrobiwan,

Thank you for your issue. We know this bug, can you try to reset the module and try again a payment ?

Can you tell me if it's ok after this ?

zorrobiwan commented 3 years ago

Hi @mribeiro202

problem is still there after a module reset. Thx for your followup

mribeiro202 commented 3 years ago

@zorrobiwan

Ok thank you thank you for trying. Can you contact my support team ? here is the link : https://addons.prestashop.com/en/contact-us?id_product=24922

zorrobiwan commented 3 years ago

will do thx

Jakibrn commented 3 years ago

Hello, I have the same problem. do you have a previous version of the module?

sanchezt commented 3 years ago

Hello,

You can download the previous version v2.3.1 here : https://github.com/202-ecommerce/stripe_official/releases/download/2.3.1/v2.3.1-prod-stripe_official.zip

Don't forget to purge the Prestashop cache and reactivate payment method in BO.

ecenturyuk commented 3 years ago

Had the same issue with a client's site and rollback to version 2.3.1 solved it.

It was on a 1.7.6.5 prestashop version

Never seen this issue before where the order goes through fine for the customer, but the transaction stays uncaptured in the stripe dashboard and then does not create an order in the backend. Do you know whats it's conflicting with?

mribeiro202 commented 3 years ago

Hi @ecenturyuk ,

We are currently testing the fix for this issue, if everything is OK after our test, i will release it really soon on addons. I will post here to advertise all of you ;)

darkstudio commented 3 years ago

Hi, Same issue here with v2.3.2. i will try to rollback to v2.3.1.

netdrag commented 3 years ago

Same here. The webhook returns a status 400. seems to have to do with the changes to the webhook in v2.3.2

JMauclair commented 3 years ago

Same issue with the v2.3.2 on PS 1.7.2

marksull commented 3 years ago

This is a horrible bug that has caused us an enormous amount of pain. As @ecenturyuk said, the customer thinks they have paid because the shop said "Order Successfully Placed" and yet nothing is created in the shop, so as a shop owner you are not aware of the problem unless you go into your stripe dashboard and see the long list of "uncaptured" transactions. 2.3.2 is still the version available on prestashop addons and I only updated a few days ago. As soon as this problem was reported above 2.3.2 should have been immediately removed from addons so that additional shops are not impacted????

michaeldebetaz commented 3 years ago

Same issue here, on PS 1.7.7.5. I created a ticket on Prestashop Add-on. I'll try to downgrade the module.

Okay, the auto-capture works fine on v2.3.1, but it seems to be unable to reach the payment confirmation page :/ I deactivated the plugin for now. I'll wait for the next update...

inspectaclueso commented 3 years ago

I am experiencing similar issues. I'm running Prestashop 1.7.7.3 Stripe has been working fine until I upgraded to 2.3.2
After upgrading, I would not know I had received an order. No order was created in back office and no emails were generated. The only way I knew an order had been placed was that in Stripe dashboard there was an uncaptured payment sitting there. I had to manually click to capture the payment and then manually create an order from the customer cart in back office. Upgrading the module to 2.3.4 did not fix the issue for me. I downloaded and re-installed 2.3.1 and it is back to working normally.

marzenarog commented 3 years ago

Hey guys, im experiencing same problem, whats the solution pls???? HELPP

marzenarog commented 3 years ago

Stripe payment module v2.3.4 from 202 ecommerce - I CAN NOT SEE THE ORDERS IN MY BACK OFFICE ( PRESTASHOP 1.7.7.5. )

michaeldebetaz commented 3 years ago

I reinstalled the plugin on the 2.3.1 version, as recommended by the support team. It works fine, but the test mode is broken.

If you encounter an issue, I would recommend to delete the plugin, reinstall on version 2.3.1 (link above), clear the cache and profit.

mrabsinthe commented 3 years ago

@mribeiro202 The bug was introduced in v2.3.2 and it has been reported by several merchants. This is without a doubt one of the most vital modules and yet, the bug is still not fixed in the next version? Can the team provide the working fix ASAP please?

inspectaclueso commented 3 years ago

I am not a developer, but after talking with Stripe support and searching the module code I think at least part of the problem is...

In the file... controllers\front\createIntent.php

Line 43: $capture_method = 'manual';

I believe this should be 'automatic' as per Stripe documentation...

https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method

I don't know if this would resolve the issue of orders not being created in back office but surely it will complete the transaction without manually having to go into the Stripe dashboard and click capture. At least then you should get an email from Stripe advising you have received a payment.

mribeiro202 commented 3 years ago

Hi,

Version 2.3.2 introduced a new payment validation scheme using webhook.

Unfortunately, version 2.3.2 introduced 2 different bugs, leading in Payment Uncaptured in Stripe Dashboard.

1 - Multiple payment intents (payment attempt) on the same cart. This issue is fixed by version 2.3.4.

2 - In some cases, changing credentials or switching between Test & Prod does not update webhook. This issue will be fixed in the coming days by version 2.3.5. In the meantime, webhook can be manually regenerated following theses steps : https://help.202-ecommerce.com/stripe-for-prestashop/procedure-to-replace-the-stripe-key-in-the-database/

@inspectaclueso : thanks for your feedback, but this behaviour is normal : capture_method is set to manual only for cards, then capture is triggered by webhook (if catch & authorize is disabled).

JimmyBillan commented 3 years ago

Hello, You can check if you need to reset your credential on the stripe dashboard.

On the stripe dashboard > developers > webhooks > [choose your endpoints]. On "Webhook attempts" look for charge.succeded "failed", open it.

If the "Response" is " No signatures found matching the expected signature for payload " then you should update your STRIPE_WEBHOOK_SIGNATURE l

mribeiro202 commented 3 years ago

Hi all,

The last release is now available on PrestaShop addons just here (v2.3.5) ==> https://addons.prestashop.com/en/payment-card-wallet/24922-stripe-official-sca-ready.html

We fix the issue related to webhook signature update.

When you install this version go and check your module configurations, it may be necessary to backup your keys again. A message will appear in the module configuration screen if this is the case, you will simply have to save the configurations.

Do not hesitate to send me feedback after installing and testing version 2.3.5.

Thank you all for your help and kindness.

vcsahu16 commented 3 years ago

Hey guys, im experiencing same problem, whats the solution pls???? HELPP

Hi , There is bug in the Stripe module .

Order is not created because during ValidateOrder call the function is not getting the $customer->secure_key.

because the module is trying to create customer object from cart id.

So In the /classes/actions/ValidationOrderActions.php Goto line no. 305 and

Change this line

$customer = new Customer($this->conveyor['cart']->id);

To

$customer = new Customer($this->conveyor['cart']->id_customer);

vcsahu16 commented 3 years ago

I am experiencing similar issues. I'm running Prestashop 1.7.7.3 Stripe has been working fine until I upgraded to 2.3.2 After upgrading, I would not know I had received an order. No order was created in back office and no emails were generated. The only way I knew an order had been placed was that in Stripe dashboard there was an uncaptured payment sitting there. I had to manually click to capture the payment and then manually create an order from the customer cart in back office. Upgrading the module to 2.3.4 did not fix the issue for me. I downloaded and re-installed 2.3.1 and it is back to working normally.

Hi , There is bug in the Stripe module .

Order is not created because during ValidateOrder call the function is not getting the $customer->secure_key.

because the module is trying to create customer object from cart id.

So In the /classes/actions/ValidationOrderActions.php Goto line no. 305 and

Change this line

$customer = new Customer($this->conveyor['cart']->id);

To

$customer = new Customer($this->conveyor['cart']->id_customer);

Chrisi1321 commented 3 years ago

this is unfortunately not working for me

vcsahu16 commented 3 years ago

this is unfortunately not working for me

if customer does not have the key Then you can try this . In the /classes/actions/ValidationOrderActions.php Go near line no. 310:

Replace

If (isset($customer->secure_key)) {

$this->conveyor['secure_key'] = $customer->secure_key;

} else {

$this->conveyor['secure_key'] = false;

}

with

if (isset($this->conveyor['cart']->secure_key)) {

$this->conveyor['secure_key'] = $this->conveyor['cart']->secure_key;

} else {

$this->conveyor['secure_key'] = false;

}

Hope this will work for you. Thanks

mribeiro202 commented 3 years ago

Hi @vcsahu16 ,

Thank you for your comment, we are currently looking into this issue, we will keep you informed of our progress.

Chrisi1321 commented 3 years ago

The issue is that the order only gets validated for one of my 3 multishops. There must be an issue with the multishop function

eggfriedrice commented 3 years ago

@mribeiro202 any news on this issue?

We're seeing lots of this "PaymentModule::validateOrder - Secure key does not match" issue and uncaptured payments.

My STRIPE_WEBHOOK_SIGNATURE config is correct - it matches the webhook in Stripe.

I'm about to rollback from 2.3.5.

mribeiro202 commented 3 years ago

hi @eggfriedrice ,

Our support on the module will be able to help you to solve this problem I suggest you to contact him on this link ==> https://addons.prestashop.com/en/contact-us?id_product=24922

Ashley-Butcher commented 3 years ago

The issue is that the order only gets validated for one of my 3 multishops. There must be an issue with the multishop function

I am suspecting this too. As I commented on another issue, per store, we see the error "Webhook configuration cannot be accessed, click on save button to fix issue. A new webhook will be created on Stripe." when configuring the Stripe module.

If we save the config, it works (fixes the webhook), but only for that store. If we click "save" in another store context, then it's fixed only for THAT store now, and the other previous store again shows a setup problem. I suspect that webhooks became mandatory but multistore environments are not correctly supported yet.

Comval202 commented 3 years ago

Hi all,

The last release is now available on PrestaShop addons just here (v2.3.6) ==> https://addons.prestashop.com/en/payment-card-wallet/24922-stripe-official-sca-ready.html

Do not hesitate to send feedback after installing and testing version 2.3.6.

We are currently try to reproduce the multistore issue, could you please open an incident on https://addons.prestashop.com/en/contact-us?id_product=24922

Thank you all for your help.

Ashley-Butcher commented 3 years ago

This problem still occurs in 2.3.6 in multistore - see also issue #93. If you are struggling to reproduce it, it may help to know that we have 10 shops:

Shop 1 and shop 10 are in one group, shops 2 to 9 are in another group. We usually have Stripe transactions in shops 2-9 and none seem to work properly as far as we can tell. Carts are shared between stores in the second shop group, but not the first, and obviously carts cannot be shared across shop groups. I suspect there is an issue with the store context when the webhook calls into PrestaShop, i.e. it defaults to shop with the ID 1, making carts in other shops not visible. We're using PrestaShop version 1.7.7.8.

githubjonny commented 3 years ago

We still have this issue on our site. Not a multisite. PS 1.7.7.8 / v2.3.6 - by 202 ecommerce. Webhook keys are correct. It's strange as most orders go through without any issues. However, 2 yesterday (out of 20+) are stuck as "uncaptured".

darkstudio commented 3 years ago

We still have this issue on our site. Not a multisite. PS 1.7.7.8 / v2.3.6 - by 202 ecommerce. Webhook keys are correct. It's strange as most orders go through without any issues. However, 2 yesterday (out of 20+) are stuck as "uncaptured".

pfffff.. this is why we haven't not yet updated the module... always on 2.3.2.

githubjonny commented 3 years ago

We have tried 2.3.7 (provided by the dev) but the issue still exists. What API is everyone using on here in stripe? 2020-08-27 or 2019-08-14? I think we are going to move to prestashop checkout (annoying as I prefer stripe) but the language barrier when communication with the dev means questions are being left unanswered and due to GDPR providing access to the server/PS admin isn't an option.

The main change in 2.3.6 seems to be the customer is now sent to a stripe module order confirmation page instead of the default prestashop order confirmation page.

I wonder if the customer is not staying on the page long enough for the order to be set up in prestashop? e.g. hitting the complete page then closing the browser or home button etc before any webhooks can be activated? Also it's very annoying that this page has been added as all the customisation we have is on our default checkout complete page (no need to have a new checkout complete page for stripe customers).

I also haven't managed to find any link as to why some orders go through fine and others fail. Has anyone else noticed a pattern with their uncaptured orders?

githubjonny commented 3 years ago

Spoke to stripe and it's Interesting that the payments in previous modules (before the errors started happening), the capture method was passed as automatic (not manual).

from stripe : "You need to get in touch with Prestashop support and ask them to start passing the capture method as automatic again on the payments to your account"

Ashley-Butcher commented 3 years ago

We have tried 2.3.7 (provided by the dev) but the issue still exists. What API is everyone using on here in stripe? 2020-08-27 or 2019-08-14? I think we are going to move to prestashop checkout (annoying as I prefer stripe) but the language barrier when communication with the dev means questions are being left unanswered and due to GDPR providing access to the server/PS admin isn't an option.

We're in the EU and use Mollie for debit card transactions, Stripe for credit card transactions. Mollie is our backup for credit card transactions if Stripe isn't working (which is very often lately), but we will probably switch to Mollie permanently as the extra brokerage fee on CC transactions via Mollie is probably worth it as their module works very well, and their support and service is outstanding.

I also haven't managed to find any link as to why some orders go through fine and others fail. Has anyone else noticed a pattern with their uncaptured orders?

For us it's every order.

Spoke to stripe and it's Interesting that the payments in previous modules (before the errors started happening), the capture method was passed as automatic (not manual).

This is a module setting now since a recent version ("Enable separate authorization and capture.") - we have this disabled because we want it to be automatic, but indeed it looks like it's never captured automatically.

However, I think it's correct not to capture it until the order has been booked in prestashop, just in case something breaks in prestashop (i.e. bug in PS or in another module). However, for that to work, the Stripe module really needs to be very robustly developed.

githubjonny commented 3 years ago

We also have "Enable separate authorization and capture." disabled (unticked). I wonder if this setting is not being saved correctly. I take it your stripe keys match in the database to the ones in stripe > dev > api?

Ashley-Butcher commented 3 years ago

@githubjonny Sorry I forgot to answer your first question :)

What API is everyone using on here in stripe? 2020-08-27 or 2019-08-14?

We're using API version 2020-08-27.

I take it your stripe keys match in the database to the ones in stripe > dev > api?

Yes! We checked our API keys carefully when problems began, and they are still correct. We don't see any issues with this in the logs.

The issues seem to start when Stripe is calling back to PS via the webhooks, where Stripe is getting an error back from PS: "Cart cannot be loaded or an order has already been placed using this cart". It seems that the order is not yet in the correct state, or the stripe module is looking in the wrong store context. For this, see issue #93 for more details.

If the "abandoned" cart is converted into an order manually in the PS backoffice under the correct store context, with Stripe as the payment method, and a payment pending status, then retrying the failed webhook call from the Stripe dashboard causes the order to start being processed properly.

I wonder if this is also the case in your uncaptured orders?

Ashley-Butcher commented 3 years ago

By the way, indeed, I see that the capture_method value is manual in the payment_intents calls to Stripe. I have checked the code, and I don't have time at the moment to dig into this unfortunately.

While maybe this should be automatic instead of manual, I think it might be a part of their new internal workflow where they will probably capture the payment once they can confirm the order has been accepted/stored in PrestaShop correctly. It seems like a reasonable thing to do (if it worked reliably).

Since all of our Stripe transactions are going uncaptured, I don't have anything to dig into. For the orders you have that were captured properly, can you maybe check in stripe -> developers -> logs for a payment_intents POST and see if that one also has capture_method set to manual.

darkstudio commented 3 years ago

By the way, indeed, I see that the capture_method value is manual in the payment_intents calls to Stripe. I have checked the code, and I don't have time at the moment to dig into this unfortunately.

While maybe this should be automatic instead of manual, I think it might be a part of their new internal workflow where they will probably capture the payment once they can confirm the order has been accepted/stored in PrestaShop correctly. It seems like a reasonable thing to do (if it worked reliably).

Since all of our Stripe transactions are going uncaptured, I don't have anything to dig into. For the orders you have that were captured properly, can you maybe check in stripe -> developers -> logs for a payment_intents POST and see if that one also has capture_method set to manual.

Very strange... i have same issue with a installed prestashop (where i have updated stripe) but with a fresh installed prestashop installed directly with last stripe module, no issue occured. Its totaly strange because i have totaly uninstalled and clean stripe module from installed prestashop and reinstalled module, issue still the same. FOr me => go back 2.3.2 . we wait a robust fix :)

githubjonny commented 3 years ago

If the "abandoned" cart is converted into an order manually in the PS backoffice under the correct store context, with Stripe as the payment method, and a payment pending status, then retrying the failed webhook call from the Stripe dashboard causes the order to start being processed properly. I wonder if this is also the case in your uncaptured orders?

Yes, this is how we are managing to get the 'escaped' orders at the moment. However, ringing each customer up to check if they did order or if they cancelled or hit the back button etc is a pain (not to mention not professional).

FOr me => go back 2.3.2 . we wait a robust fix :)

I was going to do that but we actually got a call from paypal regarding their prestashop checkout and they offered us 0.5% better rates per transaction. Set it up this afternoon and seems to work (actually looks better than stripe). Would still like to fix stripe though as a backup.

Interestingly, API 2020-08-27 hasn't given us any Uncaptured this afternoon but that could simply be a coincidence.

clotairer commented 2 years ago

We publish last week the release 2.4.0 witch solve issued about uncaptured payments.

You can update your addons. If you have any trouble do not hesitate to contact our technical support here : https://addons.prestashop.com/en/contact-us?id_product=24922

inspectaclueso commented 2 years ago

Has anyone tried the new 2.4.0 Stripe module yet on PS 1.7.7? I'm currently still using 2.3.1 due to the uncaptured payments/no order created issue and previous updates didn't resolve it so hesitant to install and miss orders again.

clotairer commented 2 years ago

We have broadcast the module 2.4.0 in bêta during 4 weeks. All return has been successful.

Do not hesitate to « ping » me if you need help by sending a message on this form https://addons.prestashop.com/en/contact-us?id_product=24922

darkstudio commented 2 years ago

For me, Stuck and rollback to 2.3.1 since 02 march 2021 because stripe (and 202commerce!!) can't assume problems if we have any order /capture problems and my client has exeeced by a problem with stripe, if i update and module cause a problem, me and stripe loose client forever.

clotairer commented 2 years ago

@darkstudio ask me if you need help for one of your customers. Send me your demand here https://addons.prestashop.com/en/contact-us?id_product=24922 by mention me, I'll try to found a direct solution for you. Today or when you'll found time. Thank you.

homegourmet commented 2 years ago

hi, issue still there. using PrestaShop 1.7.7.3 and module 2.4.1 for Stripe.... Two issues : 1/ Payment Uncaptured for orders made with VISA cards 2/ Order not created in PrestaShop for some payements made by Bancontact.

This is really a serious, and longstanding issue...

clotairer commented 2 years ago

You might install lastest version 2.4.3 you can download here https://github.com/202-ecommerce/stripe_official/releases/tag/2.4.3