Beispiel #1
0
        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;
 }
Beispiel #3
0
        private void onPostCFCDonation(PostCFCDonationOperation operation, HttpResponse httpResponse)
        {
            DonationResult responseBody = operation.ResponseBody;

            Service.Get <EventDispatcher>().DispatchEvent(new ScheduledEventServiceEvents.CFCDonationPosted(responseBody));
        }