Beispiel #1
0
        public static BaseBalanceDto GetBalanceDto(BalanceRequestDto parameters)
        {
            BaseBalanceDto dto;

            if (parameters.ProcessType.Equals(ProcessTypeConst.CancelCreditShell))
            {
                dto = GetRefundOriginalPaymentDto(parameters);
            }
            else if (parameters.ProcessType.Equals(ProcessTypeConst.AgencyCancelAndAddPayment))
            {
                dto = GetAgencyPaymentDto(parameters);
            }
            else if (parameters.ProcessType.Equals(ProcessTypeConst.CreateVoluntary))
            {
                dto = GetVoluntaryCreditShellPaymentDto(parameters);
            }
            else if (parameters.ProcessType.Equals(ProcessTypeConst.PROCLI))
            {
                dto = GetProcliCreditShellPaymentDto(parameters);
            }
            else
            {
                throw new NotImplementedException($"Process type builder not implemented: {parameters.ProcessType}.");
            }

            return(dto);
        }
Beispiel #2
0
 private static RefundOriginalPaymentDto GetRefundOriginalPaymentDto(BalanceRequestDto parameters)
 {
     return(new RefundOriginalPaymentDto()
     {
         Signature = parameters.Signature,
         Booking = parameters.Booking,
         AmountToRefund = parameters.Amount
     });
 }
Beispiel #3
0
 private static AgencyPaymentDto GetAgencyPaymentDto(BalanceRequestDto parameters)
 {
     return(new AgencyPaymentDto()
     {
         Signature = parameters.Signature,
         BalanceDue = parameters.Amount,
         AccountNumber = parameters.Booking.SourcePOS.OrganizationCode,
         CurrencyCode = parameters.RefundCurrencyCode
     });
 }
Beispiel #4
0
 private static CreditShellPaymentDto GetProcliCreditShellPaymentDto(BalanceRequestDto parameters)
 {
     return(new CreditShellPaymentDto()
     {
         Signature = parameters.Signature,
         BalanceDue = parameters.Amount,
         BookingCurrencyCode = parameters.RefundCurrencyCode,
         RefundType = parameters.RefundType,
         RefundValue = parameters.RefundValue,
         RefundCurrencyCode = parameters.RefundCurrencyCode,
         AccountTransactionCode = AccountTransactionCodeConst.CreditShellProcli,
         IncrementAccountTransactionCode = AccountTransactionCodeConst.CreditShellIncrement
     });
 }
Beispiel #5
0
 public decimal DoBalance(BalanceRequestDto parameters)
 {
     return(BalanceStrategy.Balance(BalanceBuilder.GetBalanceDto(parameters)));
 }