<?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 Adding Invoice Number to Refunds in Node in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Adding-Invoice-Number-to-Refunds-in-Node/m-p/65201#M38899</link>
    <description>&lt;P&gt;It was frustrating not finding this in the API docs&amp;nbsp;so I thought I'd share here.&lt;BR /&gt;&lt;BR /&gt;Occasionally, in trying to issue multiple refunds back-to-back for transactions that were very similar (same customer, cc, price), we would get a&amp;nbsp;&lt;A href="https://support.authorize.net/s/article/Error-11-A-duplicate-transaction-has-been-submitted" target="_self"&gt;duplicate transaction error&lt;/A&gt;. We needed to adjust the invoiceNumber, but it wasn't explicit how. Well, it's the same as with &lt;A href="https://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card" target="_self"&gt;charging a card&lt;/A&gt;. Just work from the &lt;A href="https://developer.authorize.net/api/reference/index.html#payment-transactions-refund-a-transaction" target="_self"&gt;API documentation for refunds&lt;/A&gt; but add the first two lines below&amp;nbsp;(declaring &amp;amp; configuring the orderDetails) before you instantiate your transactionRequestType and then include the last line below to add these details to your refund.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    var orderDetails = new ApiContracts.OrderType();
    orderDetails.setInvoiceNumber(&lt;EM&gt;INSERT_YOUR_INVOICE&lt;/EM&gt;);

    var transactionRequestType = new ApiContracts.TransactionRequestType();
    transactionRequestType.setTransactionType(ApiContracts.TransactionTypeEnum.REFUNDTRANSACTION);
    transactionRequestType.setPayment(paymentType);
    transactionRequestType.setAmount(&lt;EM&gt;INSERT_YOUR_AMOUNT&lt;/EM&gt;);
    transactionRequestType.setOrder(orderDetails);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might've guessed that, but I don't like guessing when it comes to payment processing. Happy holidays, y'all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Nov 2018 23:42:55 GMT</pubDate>
    <dc:creator>thekestrelco</dc:creator>
    <dc:date>2018-11-29T23:42:55Z</dc:date>
    <item>
      <title>Adding Invoice Number to Refunds in Node</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Adding-Invoice-Number-to-Refunds-in-Node/m-p/65201#M38899</link>
      <description>&lt;P&gt;It was frustrating not finding this in the API docs&amp;nbsp;so I thought I'd share here.&lt;BR /&gt;&lt;BR /&gt;Occasionally, in trying to issue multiple refunds back-to-back for transactions that were very similar (same customer, cc, price), we would get a&amp;nbsp;&lt;A href="https://support.authorize.net/s/article/Error-11-A-duplicate-transaction-has-been-submitted" target="_self"&gt;duplicate transaction error&lt;/A&gt;. We needed to adjust the invoiceNumber, but it wasn't explicit how. Well, it's the same as with &lt;A href="https://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card" target="_self"&gt;charging a card&lt;/A&gt;. Just work from the &lt;A href="https://developer.authorize.net/api/reference/index.html#payment-transactions-refund-a-transaction" target="_self"&gt;API documentation for refunds&lt;/A&gt; but add the first two lines below&amp;nbsp;(declaring &amp;amp; configuring the orderDetails) before you instantiate your transactionRequestType and then include the last line below to add these details to your refund.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    var orderDetails = new ApiContracts.OrderType();
    orderDetails.setInvoiceNumber(&lt;EM&gt;INSERT_YOUR_INVOICE&lt;/EM&gt;);

    var transactionRequestType = new ApiContracts.TransactionRequestType();
    transactionRequestType.setTransactionType(ApiContracts.TransactionTypeEnum.REFUNDTRANSACTION);
    transactionRequestType.setPayment(paymentType);
    transactionRequestType.setAmount(&lt;EM&gt;INSERT_YOUR_AMOUNT&lt;/EM&gt;);
    transactionRequestType.setOrder(orderDetails);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might've guessed that, but I don't like guessing when it comes to payment processing. Happy holidays, y'all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 23:42:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Adding-Invoice-Number-to-Refunds-in-Node/m-p/65201#M38899</guid>
      <dc:creator>thekestrelco</dc:creator>
      <dc:date>2018-11-29T23:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Invoice Number to Refunds in Node</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Adding-Invoice-Number-to-Refunds-in-Node/m-p/65206#M38904</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/27315"&gt;@thekestrelco&lt;/a&gt;&amp;nbsp;for the information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 19:26:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Adding-Invoice-Number-to-Refunds-in-Node/m-p/65206#M38904</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2018-11-30T19:26:55Z</dc:date>
    </item>
  </channel>
</rss>

