<?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 &amp;quot;Duplicate&amp;quot; transactions within a second of each other but only one cURL response logged? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51583#M26934</link>
    <description>&lt;P&gt;I have a custom shopping cart that validates the customer's information and sends the CC details to Authorize.net. I recently ran into an issue where an order was placed but two separate transactions were processed (within 1 second of each other). The problem: only the second transaction got logged in my system.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my process payment function that takes the payment information as a parameter and makes the cURL call and logs the response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public function process_payment($post_data) {
		
		$auth_net_login_id			= "?????????";
		$auth_net_tran_key			= "????????????????";

		$auth_net_url				= "https://secure.authorize.net/gateway/transact.dll";
	
		switch ($post_data['payment_type']) {
			case 'CK':
				$x_method = "ECHECK";
				break;
			case 'CC':
				$x_method = "CC";
				break;
			default:
				$x_method = "CC";
				break;
		}
	
		if ($x_method == "CC") {
			$authnet_values	= array(
				"x_login" =&amp;gt; $auth_net_login_id,
				"x_test_request" =&amp;gt; "TRUE",
				"x_version" =&amp;gt; "3.1",
				"x_delim_char" =&amp;gt; "|",
				"x_delim_data" =&amp;gt; "TRUE",
				"x_type" =&amp;gt; "AUTH_CAPTURE",
				"x_method" =&amp;gt; $x_method,
				"x_tran_key" =&amp;gt; $auth_net_tran_key,
				"x_relay_response" =&amp;gt; "FALSE",
				"x_card_num" =&amp;gt; $post_data['cc_number'],
				"x_exp_date" =&amp;gt; $post_data['cc_exp_month'] . '/' . $post_data['cc_exp_year'],
				"x_card_code" =&amp;gt; $post_data['cc_verification'],
				"x_amount" =&amp;gt; $post_data['entered_payment_amount'],
				"x_first_name" =&amp;gt; $post_data['add_cust_fname'],
				"x_last_name" =&amp;gt; $post_data['add_cust_lname'],
				"x_phone" =&amp;gt; $post_data['add_cust_hphone'],
				"x_address" =&amp;gt; $post_data['address'],
				"x_city" =&amp;gt; $post_data['addr_city'],
				"x_state" =&amp;gt; $post_data['addr_state'],
				"x_zip"	=&amp;gt; $post_data['addr_zip'],
				"x_country" =&amp;gt; $post_data['addr_country'],
				"x_invoice_num" =&amp;gt; date("YmdHis"),
				"x_email_customer" =&amp;gt; "TRUE",
				"x_duplicate_window" =&amp;gt; "1800"
			);
		}
	
		$fields = "";
		foreach( $authnet_values as $key =&amp;gt; $value ) 
			$fields .= "$key=" . urlencode( $value ) . "&amp;amp;";

		$ch = curl_init($auth_net_url);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $fields, "&amp;amp; " ));
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
		$resp = curl_exec($ch);
		curl_close ($ch);
		
		&lt;STRONG&gt;log_message('debug', 'payments-&amp;gt;process_payment: ' . $resp);&lt;/STRONG&gt;

		return $resp;
	}&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, each response from Authorize.net is logged, but only the second transaction's details are showing up in my log. How is it possible that two transactions could have occured within a second of each other but there is only a trace of the second one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jul 2015 19:10:08 GMT</pubDate>
    <dc:creator>mhunsinger</dc:creator>
    <dc:date>2015-07-31T19:10:08Z</dc:date>
    <item>
      <title>"Duplicate" transactions within a second of each other but only one cURL response logged?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51583#M26934</link>
      <description>&lt;P&gt;I have a custom shopping cart that validates the customer's information and sends the CC details to Authorize.net. I recently ran into an issue where an order was placed but two separate transactions were processed (within 1 second of each other). The problem: only the second transaction got logged in my system.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my process payment function that takes the payment information as a parameter and makes the cURL call and logs the response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public function process_payment($post_data) {
		
		$auth_net_login_id			= "?????????";
		$auth_net_tran_key			= "????????????????";

		$auth_net_url				= "https://secure.authorize.net/gateway/transact.dll";
	
		switch ($post_data['payment_type']) {
			case 'CK':
				$x_method = "ECHECK";
				break;
			case 'CC':
				$x_method = "CC";
				break;
			default:
				$x_method = "CC";
				break;
		}
	
		if ($x_method == "CC") {
			$authnet_values	= array(
				"x_login" =&amp;gt; $auth_net_login_id,
				"x_test_request" =&amp;gt; "TRUE",
				"x_version" =&amp;gt; "3.1",
				"x_delim_char" =&amp;gt; "|",
				"x_delim_data" =&amp;gt; "TRUE",
				"x_type" =&amp;gt; "AUTH_CAPTURE",
				"x_method" =&amp;gt; $x_method,
				"x_tran_key" =&amp;gt; $auth_net_tran_key,
				"x_relay_response" =&amp;gt; "FALSE",
				"x_card_num" =&amp;gt; $post_data['cc_number'],
				"x_exp_date" =&amp;gt; $post_data['cc_exp_month'] . '/' . $post_data['cc_exp_year'],
				"x_card_code" =&amp;gt; $post_data['cc_verification'],
				"x_amount" =&amp;gt; $post_data['entered_payment_amount'],
				"x_first_name" =&amp;gt; $post_data['add_cust_fname'],
				"x_last_name" =&amp;gt; $post_data['add_cust_lname'],
				"x_phone" =&amp;gt; $post_data['add_cust_hphone'],
				"x_address" =&amp;gt; $post_data['address'],
				"x_city" =&amp;gt; $post_data['addr_city'],
				"x_state" =&amp;gt; $post_data['addr_state'],
				"x_zip"	=&amp;gt; $post_data['addr_zip'],
				"x_country" =&amp;gt; $post_data['addr_country'],
				"x_invoice_num" =&amp;gt; date("YmdHis"),
				"x_email_customer" =&amp;gt; "TRUE",
				"x_duplicate_window" =&amp;gt; "1800"
			);
		}
	
		$fields = "";
		foreach( $authnet_values as $key =&amp;gt; $value ) 
			$fields .= "$key=" . urlencode( $value ) . "&amp;amp;";

		$ch = curl_init($auth_net_url);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $fields, "&amp;amp; " ));
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
		$resp = curl_exec($ch);
		curl_close ($ch);
		
		&lt;STRONG&gt;log_message('debug', 'payments-&amp;gt;process_payment: ' . $resp);&lt;/STRONG&gt;

		return $resp;
	}&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, each response from Authorize.net is logged, but only the second transaction's details are showing up in my log. How is it possible that two transactions could have occured within a second of each other but there is only a trace of the second one?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2015 19:10:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51583#M26934</guid>
      <dc:creator>mhunsinger</dc:creator>
      <dc:date>2015-07-31T19:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: "Duplicate" transactions within a second of each other but only one cURL response logg</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51584#M26935</link>
      <description>&lt;P&gt;Are you saying both transactions are in authorize.net but only logging one on your system?&lt;/P&gt;&lt;P&gt;Maybe your log_message can't handle 2 records with the same timestamp?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2015 19:31:35 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51584#M26935</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2015-07-31T19:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: "Duplicate" transactions within a second of each other but only one cURL response logg</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51586#M26937</link>
      <description>&lt;P&gt;In your sample code, you set Test Request = True which would instruct the gateway to only validate credentials. &amp;nbsp;Transactions submitted with test request set to true won't appear in the merchant interface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2015 21:11:37 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51586#M26937</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2015-07-31T21:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: "Duplicate" transactions within a second of each other but only one cURL response logg</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51596#M26947</link>
      <description>&lt;P&gt;Yes. Both transactions are in Authorize.net but only the second one is logged.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anytime Authorize.net sends a response back, it gets logged. It is as if the cURL call went out to Authorize.net to process the transaction, but never returned a response, and processed it anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would imagine that if two individual transactions are showing up in Authorize.net, then two individual transactions would be showing in my logs. It is as if the first transaction snuck through somehow.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 12:54:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51596#M26947</guid>
      <dc:creator>mhunsinger</dc:creator>
      <dc:date>2015-08-03T12:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: "Duplicate" transactions within a second of each other but only one cURL response logg</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51597#M26948</link>
      <description>&lt;P&gt;The test request is set to TRUE on the live server. I must've copied the code over from the development server by mistake. Pretend that is TRUE. :)&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 12:50:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51597#M26948</guid>
      <dc:creator>mhunsinger</dc:creator>
      <dc:date>2015-08-03T12:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: "Duplicate" transactions within a second of each other but only one cURL response logg</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51598#M26949</link>
      <description>&lt;P&gt;I would imagine that if two individual transactions are showing up in Authorize.net, then two individual transactions would be showing in my logs. It is as if the first transaction snuck through somehow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the first transaction get stuck, shouldn't it be getting a timeout on the response?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try calling this twice in a row? just to make sure it does write twice.&lt;/P&gt;&lt;P&gt;log_message('debug', 'payments-&amp;gt;process_payment: ' . $resp);&lt;/P&gt;&lt;P&gt;log_message('debug', 'payments-&amp;gt;process_payment: ' . $resp);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 13:06:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51598#M26949</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2015-08-03T13:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: "Duplicate" transactions within a second of each other but only one cURL response logg</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51600#M26951</link>
      <description>&lt;P&gt;log_message('debug', 'payments-&amp;gt;process_payment: ' . $resp);&lt;BR /&gt;log_message('debug', 'payments-&amp;gt;process_payment: ' . $resp);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;gives me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;DEBUG - 2015-08-03 10:23:56 --&amp;gt; payments-&amp;gt;process_payment: 1|1|1|(TESTMODE) This transaction has been approved.|000000|P|0|20150803102355||209.98|CC|auth_capture||ma&lt;BR /&gt;rk|hunsinger||xxxxxxxxxx|xxxxxxxxxx|PA|22222|USA|5555555555||||||||||||||||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|||||||||||||XXXX0027|Visa||||||||||||||||&lt;BR /&gt;DEBUG - 2015-08-03 10:23:56 --&amp;gt; &lt;SPAN&gt;payments-&amp;gt;process_payment: 1|1|1|(TESTMODE) This transaction has been approved.|000000|P|0|20150803102355||209.98|CC|auth_capture||ma&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rk|hunsinger||xxxxxxxxxx|xxxxxxxxxx|PA|22222|USA|5555555555||||||||||||||||XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|||||||||||||XXXX0027|Visa||||||||||||||||&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like it writes fine.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 14:30:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51600#M26951</guid>
      <dc:creator>mhunsinger</dc:creator>
      <dc:date>2015-08-03T14:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: "Duplicate" transactions within a second of each other but only one cURL response logg</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51602#M26953</link>
      <description>&lt;P&gt;Look fine then, but still doesn't look like an issue with authorize.net as it did get the transactions. Do you have anything to log http traffic?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Aug 2015 14:56:52 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Duplicate-quot-transactions-within-a-second-of-each-other/m-p/51602#M26953</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2015-08-03T14:56:52Z</dc:date>
    </item>
  </channel>
</rss>

