public Task <ExecuteConsumerLoanFulfillmentArrangementRepaymentResponse> ExecuteConsumerLoanFulfillmentArrangementRepaymentUpdateAsync(string cr_reference_id, string bq_reference_id, ExecuteConsumerLoanFulfillmentArrangementRepaymentRequest body = null) { return(SetRepaymentFields(cr_reference_id, body)); }
private Task <ExecuteConsumerLoanFulfillmentArrangementRepaymentResponse> SetRepaymentFields(string cr_reference_id, ExecuteConsumerLoanFulfillmentArrangementRepaymentRequest body) { return(Task.Run(() => { if (body == null) { return new ExecuteConsumerLoanFulfillmentArrangementRepaymentResponse(); } var loan = PrepareLoanForExecution(cr_reference_id, body, "", "msfsi_lastpaymentamount"); if (body.LoanOutstandingBalance != null) { loan.Attributes["msfsi_outstandingtotalamount"] = body.LoanOutstandingBalance; } if (string.IsNullOrEmpty(body.LoanApplicableRate) == false) { loan.Attributes["msfsi_interestrate"] = ParsePercentage(body.LoanApplicableRate, "LoanApplicableRate"); } _cdsWebApi.Update("msfsi_financialproducts", loan); return new ExecuteConsumerLoanFulfillmentArrangementRepaymentResponse() { Amount = body.Amount, Currency = body.Currency, CustomerReference = body.CustomerReference, LoanApplicableRate = body.LoanApplicableRate, LoanOutstandingBalance = body.LoanOutstandingBalance, PayerBankReference = body.PayerBankReference, PayerProductInstanceReference = body.PayerProductInstanceReference, PayerReference = body.PayerReference, PaymentType = body.PaymentType, StagedRepaymentStatement = body.StagedRepaymentStatement, ValueDate = body.ValueDate }; })); }