<?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 Re: integration to authorize.net in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20172#M11070</link>
    <description>&lt;P&gt;I notice you're not putting your transaction key on the end of the inputStr, why? If you look at the code example I pasted, it has only two arguments - the algorithm type (md5) and the data (see above). The transaction key is NOT passed as the key. So your example is obviously going to fail, since the transaction key should be on the end of the inputStr and not passed as the encryption key in the third argument of Crypto.generateMac().&lt;/P&gt;</description>
    <pubDate>Fri, 16 Dec 2011 15:47:07 GMT</pubDate>
    <dc:creator>TJPride</dc:creator>
    <dc:date>2011-12-16T15:47:07Z</dc:date>
    <item>
      <title>integration to authorize.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/19988#M10980</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to integrate Authorize.net with &amp;nbsp;saleforce.com using SIM mathod but i am not able to create macthing fingarprint for authorize.net .i am getting error (99) This transaction cannot be accepted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The server-generated fingerprint does not match the merchant-specified fingerprint in the x_fp_hash field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;i am not able to generate &amp;nbsp;fingerprint using force.com APEX. can &amp;nbsp;any one suggest me &amp;nbsp;what to do in this condition?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 11:27:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/19988#M10980</guid>
      <dc:creator>gaurav_dixit</dc:creator>
      <dc:date>2011-12-14T11:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: integration to authorize.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20002#M10986</link>
      <description>&lt;P&gt;All you have to do is write a function that duplicates the following (modified from the PHP API to be a bit more readable):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public static function getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $fp_timestamp) {
    $api_login_id =
        ($api_login_id ? $api_login_id :
        (defined('AUTHORIZENET_API_LOGIN_ID') ? AUTHORIZENET_API_LOGIN_ID : ''));

    $transaction_key =
        ($transaction_key ? $transaction_key :
        (defined('AUTHORIZENET_TRANSACTION_KEY') ? AUTHORIZENET_TRANSACTION_KEY : ''));
        
    $raw = "{$api_login_id}^{$fp_sequence}^{$fp_timestamp}^{$amount}^{$transaction_key}";

    return (function_exists('hash_hmac') ?
        hash_hmac('md5', $raw) :
        bin2hex(mhash(MHASH_MD5, $raw)));
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The&amp;nbsp; key part is the last few lines.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 16:43:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20002#M10986</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-12-14T16:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: integration to authorize.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20042#M11006</link>
      <description>&lt;P&gt;can you tell me how can i encrypt this in Force.com Apex. When i tryied in Apex it is giving me error Fingur prints dont match?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2011 06:16:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20042#M11006</guid>
      <dc:creator>gaurav_dixit</dc:creator>
      <dc:date>2011-12-15T06:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: integration to authorize.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20060#M11015</link>
      <description>&lt;P&gt;Paste the code you're using to try to create the fingerprint, preferably in a code box (fourth button from left in Rich Text mode).&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2011 15:53:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20060#M11015</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-12-15T15:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: integration to authorize.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20152#M11060</link>
      <description>&lt;P&gt;Random generator = new Random();&lt;BR /&gt;sequence = Long.parseLong(sequence+""+generator.nextInt(1000));&lt;BR /&gt;timeStamp = System.currentTimeMillis() / 1000;&lt;/P&gt;&lt;P&gt;try {&lt;BR /&gt;// First, the Transaction key is converted to a "SecretKey" object&lt;BR /&gt;SecretKey key = new SecretKeySpec(transactionKey.getBytes(), "HmacMD5");&lt;/P&gt;&lt;P&gt;Mac mac = Mac.getInstance("HmacMD5");&lt;BR /&gt;mac.init(key);&lt;BR /&gt;&lt;BR /&gt;String inputstring = loginID + "^" + sequence + "^" + timeStamp + "^" + amount + "^";&lt;BR /&gt;&lt;BR /&gt;byte[] result = mac.doFinal(inputstring.getBytes());&lt;BR /&gt;&lt;BR /&gt;// Convert the result from byte[] to hexadecimal format&lt;BR /&gt;&lt;BR /&gt;StringBuffer strbuf = new StringBuffer(result.length * 2);&lt;BR /&gt;&lt;BR /&gt;for (int i = 0; i &amp;lt; result.length; i++) {&lt;BR /&gt;if (((int) result[i] &amp;amp; 0xff) &amp;lt; 0x10) {&lt;BR /&gt;strbuf.append("0");&lt;BR /&gt;}&lt;BR /&gt;strbuf.append(Long.toString((int) result[i] &amp;amp; 0xff, 16));&lt;BR /&gt;}&lt;BR /&gt;fingerprintHash = strbuf.toString(); //need this result to set in HTML form in x_fp_hash&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;String API_Login_Id='6######## ';&lt;BR /&gt;String TXn_Key='62############## ';&lt;BR /&gt;String amount='55';&lt;BR /&gt;sequence = '300';&lt;/P&gt;&lt;P&gt;long timeStamp = System.currentTimeMillis()/1000;&lt;BR /&gt;&lt;BR /&gt;String inputStr = API_Login_Id + '^' + sequence + '^' + timeStamp + '^' + amount + '^';&lt;BR /&gt;&lt;BR /&gt;String algorithmName = 'hmacMD5';&lt;BR /&gt;&lt;BR /&gt;//generateMac(String algorithmName,Blob input,Blob privateKey) Computes a message authentication code (MAC)&lt;BR /&gt;//for the input string, using the private key and the specified algorithm. The valid values for algorithmName are:&lt;BR /&gt;//hmacMD5, hmacSHA1,hmacSHA256,hmacSHA512&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Blob mac = Crypto.generateMac(algorithmName,Blob.valueOf(inputStr),Blob.valueOf( TXn_Key));&lt;BR /&gt;&lt;BR /&gt;//Blob- A collection of binary data stored as a single object.&lt;BR /&gt;// You can convert this datatype to String or from String using the toString and valueOf methods&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;String macUrl =EncodingUtil.urlEncode(EncodingUtil.base64Encode(mac), 'UTF-8');&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have posted both Authorize.net java code &amp;nbsp;for encoding and Apex code what i am trying to encode here .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i get value &amp;nbsp;for&amp;nbsp;x_fp_hash &amp;nbsp;from APEX???&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2011 07:08:40 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20152#M11060</guid>
      <dc:creator>gaurav_dixit</dc:creator>
      <dc:date>2011-12-16T07:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: integration to authorize.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20172#M11070</link>
      <description>&lt;P&gt;I notice you're not putting your transaction key on the end of the inputStr, why? If you look at the code example I pasted, it has only two arguments - the algorithm type (md5) and the data (see above). The transaction key is NOT passed as the key. So your example is obviously going to fail, since the transaction key should be on the end of the inputStr and not passed as the encryption key in the third argument of Crypto.generateMac().&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2011 15:47:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20172#M11070</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-12-16T15:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: integration to authorize.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20206#M11087</link>
      <description>&lt;P&gt;thanks i solved it. &amp;nbsp;my code is ok &amp;nbsp;i was mistaken on last line of the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;String macUrl&lt;FONT color="#000000"&gt; =EncodingUtil.urlEncode(EncodingUtil.base64Encode(mac), 'UTF-8');&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;it is&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;String macUrl&lt;FONT color="#000000"&gt;&amp;nbsp;=EncodingUtil.convertToHex(mac);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;now it is working fine ..&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2011 06:55:57 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/integration-to-authorize-net/m-p/20206#M11087</guid>
      <dc:creator>gaurav_dixit</dc:creator>
      <dc:date>2011-12-17T06:55:57Z</dc:date>
    </item>
  </channel>
</rss>

