private async Task DeleteTriggeredPayment() { try { var deleteRequest = new DeletePaymentRequest { ClientId = ClientId }; var deleteResponse = await Client.DeletePaymentAsync(deleteRequest); Assert.AreEqual(true, deleteResponse.Successful); } catch { LogMessages(); throw; } }
public async Task<DeletePaymentResponse> DeletePaymentAsync(DeletePaymentRequest request) { var requestMessage = new PeriodicRequestMessage(); var periodicItem = requestMessage.Periodic.PeriodicList.PeriodicItem; periodicItem.ActionType = "delete"; periodicItem.ClientId = request.ClientId; var responseMessage = await PostAsync<PeriodicRequestMessage, PeriodicResponseMessage>(requestMessage); periodicItem = responseMessage.Periodic.PeriodicList.PeriodicItem; var response = new DeletePaymentResponse { Successful = periodicItem.Successful == "yes", ResponseCode = periodicItem.ResponseCode, ResponseText = periodicItem.ResponseText, }; return response; }
public async Task <DeletePaymentResponse> DeletePaymentAsync(DeletePaymentRequest request) { var requestMessage = new PeriodicRequestMessage(); var periodicItem = requestMessage.Periodic.PeriodicList.PeriodicItem; periodicItem.ActionType = "delete"; periodicItem.ClientId = request.ClientId; var responseMessage = await PostAsync <PeriodicRequestMessage, PeriodicResponseMessage>(requestMessage); periodicItem = responseMessage.Periodic.PeriodicList.PeriodicItem; var response = new DeletePaymentResponse { Successful = periodicItem.Successful == "yes", ResponseCode = periodicItem.ResponseCode, ResponseText = periodicItem.ResponseText, }; return(response); }
public CommunicationResponse DeletePayment([FromBody] DeletePaymentRequest paymentRequest) { var response = new CommunicationResponse(); try { if (_userService.AuthenticateSession(Request.Headers["Authorization"].ToString()) == false) { response.AddError("The authorization credentails were invalid", ErrorCode.SESSION_INVALID); return(response); } var rowUpdated = _billRepository.DeletePayment(paymentRequest.PaymentId); if (rowUpdated == false) { response.AddError($"Cannot delete the payment (ID: {paymentRequest.PaymentId}) because it does not exist"); return(response); } response.Notifications = new List <string> { $"The payment (ID: {paymentRequest.PaymentId}) has been deleted" }; } catch (ErrorCodeException exception) { response.AddError($"An unexpected exception occured: {exception}", paymentRequest, exception.Code); } catch (Exception exception) { response.AddError($"An unexpected exception occured: {exception}", paymentRequest); } return(response); }
private async Task DeleteTriggeredPayment() { try { var deleteRequest = new DeletePaymentRequest {ClientId = ClientId}; var deleteResponse = await Client.DeletePaymentAsync(deleteRequest); Assert.AreEqual(true, deleteResponse.Successful); } catch { LogMessages(); throw; } }
/// <remarks/> public void DeletePaymentAsync(DeletePaymentRequest DeletePaymentRequest, object userState) { if ((this.DeletePaymentOperationCompleted == null)) { this.DeletePaymentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeletePaymentOperationCompleted); } this.InvokeAsync("DeletePayment", new object[] { DeletePaymentRequest}, this.DeletePaymentOperationCompleted, userState); }
/// <remarks/> public void DeletePaymentAsync(DeletePaymentRequest DeletePaymentRequest) { this.DeletePaymentAsync(DeletePaymentRequest, null); }