Giter Club home page Giter Club logo

Comments (7)

clotairer avatar clotairer commented on August 17, 2024 1

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.

ello10 avatar ello10 commented on August 17, 2024 1

I got it, indeed I was troubled by the same naming of things. Thank you.

from stripe_official.

ello10 avatar ello10 commented on August 17, 2024

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.

clotairer avatar clotairer commented on August 17, 2024

@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.

ello10 avatar ello10 commented on August 17, 2024

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.

clotairer avatar clotairer commented on August 17, 2024

@ello10

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.

clotairer avatar clotairer commented on August 17, 2024

2.4.5-RC1 released here and can be downloaded to test.

Thank you.

from stripe_official.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.