Пример #1
0
        public void Post(PayRequest request)
        {
            ServicePointManager.ServerCertificateValidationCallback = Callback;
            var openPayments  = GetOpenPayments();
            var usersPayedFor = openPayments.Select(x => x.User.FirstName + " " + x.User.LastName).Aggregate((i, j) => i + ", " + j);

            var division = Db.LoadSingleById <Division>(DivisionId);
            var gateway  = new FordereStripeGateway(division.PrivateStripeKey);

            gateway.Post(new ChargeStripeCustomer()
            {
                Amount      = request.Amount,
                Currency    = Currencies.SwissFranc,
                Description = "Mitgliederbeitrag von " + usersPayedFor,
                Source      = request.Token
            });

            openPayments.ForEach(x =>
            {
                x.HasPaid = true;
                x.Comment = "Kreditkarte";
            });

            Db.UpdateAll(openPayments);
        }
Пример #2
0
        public Task <T> SendAsync <T>(IReturn <T> request)
        {
            string method = FordereStripeGateway.GetMethod <T>(request);

            return(this.SendAsync <T>(request, method, method == "POST" || method == "PUT", (string)null));
        }