public async Task <DonationResult> DonateAsync(Institution institution, int amount) { var donationResult = new DonationResult { DonatedAmount = 0, Institution = institution, SelectedAmount = amount }; await Task.Run(async() => { var smsCount = amount / institution.DonationInformation.MinimumDonation; for (var i = 1; i <= smsCount; i++) { await _smsService.SendSmsAsync(institution.DonationInformation.Number, institution.DonationInformation.Message); donationResult.DonatedAmount += institution.DonationInformation.MinimumDonation; } }); return(donationResult); }
public CFCDonationPosted(DonationResult donationResult) { DonationResult = donationResult; }
private void onPostCFCDonation(PostCFCDonationOperation operation, HttpResponse httpResponse) { DonationResult responseBody = operation.ResponseBody; Service.Get <EventDispatcher>().DispatchEvent(new ScheduledEventServiceEvents.CFCDonationPosted(responseBody)); }