static void Main(string[] args)
        {
            /*Paymill.ApiKey = "0e63b44b07fc9bfca24003be5da3d93e";
             * Paymill.ApiUrl = "https://api.paymill.com/v2";
             *
             *
             * TransactionService transactionService = Paymill.GetService<TransactionService>();
             *
             * List<Transaction> lstTransactions = transactionService.GetTransactions();
             */

            PaymillHelper payment = new PaymillHelper("https://api.paymill.com/v2", "0e63b44b07fc9bfca24003be5da3d93e");

            var client = payment.CreateCustomer(RandomString(10) + "@yopmail.com", "testCustomer");

            client.AddCreditCard("tok_7434d9cde1277ff96635", payment);
            client = payment.getCustomers().FirstOrDefault();
            client.Pay(payment, 1);
            client.Withdraw(payment, 3);
            payment.DeleteCreditCard(client.Payment.FirstOrDefault().Id);

            /*
             * foreach (Client c in payment.getCustomers())
             * {
             *  payment.DeleteCustomer(c);
             * }*/
        }
 private static void createCustomers(int nb, PaymillHelper ph)
 {
     for (int i = 0; i < 10; i++)
     {
         var client = ph.CreateCustomer(RandomString(10) + "@yopmail.com", "testCustomer" + i);
     }
 }
        private static void createCustomers(int nb, PaymillHelper ph)
        {
            for (int i = 0; i < 10; i++)
            {
                var client = ph.CreateCustomer(RandomString(10)+ "@yopmail.com", "testCustomer" + i);

            }
        }
Exemple #4
0
 public static Refund Withdraw(this Client customer, PaymillHelper ph, double amount, Payment creditCard = null)
 {
     if (creditCard == null)
     {
         creditCard = customer.Payment.FirstOrDefault();
     }
     return(ph.CreateRefund(customer, creditCard, PaymillHelper.DoubleToPaymillPrice(amount)));
 }
Exemple #5
0
 public static Transaction Pay(this Client customer, PaymillHelper ph, double amount, Payment creditCard = null)
 {
     if (creditCard == null)
     {
         creditCard = customer.Payment.FirstOrDefault();
     }
     return(ph.CreateTransaction(customer, creditCard, PaymillHelper.DoubleToPaymillPrice(amount)));
 }
        static void Main(string[] args)
        {
            /*Paymill.ApiKey = "0e63b44b07fc9bfca24003be5da3d93e";
            Paymill.ApiUrl = "https://api.paymill.com/v2";

            TransactionService transactionService = Paymill.GetService<TransactionService>();

            List<Transaction> lstTransactions = transactionService.GetTransactions();
            */

            PaymillHelper payment = new PaymillHelper("https://api.paymill.com/v2", "0e63b44b07fc9bfca24003be5da3d93e");

            var client = payment.CreateCustomer(RandomString(10) + "@yopmail.com", "testCustomer");
            client.AddCreditCard("tok_7434d9cde1277ff96635", payment);
            client = payment.getCustomers().FirstOrDefault();
            client.Pay(payment, 1);
            client.Withdraw(payment, 3);
            payment.DeleteCreditCard(client.Payment.FirstOrDefault().Id);
            /*
            foreach (Client c in payment.getCustomers())
            {
                payment.DeleteCustomer(c);
            }*/
        }
 public static Refund Withdraw(this Client customer, PaymillHelper ph, double amount, Payment creditCard = null)
 {
     if (creditCard == null)
         creditCard = customer.Payment.FirstOrDefault();
     return ph.CreateRefund(customer, creditCard, PaymillHelper.DoubleToPaymillPrice(amount));
 }
 public static Transaction Pay(this Client customer, PaymillHelper ph, double amount, Payment creditCard = null)
 {
     if (creditCard == null)
         creditCard = customer.Payment.FirstOrDefault();
     return ph.CreateTransaction(customer, creditCard, PaymillHelper.DoubleToPaymillPrice(amount));
 }
 public static Payment AddCreditCard(this Client customer, string PaymentToken ,PaymillHelper ph)
 {
     return ph.CreateCreditCard(customer, PaymentToken);
 }
Exemple #10
0
 public static Payment AddCreditCard(this Client customer, string PaymentToken, PaymillHelper ph)
 {
     return(ph.CreateCreditCard(customer, PaymentToken));
 }