コード例 #1
0
        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);
             * }*/
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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);

            }
        }
コード例 #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)));
 }
コード例 #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)));
 }
コード例 #6
0
        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);
            }*/
        }
コード例 #7
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));
 }
コード例 #8
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));
 }
コード例 #9
0
 public static Payment AddCreditCard(this Client customer, string PaymentToken ,PaymillHelper ph)
 {
     return ph.CreateCreditCard(customer, PaymentToken);
 }
コード例 #10
0
 public static Payment AddCreditCard(this Client customer, string PaymentToken, PaymillHelper ph)
 {
     return(ph.CreateCreditCard(customer, PaymentToken));
 }