public async Task <ActionResult <Response> > Confirm([FromBody] RefahConfirmationContext res) { return(Ok(await _mediator.Send(new ConfirmOrderPaymentCommand { context = res, PaymentStrategy = PaymentProviders.Refah }))); }
public async Task <IActionResult> PostConfirm([FromForm] RefahConfirmationContext context) { var order = _dbContext.Orders .FirstOrDefault(x => x.Id == context.OrderId); if (order is null) { return(BadRequest("این مورد وجود ندارد")); } var paymentProvider = _orderPaymentProviderFactory.GetProvider(PaymentProviders.Refah); var paymentSuccess = paymentProvider.Confirm(context, order.TotalPriceSofre); if (paymentSuccess.Status == ResponseStatus.Success) { order.PaymentStatus = PaymentStatus.Paid; order.PaymentId = context.ResNum.ToString(); _dbContext.Orders.Update(order); _dbContext.SaveChanges(); } return(View("RedirectToAndroidApp", context)); }
public async Task <ActionResult <OrderPayRequestResponse> > PaymentComplete([FromForm] RefahConfirmationContext res) { //redirect to client with querystring return(RedirectToAction("PaymentConfirm", res)); }
public async Task <ActionResult <OrderPayRequestResponse> > PaymentCompleteAndroid([FromForm] RefahConfirmationContext res) { //redirect to client with querystring return(Redirect($"zanis://confirm?resNum={res.ResNum}&state={res.State}&stateCode={res.StateCode}&refNum={res.ResNum}")); }