+1-888-365-2779
Try Now
More in this section

Forums / Ecommerce / OrderPlaced and external service

OrderPlaced and external service

2 posts, 1 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Aug 2014
    Link to this post

    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

  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    05 Aug 2014 in reply to Daniel Plomp
    Link to this post

    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

    Answered
2 posts, 1 answered