public async Task <IPaymentCallback> SetAsync(IPaymentCallback paymentCallback) { var entity = PaymentCallbackEntity.ByMerchant.Create(paymentCallback); await _tableStorage.InsertOrMergeAsync(entity); return(Mapper.Map <PaymentCallback>(entity)); }
public static PaymentCallbackEntity Create(IPaymentCallback src) { return(new PaymentCallbackEntity { MerchantId = src.MerchantId, PaymentRequestId = src.PaymentRequestId, Url = src.Url, PartitionKey = GeneratePartitionKey(src.MerchantId), RowKey = GenerateRowKey(src.PaymentRequestId) }); }
public async Task <IActionResult> GetPaymentCallback(string merchantId, string paymentRequestId) { try { IPaymentCallback callback = await _callbackService.GetPaymentRequestCallback(merchantId, paymentRequestId); if (callback == null) { return(NotFound(ErrorResponse.Create("Callback information not found"))); } return(Ok(Mapper.Map <PaymentCallbackResponse>(callback))); } catch (Exception ex) { _log.Error(ex, null, new { merchantId, paymentRequestId }.ToJson()); } return(StatusCode((int)HttpStatusCode.InternalServerError)); }