Inheritance: BaseModel
コード例 #1
0
ファイル: TestClients.cs プロジェクト: paymill/paymill-net
 private void ValidateClient(Client client)
 {
     Assert.IsNotNull(client);
     Assert.IsFalse(String.IsNullOrWhiteSpace(client.Id));
     Assert.IsNotNull(client.CreatedAt);
     Assert.IsNotNull(client.UpdatedAt);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: jcantos/paymillwrappernet
        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();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: jcantos/paymillwrappernet
        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();
        }
コード例 #6
0
 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;
 }
コード例 #7
0
 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;
 }
コード例 #8
0
 public Payment CreateCreditCard(Client customer, string PaymentToken)
 {
     Payment payment = paymentService.Create(PaymentToken, customer.Id);
     return payment;
 }
コード例 #9
0
 public Client UpdateCustomer(Client customer)
 {
     Client updatedClient = clientService.Update(customer);
     return updatedClient;
 }
コード例 #10
0
 public bool DeleteCustomer(Client customer)
 {
     bool response = clientService.Remove(customer.Id);
     return response;
 }
コード例 #11
0
 static internal void ValidatesClient(Client client)
 {
     if (client == null || String.IsNullOrWhiteSpace(client.Id))
         throw new ArgumentException("Client or its  Id can not be blank");
 }
コード例 #12
0
ファイル: Subscription.cs プロジェクト: paymill/paymill-net
 public Creator WithClient(Client client)
 {
     this.Client = client;
     return this;
 }