public void UpdateDirectDebit()
 {
     using (var client = CreateClient())
     {
         var debit = CreateDirectDebit(client);
         const int newAmount = 2 * PaymentClientTest.AMOUNT;
         var update = new MoneyInDirectDebitRequest { Amount = newAmount };
         var updated = client.UpdateDirectDebit(debit.Id, update, UserId);
         Assert.IsNotNull(updated);
         Assert.AreEqual(debit.Id, updated.Id);
         Assert.AreEqual(newAmount, updated.Amount);
     }
 }
Beispiel #2
0
 public void UpdateDirectDebit()
 {
     using (var client = CreateClient())
     {
         var       debit     = CreateDirectDebit(client);
         const int newAmount = 2 * PaymentClientTest.AMOUNT;
         var       update    = new MoneyInDirectDebitRequest {
             Amount = newAmount
         };
         var updated = client.UpdateDirectDebit(debit.Id, update, UserId);
         Assert.IsNotNull(updated);
         Assert.AreEqual(debit.Id, updated.Id);
         Assert.AreEqual(newAmount, updated.Amount);
     }
 }
Beispiel #3
0
        private MoneyInDirectDebitResponse CreateDirectDebit(APIClient client)
        {
            var mandate     = CreateMandate(client);
            var directdebit = new MoneyInDirectDebitRequest
            {
                Mandate = new MandateRef {
                    Id = mandate.Id
                },
                OrderId = "DirectDebit-" + TimedId,
                Amount  = PaymentClientTest.AMOUNT,
                Fee     = 0,
                IsMine  = true,
                Message = "Test RequestDirectDebit"
            };
            var response = client.PostDirectDebit(directdebit, UserId);

            Assert.IsNotNull(response);
            Assert.AreEqual(PaymentStatus.Pending, response.Status);
            return(response);
        }
 public MoneyInDirectDebitResponse UpdateDirectDebit(long id, MoneyInDirectDebitRequest update, string userId = null)
 {
     var uri = CreateUri(userId, directdebits);
     return PutAsync<MoneyInDirectDebitRequest, MoneyInDirectDebitResponse>(uri + id, update);
 }
 public MoneyInDirectDebitResponse PostDirectDebit(MoneyInDirectDebitRequest directdebit, string userId = null)
 {
     var uri = CreateUri(userId, directdebits);
     return PostAsync<MoneyInDirectDebitRequest, MoneyInDirectDebitResponse>(uri, directdebit);
 }
Beispiel #6
0
        public MoneyInDirectDebitResponse UpdateDirectDebit(long id, MoneyInDirectDebitRequest update, string userId = null)
        {
            var uri = CreateUri(userId, directdebits);

            return(PutAsync <MoneyInDirectDebitRequest, MoneyInDirectDebitResponse>(uri + id, update));
        }
Beispiel #7
0
        public MoneyInDirectDebitResponse PostDirectDebit(MoneyInDirectDebitRequest directdebit, string userId = null)
        {
            var uri = CreateUri(userId, directdebits);

            return(PostAsync <MoneyInDirectDebitRequest, MoneyInDirectDebitResponse>(uri, directdebit));
        }
        private MoneyInDirectDebitResponse CreateDirectDebit(APIClient client)
        {
            var mandate = CreateMandate(client);
            var directdebit = new MoneyInDirectDebitRequest
                              {
                                  Mandate = new MandateRef { Id = mandate.Id },
                                  OrderId = "DirectDebit-" + TimedId,
                                  Amount = PaymentClientTest.AMOUNT,
                                  Fee = 0,
                                  IsMine = true,
                                  Message = "Test RequestDirectDebit"
                              };
            var response = client.PostDirectDebit(directdebit, UserId);

            Assert.IsNotNull(response);
            Assert.AreEqual(PaymentStatus.Pending, response.Status);
            return response;
        }