Notification.Trigger("OrderConfirmation", new PaymentResult(Attempt<IPayment>.Succeed(), invoice, false), new[] { email });
with an invoice instance that I've created using checkoutManager.payment.PrepareInvoice() and InvoiceService.Save(invoice) should I expect a notification to fire if SMTP notifications are enabled and there is a tempalte for Order Confirmation.
If I run this in debug and step over the Trigger line I get:
Unable to cast object of type 'Merchello.Core.Models.MonitorModels.PaymentResultNotifyModel' to type 'Umbraco.Core.Models.IPublishedContent' in IntelliTrace and no e-mail (however the invoice is created and appears in 'sales' in the backoffice).
I'd actually have to step through that one myself to see exactly what you have going on, but my guess is the trigger is expecting a PaymentResult from at least an Authorize attempt - so their would be an instantiation of IPayment representing a the authorization attempt. This payment is passed to the success ...
var paymentAttempt = Attempt.Succeed(payment);
so the speculation is there it can't create PaymentResultNotifyModel because of the null IPayment in the result.
I wondered whether it might be that, but looking at the source code for the Order Confirmation trigger it didn't seem to need/use the payment it was jsut using the Invoice.
though it pains me to admit it took so long to register shortly after posting I realised it was because I had a ViewStart that was setting the layout. If I include Layout = null in the OrderConfirmation template it works e.g. the RazorTemplate process is doing the equivalant of 'View()' not 'PartialView()'
Thanks for your time and effort on this and merchello in general!
Hi all , I hope you can help me , Im using merchello and fasttrack template . Everything is working only sending order notigications is problem SMTP is set up right , and jusť a LEGACY option is working properly when I want to send RAZOR order confirmation , it wont send it :/ why ?
Manually firing OrderConfirmation Trigger / Notification
If I run the following code:
with an invoice instance that I've created using
checkoutManager.payment.PrepareInvoice()
andInvoiceService.Save(invoice
) should I expect a notification to fire if SMTP notifications are enabled and there is a tempalte for Order Confirmation.If I run this in debug and step over the Trigger line I get:
Thanks in advance for any assistance
I'd actually have to step through that one myself to see exactly what you have going on, but my guess is the trigger is expecting a
PaymentResult
from at least an Authorize attempt - so their would be an instantiation ofIPayment
representing a the authorization attempt. This payment is passed to the success ...so the speculation is there it can't create PaymentResultNotifyModel because of the null
IPayment
in the result.I wondered whether it might be that, but looking at the source code for the Order Confirmation trigger it didn't seem to need/use the payment it was jsut using the Invoice.
Hi again Rusty,
Thanks so much for your help so far.
I can get a successful payment attempt, and can debug to the point of 'Merchello.Core.Observation.TriggerBase
I can't quite see where the issue is from that point on, potentially something during the
Umbraco.Web.Mvc.RenderModelBinder.BindModel
areaThe razor template is just the default for OrderConfirmation (and does work if I simply put it in a fast track instance)
This is Merchello 2.3.0 and Umbraco 7. 5.3
Hey Craig,
What is the model designated in your Razor view?
Hi Rusty,
It's just the default template so:
and a firing of:
with a successful IPaymentResult 'attempt'
Hey Craig,
That looks good from the surface - what is being returned from https://github.com/Merchello/Merchello/blob/merchello-dev/src/Merchello.Core/Models/MonitorModels/MonitorModelExtensions.cs#L51
though it pains me to admit it took so long to register shortly after posting I realised it was because I had a ViewStart that was setting the layout. If I include
Layout = null
in the OrderConfirmation template it works e.g. the RazorTemplate process is doing the equivalant of 'View()
' not 'PartialView()
'Thanks for your time and effort on this and merchello in general!
Exact same problem here! Thanks for the pointer.
I've requested the Layout=null as a pull request for OrderConfirmation and OrderShipped razor files to try and help other people avoid this.
Hi all , I hope you can help me , Im using merchello and fasttrack template . Everything is working only sending order notigications is problem SMTP is set up right , and jusť a LEGACY option is working properly when I want to send RAZOR order confirmation , it wont send it :/ why ?
I need some help
I think I answered this here in your other post.
https://our.umbraco.org/projects/collaboration/merchello/merchello/82446-email-template-on-order-received#comment-266210
is working on a reply...