Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Morten Skjoldager 440 posts 1499 karma points
    Nov 12, 2012 @ 10:51
    Morten Skjoldager
    0

    Dealing with payments

    Hello. 

    So i've got this problem. Whenever i go to payment window i use:

     

    Money money = new Money(basket.OrderTotal.Value, Currency.FirstOrDefault(x => x.ISOCode == "DKK"));
    PaymentRequest request = new PaymentRequest(basket, selectedPaymentMethod, money);
    
    selectedPaymentMethod.GetPaymentMethodService().RequestPayment(request);

     

    This would create a new payment object every time i go to the window. In the case that a customer hits the back button in the browser, and click pay again, multiple payments for the basket is created.

    How would i deal with this? 

    I guess i could just:

    basket.ClearPayments();

    Order would it be better to get the payement associated with the basket and use that?

    if (basket.Payments.Any())
    {
      Payment payment = basket.Payments.First(); 
    }

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 13, 2012 @ 16:05
    Søren Spelling Lund
    0

    If you use the API that's what happens. uCommerce clears the existing payment with the same payment method and creates a new one with an all-new refernece id to avoid collisions on the remote end.

Please Sign in or register to post replies

Write your reply to:

Draft