예제 #1
0
        public IActionResult OnPost()
        {
            var client = new Client(ShopId, SecretKey);
            var id     = PaymentStorage.GetNextId();

            var url      = Request.GetUri();
            var redirect = $"{url.Scheme}://{url.Authority}/ConfirmSync?id={id}";

            var data = client.CreatePayment(
                new NewPayment()
            {
                Amount = new Amount()
                {
                    Value = Amount,
                },
                Confirmation = new Confirmation()
                {
                    Type      = ConfirmationType.Redirect,
                    ReturnUrl = redirect
                },
                Description = "Order"
            });

            PaymentStorage.Payments[id] = new QueryData()
            {
                Client = client, Payment = data
            };

            return(Redirect(data.Confirmation.ConfirmationUrl));
        }
 public void Initialize()
 {
     this.paymentStorage = new PaymentStorage(NullLoggerFactory.Instance);
 }
예제 #3
0
 public PaymentTypeController()
 {
     _storage = new PaymentStorage();
 }
예제 #4
0
 public PaymentsController(PaymentStorage paymentStorage)
 {
     this.paymentStorage = paymentStorage;
 }