SimplCommerce icon indicating copy to clipboard operation
SimplCommerce copied to clipboard

Payment Order Posting Twice

Open christian4423 opened this issue 4 years ago • 1 comments

Hello All,

I am having an issue with the application. I am implementing a cashnet service that uses HTTP Notifications. All is going well except when I call _orderService.CreateOrder(). For some reason my code appears to be calling the service twice even though my client is calling it once (verified via logs).

The method type is POST. I will show it below: This method is for testing right now and more security will be added once I get it working locally.

public async Task<ActionResult> CreatePayment(long fkey)
{
  var cart = await _cartService.GetActiveCartDetailsByCartId(fkey);
  if (cart != null)
  {
       var orderCreateResult = await _orderService.CreateOrder(cart.Id, "Cashnet", CalculatePaymentFee(cart.OrderTotal), OrderStatus.PendingPayment);        
        return Ok((Status: "success", OrderId: orderCreateResult.Value.Id));
   }
   else
   {
        return Ok((Status: "fail", OrderId: -1));
   }
}

When I call this, this is what I get in my dashboard. dashboard For some reason it is creating a pending payment order and then another one with the new status.

Any insight will be helpful.

christian4423 avatar May 25 '21 19:05 christian4423

Check OrderStatus.PendingPayment method.

DimitarPramatarov avatar Jul 03 '21 19:07 DimitarPramatarov