示例#1
0
        public void RefundPaymentTest()
        {
            var request = new TransparentRedirectRequest("http://www.eway.com.au", TransactionType.Purchase);

            request = SetupRequest(request) as TransparentRedirectRequest;

            var response = client.ProcessPayment <TransparentRedirectResponse>(request);

            Assert.IsNotNull(response.AccessCode);
            Assert.IsNotNull(response.FormActionURL);
            Assert.IsNull(response.Errors);

            SubmitPaymentForm(response.FormActionURL, response.AccessCode);

            var accessResponse = client.GetAccessCodeResult(response.AccessCode);

            Assert.IsNull(accessResponse.Errors);
            Assert.IsTrue((bool)accessResponse.TransactionStatus);

            var refundClient = new TransactionClient(CredentialUtils.GetTestCredentials(), true);

            var refundRequest = new RefundRequest();

            refundRequest = SetupRequest(refundRequest) as RefundRequest;

            var refundResponse = refundClient.RefundTransaction(refundRequest, accessResponse.TransactionID.ToString());

            Assert.IsNull(refundResponse.Errors);

            var queryResponse = refundClient.QueryTransaction(accessResponse.TransactionID.ToString());

            Assert.AreEqual(1, queryResponse.Transactions.Count);
            Assert.AreEqual(string.Empty, queryResponse.Errors);
        }
示例#2
0
 public void TestFixtureSetup()
 {
     client = new DirectConnectionClient(CredentialUtils.GetTestCredentials(), true);
 }
示例#3
0
 public void TestFixtureSetup()
 {
     client = new TransparentRedirectClient(CredentialUtils.GetTestCredentials(), true);
 }
示例#4
0
 public void TestFixtureSetup()
 {
     client = new ResponsiveSharedClient(CredentialUtils.GetTestCredentials(), true);
 }