Comments (7)
Hi,
Thank you for reporting this.
I think you're right, we introduce a bug 51c18d9
In the controllers/front/orderSuccess.php > $eventType == 'succeeded'
In the controllers/front/webhook.php > $eventType == 'charge.succeeded'
Same variable name but value with for one and whithout "charge." for the other...
Fixed in develop branch here 6ee73a4
It will be fixed in 2.4.5
Many thanks
from stripe_official.
I got it, indeed I was troubled by the same naming of things. Thank you.
from stripe_official.
I had a case where it was via webhook and just "succeeded" as status, so I had to use this for both controllers webhook and ordersuccess :
($eventType == 'charge.succeeded' || $eventType == 'succeeded')
No problems since...
from stripe_official.
@ello10
Stripe never returned "succeeded" but always returned "charge.succeeded". So for us your OR condition on $eventType in the webhookController is not mandatory.
from stripe_official.
We are talking about the status field, right ?? How about the trace below, which had the same symptoms (no order created in PS) :
En attente de réponse du webhook
Un webhook abonné à l'événement n'a pas encore répondu
Données de l'événement
{
"id": "removed",
"object": "charge",
"livemode": true,
"payment_intent": "removed",
"status": "succeeded",
"amount": 6390,
"amount_captured": 6390,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "removed",
"billing_details": {
"address": {
"city": "removed",
"country": "BE",
"line1": "Rue De La removed, removed",
"line2": "",
"postal_code": "removed",
"state": null
},
"email": "[email protected]",
"name": "nobody",
"phone": null
},
"calculated_statement_descriptor": null,
"captured": true,
"created": 1655326596,
"currency": "eur",
"customer": null,
"description": "Product Purchase",
"destination": null,
"dispute": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {
},
"invoice": null,
"metadata": {
"id_cart": "8450"
},
"on_behalf_of": null,
"order": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "not_assessed",
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_method": "removed",
"payment_method_details": {
"bancontact": {
"bank_code": null,
"bank_name": null,
"bic": "removed",
"generated_sepa_debit": null,
"generated_sepa_debit_mandate": null,
"iban_last4": "6945",
"preferred_language": "en",
"verified_name": null
},
"type": "bancontact"
........
from stripe_official.
You have two similar $eventType variable in:
- In the controllers/front/orderSuccess.php > $eventType == 'succeeded'
- In the controllers/front/webhook.php > $eventType == 'charge.succeeded'
In the webhookController (second item) sould always return $eventType prefixed by the name of the object in this case : charge followed by status.
The other controller orderSuccess, the JSON come from a callback of Stripe Elements JS and the $eventType = $eventCharge->status;
(it's obviously a bad idea to have the same variable name for two different things) As you mention in your json, status = "success". In this controller, the status is never prefixed by "charge."
I remember the right fix is commit here 6ee73a4
Your suggestion work obviously but the OR condition is not mandatory to fix your issue.
I hope my answer is more clear. Do not hesitate if you want more explanation.
from stripe_official.
2.4.5-RC1 released here and can be downloaded to test.
Thank you.
from stripe_official.
Related Issues (20)
- bancontact error payment intent capture only automatic HOT 5
- Display of Credit card form is too narrow, Mastercard icon is not sharp HOT 5
- Uninstall doesn't fully remove the module and causes conflicts with other stripe modules HOT 2
- 🚀 Release 2.4.6
- Customer selected Carrier/Shipping option is removed on order creation and replaced with $0 shipping method. HOT 9
- Orders Uncaptured and no Order ID HOT 12
- BUG : Refund not working HOT 1
- 🚀 Release 2.5.0
- Orders with Uncaptured status HOT 4
- Exception in webhook HOT 2
- Successful Orders redirecting to order history instead of confirmation page HOT 7
- Webhook dont get dispute HOT 2
- ps_stripe_official_processlogger become huge HOT 6
- Hi I cant pay by stripe with testdata HOT 6
- Deprecation notice in webhook HOT 3
- Webhook configuration cannot be found in PrestaShop, click on save button to fix issue. HOT 3
- Upgrading from 2.4.6 to 2.5.0 - module cause an error and was deactivated HOT 4
- Stripe iDeal webhook error 400 charge.succeeded HOT 2
- PHP Fatal error: Uncaught Error: Call to a member function getModuleLink() HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stripe_official.