issue with message template - OrderPaid.CustomerNotification

2 months ago
hi guys
i created payment method and every think till now ok
after payment sucess i call this line to mark order as paid  
_orderProcessingService.MarkOrderAsPaidAsync(order);
and its do it
Payment status:Paid
now i active  message template - OrderPaid.CustomerNotification
but it's not working.
before think that i have issue with email account it's working good
and i got message in case
OrderCancelled.CustomerNotification
and
OrderPlaced.CustomerNotification
how i can solve it
thx
2 months ago
First,
Check to see if  the message is in the MessageQueue.
Check the System > Log for any errors.

Set a breakpoint in the OrderProcessingService.cs at method
  protected virtual async Task ProcessOrderPaidAsync(Order order)
See if gets there, and step through code.
2 months ago
after debug
process stopped here
MessageTokenProvider.cs

protected virtual async Task<string> RouteUrlAsync(int storeId = 0, string routeName = null, object routeValues = null)
//generate the relative URL
            var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext);

no log error.
what is missing in my payment plugin?


2 months ago
Please check if you have configured store url correctly, see if there is any warning system=>warnings page (/Admin/Common/Warnings)?
2 months ago
RE: "after debug / process stopped here"
Please clarify "stopped here".
2 months ago
OrderPlaced.CustomerNotification -> added into Message queue
but
OrderPaid.CustomerNotification -> not
and
OrderCompleted.CustomerNotification -> not

and emails not send from Message queue
but if i'm test send testing mail,it's send normal

2 months ago
fail in this
File : MessageTokenProvider.cs
Function : protected virtual async Task<string> RouteUrlAsync(int storeId = 0, string routeName = null, object routeValues = null)
Line : var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext);
            
2 months ago
elkashef wrote:

OrderPaid.CustomerNotification -> not and  OrderCompleted.CustomerNotification -> not


How are you setting the Order statuses to Paid and Complete ?
If you manually setting the status in the control panel it will not send emails
You need to use the checkout flow for the messages to send
Or use the Mark as Paid button
(unless you are manully use the fucntions in the code)
1 month ago
elkashef wrote:
fail in this
File : MessageTokenProvider.cs
Function : protected virtual async Task<string> RouteUrlAsync(int storeId = 0, string routeName = null, object routeValues = null)
Line : var urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext);


What nopCommerce version?
The method RouteUrlAsync() has changed several times, see #3192 and #3946 for details.
1 month ago
version 4.60.5