Beispiel #1
0
        public JsonPatchDocument <ApiTransactionRequestModel> CreatePatch(ApiTransactionRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiTransactionRequestModel>();

            patch.Replace(x => x.Amount, model.Amount);
            patch.Replace(x => x.GatewayConfirmationNumber, model.GatewayConfirmationNumber);
            patch.Replace(x => x.TransactionStatusId, model.TransactionStatusId);
            return(patch);
        }
Beispiel #2
0
        public virtual ApiTransactionRequestModel MapResponseToRequest(
            ApiTransactionResponseModel response)
        {
            var request = new ApiTransactionRequestModel();

            request.SetProperties(
                response.Amount,
                response.GatewayConfirmationNumber,
                response.TransactionStatusId);
            return(request);
        }
Beispiel #3
0
        public virtual ApiTransactionResponseModel MapRequestToResponse(
            int id,
            ApiTransactionRequestModel request)
        {
            var response = new ApiTransactionResponseModel();

            response.SetProperties(id,
                                   request.Amount,
                                   request.GatewayConfirmationNumber,
                                   request.TransactionStatusId);
            return(response);
        }