public static LeagueBillingHistory GetReceiptsForLeague(Guid leagueId) { LeagueBillingHistory history = new LeagueBillingHistory(); history.LeagueId = leagueId; var league = League.LeagueFactory.GetLeague(leagueId); history.LeagueName = league.Name; try { PaymentGateway pg = new PaymentGateway(); var invoices = pg.GetAllInvoiceSubscriptionsForLeague(leagueId); foreach (var invoice in invoices) { LeagueReceipt re = new LeagueReceipt(); re.InvoiceId = invoice.InvoiceId; re.LeagueId = invoice.Subscription.InternalObject; re.Expires = invoice.Subscription.ValidUntil; re.AmountPaid = invoice.Subscription.Price; re.EmailForReceipt = league.Email; re.Status = invoice.InvoiceStatus; history.Receipts.Add(re); } } catch (Exception exception) { ErrorDatabaseManager.AddException(exception, exception.GetType()); } return history; }
public static LeagueReceipt GetReceiptForInvoice(Guid invoiceId) { LeagueReceipt re = new LeagueReceipt(); try { PaymentGateway pg = new PaymentGateway(); var invoice = pg.GetDisplayInvoice(invoiceId); re.InvoiceId = invoice.InvoiceId; re.LeagueId = invoice.Subscription.InternalObject; var league = League.LeagueFactory.GetLeague(re.LeagueId); re.LeagueName = league.Name; re.Expires = invoice.Subscription.ValidUntil; re.MembershipStatus = CurrentStatusOfBillingEnum.League_Membership; re.AmountPaid = invoice.Subscription.Price; re.EmailForReceipt = league.Email; re.Status = invoice.InvoiceStatus; } catch (Exception exception) { ErrorDatabaseManager.AddException(exception, exception.GetType()); } return re; }
public ActionResult LeagueReceipt(string invoiceId) { RDN.Library.Classes.Billing.Classes.LeagueReceipt receipt = new LeagueReceipt(); try { receipt = RDN.Library.Classes.Billing.Classes.LeagueReceipt.GetReceiptForInvoice(new Guid(invoiceId)); } catch (Exception exception) { ErrorDatabaseManager.AddException(exception, exception.GetType()); } return View(receipt); }