Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there
Am loving Tea Commerce package.
I am setting up a site with no payment provider, simply purchases "on account".
I need to trigger an event when an order is completed and so have the following code:
public class events : ITeaCommerceExtension{ public void Initialize() { WebshopEvents.PaymentStatusChanged += WebshopEvents_PaymentStatusChanged; } protected void WebshopEvents_PaymentStatusChanged(Order order, PaymentStatus? paymentStatus, APIInfo apiInfo) { if (paymentStatus.HasValue && order.PaymentStatus.Value.ToString() == "Authorized") { generateXMLFileofOrder(order); } } protected void generateXMLFileofOrder(Order order) { ... do stuff here ... }}
The problem I have is that I can output a value for order.PaymentStatus.Value.ToString(), however when checking in the if statement above it fails.
Can anyone enlighten as to how to check when the order is authorized.
Ideally I also want to check the order status too as I only want to run the event once per order.
Thanks, Nigel
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Trouble Triggering Event on PaymentStatusChanged
Hi there
Am loving Tea Commerce package.
I am setting up a site with no payment provider, simply purchases "on account".
I need to trigger an event when an order is completed and so have the following code:
The problem I have is that I can output a value for order.PaymentStatus.Value.ToString(), however when checking in the if statement above it fails.
Can anyone enlighten as to how to check when the order is authorized.
Ideally I also want to check the order status too as I only want to run the event once per order.
Thanks, Nigel
is working on a reply...