OrderPlaced and external service

Posted by Community Admin on 05-Aug-2018 10:08

OrderPlaced and external service

All Replies

Posted by Community Admin on 05-Aug-2014 00:00

Hi,

I (like to) use the OrderPlaced event to create subscription plans within Stripe and PayPal. I have all the logic ready, but I have some problems to implement this.

When the event is firing I need to check some details using a REST call to Stripe. I think here is the problem, since the OrderPlaced event at that point breaks and I'm unable to finish my custom code.

What should be the right way to implement this?

private void EcommerceEvents_OrderPlaced(Guid orderid)
    ...
    // API Call to Stripe
    var stripeCustomer = customerService.Get(user.Id.ToString());
    // Here the code stops.
    ...

Any ideas?

Best,
Daniel

Posted by Community Admin on 05-Aug-2014 00:00

Alright, this was due to an Exception that was thrown. I expected a result from that call, but it threw an Exception. So with help of a Try/Catch block, I can now act on it.

Daniel

This thread is closed