public MpDonationBatch CreateDonationBatch(MpDonationBatch mpDonationBatch) { var token = ApiUserRepository.GetDefaultApiUserToken(); return(MpRestBuilder.NewRequestBuilder() .WithAuthenticationToken(token) .Build() .Create(mpDonationBatch)); }
public void UpdateDonationBatch(MpDonationBatch mpDonationBatch) { var token = ApiUserRepository.GetDefaultApiUserToken(); MpRestBuilder.NewRequestBuilder() .WithAuthenticationToken(token) .Build() .Update(mpDonationBatch); }
public MpDonation Update(MpDonation donation) { var token = ApiUserRepository.GetDefaultApiUserToken(); return(MpRestBuilder.NewRequestBuilder() .WithAuthenticationToken(token) .Build() .Update(donation)); }
public List <MpDeposit> GetDepositNamesByDepositName(string depositName) { var token = ApiUserRepository.GetDefaultApiUserToken(); var filter = $"Deposit_Name LIKE '%{depositName}%'"; var deposits = MpRestBuilder.NewRequestBuilder() .WithAuthenticationToken(token) .WithFilter(filter) .Build() .Search <MpDeposit>(); return(deposits); }
public List <MpDeposit> GetDepositsByTransferIds(List <string> transferIds) { var token = ApiUserRepository.GetDefaultApiUserToken(); var filter = $"Processor_Transfer_ID IN (" + string.Join(',', transferIds) + ")"; var deposits = MpRestBuilder.NewRequestBuilder() .WithAuthenticationToken(token) .WithFilter(filter) .Build() .Search <MpDeposit>(); return(deposits); }
public MpDeposit GetDepositByProcessorTransferId(string processorTransferId) { var token = ApiUserRepository.GetDefaultApiUserToken(); var columns = new string[] { "Deposit_ID" }; var filter = $"Processor_Transfer_ID = '{processorTransferId}'"; var deposits = MpRestBuilder.NewRequestBuilder() .WithAuthenticationToken(token) .WithSelectColumns(columns) .WithFilter(filter) .Build() .Search <MpDeposit>(); return(deposits.FirstOrDefault()); }
public MpDonation GetDonationByTransactionCode(string transactionCode) { var token = ApiUserRepository.GetDefaultApiUserToken(); var filter = $"Transaction_Code = '{transactionCode}'"; var donations = MpRestBuilder.NewRequestBuilder() .WithAuthenticationToken(token) .WithFilter(filter) .Build() .Search <MpDonation>(); if (!donations.Any()) { // TODO possibly refactor to create a more custom exception throw new Exception($"Donation does not exist for transaction code: {transactionCode}"); } return(donations.First()); }