Пример #1
0
        public ActionResult paymentData(int clientID, int flightID, decimal sum, string cardNumber)
        {
            Client  client  = new Client(clientID);
            Flight  flight  = new Flight(flightID);
            Payment payment = new Payment(-1, DateTime.Now, cardNumber, sum, flight, client);
            bool    status  = PaymentAPI.paymentData(payment);

            if (status)
            {
                Payment.insertPayment(payment);
                return(RedirectToAction("SelectedFlight", "Flight", new { id = payment.Flight.ID }));
            }
            else
            {
                return(View(payment));
            }
        }
Пример #2
0
 public void PaymentApi_CreateOrder()
 {
     PaymentAPI           api = new PaymentAPI(BaseUrl, apiToken, apiKey);
     CreatePaymentRequest req = new CreatePaymentRequest()
     {
         DelayCapture      = false,
         InstallmentCount  = 1,
         FundingInstrument = new FundingInstrumentCreditCard()
         {
             CreditCard = new CreditCardAddCreditCardRequest()
             {
                 Id              = "",
                 Cvc             = 546,
                 ExpirationMonth = 9,
                 ExpirationYear  = 2018,
                 Holder          = new HolderDto()
                 {
                     Birthdate = DateTime.Now.AddYears(-25),
                     Fullname  = "TESTE MOIP NET",
                     Phone     = new PhoneDto()
                     {
                         AreaCode    = 11,
                         CountryCode = 55,
                         Number      = 98985959
                     },
                     TaxDocument = new DocumentDto()
                     {
                         Number = "95672830013",
                         Type   = DocumentType.CPF
                     }
                 },
                 Number = "4556832098622729"
             }
         }
     };
     var retorno = api.CreatePayment("ORD-BPFPJW5O5QK5", req);
 }