Inheritance: BaseModel
Exemple #1
0
 private void ValidateClient(Client client)
 {
     Assert.IsNotNull(client);
     Assert.IsFalse(String.IsNullOrWhiteSpace(client.Id));
     Assert.IsNotNull(client.CreatedAt);
     Assert.IsNotNull(client.UpdatedAt);
 }
        public void EncodeClientAdd()
        {
            URLEncoder urlEncoder = new URLEncoder();

            Client c = new Client();
            c.Description = "Prueba";
            c.Email = "*****@*****.**";

            string expected = "email=javicantos22%40hotmail.es&description=Prueba";
            string reply = urlEncoder.Encode<Client>(c);

            Assert.AreEqual(expected, reply);
        }
        public void EncodeClientUpdate()
        {
            URLEncoder urlEncoder = new URLEncoder();

            Client c = new Client();
            c.Description = "Javier";
            c.Email = "*****@*****.**";
            c.Id = "client_bbe895116de80b6141fd";

            string expected = "email=javicantos33%40hotmail.es&description=Javier&id=client_bbe895116de80b6141fd";
            string reply = urlEncoder.Encode<Client>(c);

            Assert.AreEqual(expected, reply);
        }
Exemple #4
0
        static void addClient()
        {
            Paymill.ApiKey = Properties.Settings.Default.ApiKey;
            Paymill.ApiUrl = Properties.Settings.Default.ApiUrl;
            ClientService clientService = Paymill.GetService<ClientService>();

            Client c = new Client();
            c.Description = "Prueba API";
            c.Email = "*****@*****.**";

            Client newClient = clientService.AddClient(c);

            Console.WriteLine("ClientID:" + newClient.Id);
            Console.Read();
        }
Exemple #5
0
        static void updateClient()
        {
            Paymill.ApiKey = Properties.Settings.Default.ApiKey;
            Paymill.ApiUrl = Properties.Settings.Default.ApiUrl;
            ClientService clientService = Paymill.GetService<ClientService>();

            Client c = new Client();
            c.Description = "Javier";
            c.Email = "*****@*****.**";
            c.Id = "client_bbe895116de80b6141fd";

            Client updatedClient = clientService.UpdateClient(c);

            Console.WriteLine("ClientID:" + updatedClient.Id);
            Console.Read();
        }
 public Transaction CreateTransaction(Client customer, Payment creditCard, int amount, string currency = "EUR")
 {
     Transaction createdTransaction = transactionService.Create(
         new Transaction { Payment = creditCard, Client = customer, Amount = amount, Currency = currency}
         , null);
     return createdTransaction;
 }
 public Refund CreateRefund(Client customer, Payment creditCard, int amount)
 {
     Transaction firstTransaction = getTransactions().Where(t => t.Client.Id == customer.Id && t.Payment.Id == creditCard.Id).FirstOrDefault();
     Refund refund = refundService.Create(firstTransaction.Id, amount);
     return refund;
 }
 public Payment CreateCreditCard(Client customer, string PaymentToken)
 {
     Payment payment = paymentService.Create(PaymentToken, customer.Id);
     return payment;
 }
 public Client UpdateCustomer(Client customer)
 {
     Client updatedClient = clientService.Update(customer);
     return updatedClient;
 }
 public bool DeleteCustomer(Client customer)
 {
     bool response = clientService.Remove(customer.Id);
     return response;
 }
 static internal void ValidatesClient(Client client)
 {
     if (client == null || String.IsNullOrWhiteSpace(client.Id))
         throw new ArgumentException("Client or its  Id can not be blank");
 }
Exemple #12
0
 public Creator WithClient(Client client)
 {
     this.Client = client;
     return this;
 }