public void authorizeWithTokenTest()
 {
     ECommerceClient client = new ECommerceClient(CARD_ACCEPTOR, SHARED_SECRET, TEST_ENVIRONMENT);
     Authorization authorization = client.authorizeWithToken(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, getToken(client).TokenName);
     Assert.IsNotNull(authorization.AuthorizationGuid);
     Assert.IsNotNull(authorization.ApprovalCode);
 }
 public void authorizeTest()
 {
     ECommerceClient client = new ECommerceClient(CARD_ACCEPTOR, SHARED_SECRET, TEST_ENVIRONMENT);
     Authorization authorization = client.authorize(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, VISA_TEST_CARD, EXPIRY_DATE_DECEMBER_2015);
     Assert.IsNotNull(authorization.AuthorizationGuid);
     Assert.IsNotNull(authorization.ApprovalCode);
 }
 private Token getToken(ECommerceClient client)
 {
     Token token = null;
     try
     {
         token = client.getToken(TEST_TOKEN_01);
     }
     catch (HpServerError e)
     {
         token = client.createToken(TEST_TOKEN_01, VISA_TEST_CARD, EXPIRY_DATE_DECEMBER_2015);
     }
     return token;
 }
        public void reverseRefundTest()
        {
            ECommerceClient client = new ECommerceClient(CARD_ACCEPTOR, SHARED_SECRET, TEST_ENVIRONMENT);
            Refund refund = client.refund(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, VISA_TEST_CARD, EXPIRY_DATE_DECEMBER_2015);
            Reversal reversal = client.reverseRefund(refund.RefundGuid);

            Assert.IsNotNull(reversal.ReversalGuid);
            Assert.AreEqual(refund.RefundGuid, reversal.RefundGuid);
            Assert.IsNotNull(reversal.ApprovalCode);
        }
 public void refundWithTokenTest()
 {
     ECommerceClient client = new ECommerceClient(CARD_ACCEPTOR, SHARED_SECRET, TEST_ENVIRONMENT);
     Refund refund = client.refundWithToken(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, getToken(client).TokenName);
     Assert.IsNotNull(refund.RefundGuid);
     Assert.IsNotNull(refund.ApprovalCode);
 }
        public void paymentWithTokenTest()
        {
            ECommerceClient client = new ECommerceClient(CARD_ACCEPTOR, SHARED_SECRET, TEST_ENVIRONMENT);
            Payment payment = client.paymentWithToken(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, getToken(client).TokenName);

            Assert.IsNotNull(payment.PaymentGuid);
            Assert.IsNotNull(payment.ApprovalCode);
        }
        public void paymentTest()
        {
            ECommerceClient client = new ECommerceClient(CARD_ACCEPTOR, SHARED_SECRET, TEST_ENVIRONMENT);
            Payment payment = client.payment(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, VISA_TEST_CARD, EXPIRY_DATE_DECEMBER_2015);

            Assert.IsNotNull(payment.PaymentGuid);
            Assert.IsNotNull(payment.ApprovalCode);
        }
 public void cancelRefundTest()
 {
     ECommerceClient client = new ECommerceClient(CARD_ACCEPTOR, SHARED_SECRET, TEST_ENVIRONMENT);
     Refund refund = client.refund(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, VISA_TEST_CARD, EXPIRY_DATE_DECEMBER_2015);
     Assert.IsNotNull(refund.RefundGuid);
     Assert.IsNotNull(refund.ApprovalCode);
     Cancellation cancellation = client.cancelRefund(CURRENCY_ISK, AMOUNT_70_APPROVE_AMOUNT, refund.TerminalDateTime);
     Assert.IsNotNull(cancellation.CancellationGuid);
     Assert.IsNotNull(cancellation.RefundGuid);
     Assert.IsNotNull(cancellation.ApprovalCode);
 }