concretecms-community-store / community_store_mollie

Adds the Mollie payment gateway to Community Store
MIT License
0 stars 3 forks source link

Payment status in e-mail #9

Closed Mesign closed 4 years ago

Mesign commented 4 years ago

@wardhache When making a successful (test)payment I receive an email with the order information. On both e-mails (1 for customer and 1 for administrator) it say's "payment status: unpaid" (translated from dutch) while the status has to be "paid".

I tested the other options (payment status from mollie iDeal): open, payed, failed, cancelled, expired. I don't know of some of the actions are how they should be, or maybe are different in the live version. Open = Goto complete page, receive e-mail with payment status unpaid, status in dashboard "unpaid" Payed = Goto complete page = Ok, except payment status in e-mail should be "paid' Failed = Goto complete page (page is refreshing, keeps checking) looks like order is placed but no e-mail or order in dashboard. Cancelled = Go back to Cart = OK Expired = Mollie message that payment is expired = OK

wardhache commented 4 years ago

I think this just has to de with the webhook of Mollie being called to update the payment status, but the e-mail has been sent before the response of the webhook is saved.

You did not experience any further issues so far? Or were you able to make it work in the meantime?

Mesign commented 4 years ago

The website are still in production (client adding products), and I do not work on these projects until the are ready to go live. So I don't have any other issues so far. I'm no programmer so I don't know how/where to fix it. I will wait when they are ready going live and post results / look into the code.

Mesign commented 4 years ago

@wardhache It has been a while, but the website is live. The payment status in the e-mail (to customer and to the webshop holder) is set to 'unpaid' while being 'paid' (tested it myself). In the concrete5 orders it is set to 'paid', so it seems that the problem only lies within the send e-mails.

Any Idea how to fix this?

Mesign commented 4 years ago

Hi @wardhache, do you any spare time to look into this? Also asking @Mesuva. Do you have any idea what's happening and how to solve this?

Mesuva commented 4 years ago

@Mesign I believe it's these two lines here: https://github.com/concrete5-community-store/community_store_mollie/blob/master/src/CommunityStore/Payment/Methods/Mollie/MolliePaymentMethod.php#L99 Line 100 should be above line 99, so it happens before the receipt emailing (which happens in completeOrder() )

Mesign commented 4 years ago

@Mesuva Thanks, tested it and it works!

Mesuva commented 4 years ago

Cool, I've updated the MolliePaymentMethod.php file to reflect this.