<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Credit card authorization test in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Credit-card-authorization-test/m-p/78413#M49254</link>
    <description>&lt;P&gt;Hello everyone, I am new to testing the Auth sandbox API, I made the following API call to do an authorization to the credit card, but I don't know if it is ok, the message is successful, but it is really the proper response ? can someone give me your opinion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected void Page_Load(object sender, EventArgs e)&lt;BR /&gt;{&lt;BR /&gt;string strApiLoginID = "XXXXXXXX";&lt;BR /&gt;string strApiTransactionKey = "XXXXXXXXXXXXXXX";&lt;/P&gt;&lt;P&gt;Run(strApiLoginID, strApiTransactionKey);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Charge Tokenized Credit Card Sample");&lt;/P&gt;&lt;P&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.SANDBOX;&lt;/P&gt;&lt;P&gt;// define the merchant information (authentication / transaction id)&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()&lt;BR /&gt;{&lt;BR /&gt;name = ApiLoginID,&lt;BR /&gt;ItemElementName = ItemChoiceType.transactionKey,&lt;BR /&gt;Item = ApiTransactionKey,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var creditCard = new creditCardType&lt;BR /&gt;{&lt;BR /&gt;cardNumber = "4111111111111111",&lt;BR /&gt;expirationDate = "1028",&lt;BR /&gt;// Set the token specific info&lt;BR /&gt;isPaymentToken = true,&lt;BR /&gt;cryptogram = "EjRWeJASNFZ4kBI0VniQEjRWeJA=" // Set this to the value of the cryptogram received from the token provide&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//standard api call to retrieve response&lt;BR /&gt;var paymentType = new paymentType { Item = creditCard };&lt;/P&gt;&lt;P&gt;var transactionRequest = new transactionRequestType&lt;BR /&gt;{&lt;BR /&gt;transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // charge the card&lt;BR /&gt;amount = 133.45m,&lt;BR /&gt;payment = paymentType&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var request = new createTransactionRequest { transactionRequest = transactionRequest };&lt;/P&gt;&lt;P&gt;// instantiate the controller that will call the service&lt;BR /&gt;var controller = new createTransactionController(request);&lt;BR /&gt;controller.Execute();&lt;/P&gt;&lt;P&gt;// get the response from the service (errors contained if any)&lt;BR /&gt;var response = controller.GetApiResponse();&lt;/P&gt;&lt;P&gt;// validate response&lt;BR /&gt;if (response != null)&lt;BR /&gt;{&lt;BR /&gt;if (response.messages.resultCode == messageTypeEnum.Ok)&lt;BR /&gt;{&lt;BR /&gt;if (response.transactionResponse.messages != null)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Successfully created transaction with Transaction ID: " + response.transactionResponse.transId);&lt;BR /&gt;Console.WriteLine("Response Code: " + response.transactionResponse.responseCode);&lt;BR /&gt;Console.WriteLine("Message Code: " + response.transactionResponse.messages[0].code);&lt;BR /&gt;Console.WriteLine("Description: " + response.transactionResponse.messages[0].description);&lt;BR /&gt;Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Console.WriteLine("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse != null &amp;amp;&amp;amp; response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Console.WriteLine("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error Code: " + response.messages.message[0].code);&lt;BR /&gt;Console.WriteLine("Error message: " + response.messages.message[0].text);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Null Response.");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return response;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Response&lt;BR /&gt;-----------&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"transactionResponse": {&lt;BR /&gt;"responseCode": "1",&lt;BR /&gt;"authCode": "PYQMA1",&lt;BR /&gt;"avsResultCode": "Y",&lt;BR /&gt;"cvvResultCode": "p",&lt;BR /&gt;"cavvResultCode": "2",&lt;BR /&gt;"transId": "60173132287",&lt;BR /&gt;"refTransID": "",&lt;BR /&gt;"transHash": "C85B15CED28462974F1114DB07A16C39",&lt;BR /&gt;"accountNumber": "XXXX1111",&lt;BR /&gt;"accountType": "Visa",&lt;BR /&gt;"networkTransId": "MELZ9F8877Q8LL15I0RU2K2"&lt;BR /&gt;},&lt;BR /&gt;"refId": null,&lt;BR /&gt;"messages": {&lt;BR /&gt;"resultCode": "Ok",&lt;BR /&gt;"message": [&lt;BR /&gt;{&lt;BR /&gt;"code": "I00001",&lt;BR /&gt;"text": "Successful."&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Sep 2021 16:23:39 GMT</pubDate>
    <dc:creator>DavidSanchez</dc:creator>
    <dc:date>2021-09-06T16:23:39Z</dc:date>
    <item>
      <title>Credit card authorization test</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Credit-card-authorization-test/m-p/78413#M49254</link>
      <description>&lt;P&gt;Hello everyone, I am new to testing the Auth sandbox API, I made the following API call to do an authorization to the credit card, but I don't know if it is ok, the message is successful, but it is really the proper response ? can someone give me your opinion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected void Page_Load(object sender, EventArgs e)&lt;BR /&gt;{&lt;BR /&gt;string strApiLoginID = "XXXXXXXX";&lt;BR /&gt;string strApiTransactionKey = "XXXXXXXXXXXXXXX";&lt;/P&gt;&lt;P&gt;Run(strApiLoginID, strApiTransactionKey);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Charge Tokenized Credit Card Sample");&lt;/P&gt;&lt;P&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.SANDBOX;&lt;/P&gt;&lt;P&gt;// define the merchant information (authentication / transaction id)&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()&lt;BR /&gt;{&lt;BR /&gt;name = ApiLoginID,&lt;BR /&gt;ItemElementName = ItemChoiceType.transactionKey,&lt;BR /&gt;Item = ApiTransactionKey,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var creditCard = new creditCardType&lt;BR /&gt;{&lt;BR /&gt;cardNumber = "4111111111111111",&lt;BR /&gt;expirationDate = "1028",&lt;BR /&gt;// Set the token specific info&lt;BR /&gt;isPaymentToken = true,&lt;BR /&gt;cryptogram = "EjRWeJASNFZ4kBI0VniQEjRWeJA=" // Set this to the value of the cryptogram received from the token provide&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//standard api call to retrieve response&lt;BR /&gt;var paymentType = new paymentType { Item = creditCard };&lt;/P&gt;&lt;P&gt;var transactionRequest = new transactionRequestType&lt;BR /&gt;{&lt;BR /&gt;transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // charge the card&lt;BR /&gt;amount = 133.45m,&lt;BR /&gt;payment = paymentType&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var request = new createTransactionRequest { transactionRequest = transactionRequest };&lt;/P&gt;&lt;P&gt;// instantiate the controller that will call the service&lt;BR /&gt;var controller = new createTransactionController(request);&lt;BR /&gt;controller.Execute();&lt;/P&gt;&lt;P&gt;// get the response from the service (errors contained if any)&lt;BR /&gt;var response = controller.GetApiResponse();&lt;/P&gt;&lt;P&gt;// validate response&lt;BR /&gt;if (response != null)&lt;BR /&gt;{&lt;BR /&gt;if (response.messages.resultCode == messageTypeEnum.Ok)&lt;BR /&gt;{&lt;BR /&gt;if (response.transactionResponse.messages != null)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Successfully created transaction with Transaction ID: " + response.transactionResponse.transId);&lt;BR /&gt;Console.WriteLine("Response Code: " + response.transactionResponse.responseCode);&lt;BR /&gt;Console.WriteLine("Message Code: " + response.transactionResponse.messages[0].code);&lt;BR /&gt;Console.WriteLine("Description: " + response.transactionResponse.messages[0].description);&lt;BR /&gt;Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Console.WriteLine("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse != null &amp;amp;&amp;amp; response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Console.WriteLine("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error Code: " + response.messages.message[0].code);&lt;BR /&gt;Console.WriteLine("Error message: " + response.messages.message[0].text);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Null Response.");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return response;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Response&lt;BR /&gt;-----------&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"transactionResponse": {&lt;BR /&gt;"responseCode": "1",&lt;BR /&gt;"authCode": "PYQMA1",&lt;BR /&gt;"avsResultCode": "Y",&lt;BR /&gt;"cvvResultCode": "p",&lt;BR /&gt;"cavvResultCode": "2",&lt;BR /&gt;"transId": "60173132287",&lt;BR /&gt;"refTransID": "",&lt;BR /&gt;"transHash": "C85B15CED28462974F1114DB07A16C39",&lt;BR /&gt;"accountNumber": "XXXX1111",&lt;BR /&gt;"accountType": "Visa",&lt;BR /&gt;"networkTransId": "MELZ9F8877Q8LL15I0RU2K2"&lt;BR /&gt;},&lt;BR /&gt;"refId": null,&lt;BR /&gt;"messages": {&lt;BR /&gt;"resultCode": "Ok",&lt;BR /&gt;"message": [&lt;BR /&gt;{&lt;BR /&gt;"code": "I00001",&lt;BR /&gt;"text": "Successful."&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 16:23:39 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Credit-card-authorization-test/m-p/78413#M49254</guid>
      <dc:creator>DavidSanchez</dc:creator>
      <dc:date>2021-09-06T16:23:39Z</dc:date>
    </item>
  </channel>
</rss>

