public void ProcessPaymentTest() { var request = new TransparentRedirectRequest("http://www.eway.com.au", TransactionType.Purchase); request = SetupRequest(request); var response = client.ProcessPayment <TransparentRedirectResponse>(request); Assert.IsNotNull(response.AccessCode); Assert.IsNotNull(response.FormActionURL); Assert.IsNull(response.Errors); }
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); }