PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Authorization code passed to email

  1. Is there any way that the Auth Net authorization code can be passed to the email? Most people that make a payment online expect some sort of confirmation code. Sending an email with the information only doesn't make people feel comfortable that the transaction has actually been processed. In addition, it would help accounting departments reconcile and match transactions.

    Posted 6 years ago on Friday January 4, 2013 | Permalink
  2. I will ask the development team for their feedback on this.

    Does the setting "Send Authorize.Net email receipt." not accomplish what you want? It's a setting on the Authorize.net feed for your form.

    Posted 6 years ago on Monday January 7, 2013 | Permalink
  3. That will most definitely achieve the goal of letting them know that the transaction was successful but if you have additional fields that aren't passed to auth.net then those fields will be excluded from the email.

    So your solution would solve the issue that I described, but I didn't make myself clear in that I wanted the email to be sent from GF with all included fields plus the transaction number. I know that the number is passed back when confirmation of the transaction occurs. It's just a matter of creating a hidden field that will populate it in the email.

    Thanks

    Posted 6 years ago on Monday January 7, 2013 | Permalink
  4. After talking with the development team, I think we have a solution for you. You will need a new version of the Authorize.net add-on. Please email me at chris@rocketgenius.com and reference this topic, and I will send you the latest development version (1.3.1).

    With that installed, you can do the following:

    1. Create a custom merge tag to return the transaction id ( add this code to your theme's functions.php file ):
      [php]
      add_filter('gform_replace_merge_tags', 'replace_transaction_id', 10, 7);
      function replace_transaction_id($text, $form, $entry, $url_encode, $esc_html, $nl2br, $format) {
        $custom_merge_tag = '{transaction_id}';
        if(strpos($text, $custom_merge_tag) === false)
          return $text;
      
        $transaction_id = GFAuthorizeNet::$transaction_response["transaction_id"];
        $text = str_replace($custom_merge_tag, $transaction_id, $text);
        return $text;
      }
    2. Add the merge tag to your confirmation emails ( from the above code, {transaction_id} )

    Do you need any help configuring that custom merge tag?

    Posted 6 years ago on Tuesday January 8, 2013 | Permalink
  5. dennismueller
    Member

    thanks for the explanation. i got version 1.3.1 now. I would also need to insert the Paymentdate. How do i need to adjust the examplecode from here to also get this working as a mergetag?

    Posted 6 years ago on Wednesday January 30, 2013 | Permalink
  6. How is the payment date different than the date submitted or today's date? And you want to include the payment date in the confirmation email; is that correct?

    Posted 6 years ago on Wednesday January 30, 2013 | Permalink
  7. dennismueller
    Member

    sure youre right. just wanted to use the correct field in the email. i will use submission date for now.

    would it be easy to get the payment status as a merge field?

    yes for a confirmation. but not for the customer, its internally.

    Posted 6 years ago on Wednesday January 30, 2013 | Permalink
  8. It looks like you can get the payment status in the same manner. Here is an example from one of my transactions:

    [response_reason_text] => This transaction has been declined.
    [authorization_code] => EY4H99

    And another:

    [response_reason_text] => This transaction has been approved.
    [authorization_code] => JHTAOH

    In this code example you would replace {transaction_id} with {response_reason_text} and use the exact same approach.

    Does that work for you?

    Posted 6 years ago on Thursday January 31, 2013 | Permalink
  9. dennismueller
    Member

    hi chris,

    as a basic test i updated the plugin to version 1.3.1 and inserted the mentioned code in my functions php. but when i got a entry and resend the notification to test it, the transaction id stays empty (when i view it in the backend it has a transaction id. does this only work for new entries? i got wordpress 3.5, do i maybe need 3.5.1?

    thanks for the help

    Posted 6 years ago on Thursday January 31, 2013 | Permalink
  10. You do not need WordPress 3.5.1. That is a bug-fix and security release: no new functionality.

    Try with a new entry rather than resending a notification. I suspect it should work with existing entries, but it doesn't hurt to try.

    If it does not work, please share all the code you are using at pastie.org or pastebin.com and we will see if there is anything obviously incorrect.

    Posted 6 years ago on Friday February 1, 2013 | Permalink
  11. I have a similar situation. I need to pick up the following pieces of information from authorize.net after the transaction is successful and post them to a separate table in the context of the gform_after_submission hook.

    "auth_response_subcode"
    "auth_reason"
    'response_reason_code'
    'response_reason_text'
    "auth_approval"
    'approval_code'
    'avs_result_code'
    'transaction_id'

    I have picked up the field entries and dumped them all in a completely separate table. I just can't seem to pick up the response data from Authorize.net so that I can put it into the table.

    Thanks.

    Posted 6 years ago on Thursday February 7, 2013 | Permalink
  12. What code are you using to do this currently? Please use pastebin.com or pastie.org to share your code.

    Posted 6 years ago on Friday February 8, 2013 | Permalink
  13. I put a pro ticket in. Please contact me via the ticket. I will post the solution here at the end.

    Posted 6 years ago on Friday February 8, 2013 | Permalink
  14. I was trying to get the payment status by using the suggested approach above of changing {transaction_id} to {response_reason_text}, but it seems like the GFAuthorizeNet::$transaction_response is only an array of 4 values which don't include response_reason_text. Am I missing something?

    Here is the array for GFAuthorizeNet::$transaction_response that I am recieving:

    array(4) { ["transaction_id"]=> string(10) "2183786758" ["amount"]=> string(5) "10.10" ["transaction_type"]=> int(1) ["invoice_number"]=> string(13) "51153a1ebc33e" }

    Is the response from authorize.net different between a test account and a prod account?

    Thanks
    Greg

    Posted 6 years ago on Friday February 8, 2013 | Permalink
  15. Chris, please continue with the priority support ticket.

    Posted 6 years ago on Friday February 8, 2013 | Permalink
  16. When will 1.3.1 be released? ( I see this thread is several months old, but 1.3 is still the current release)

    I just modified my version of 1.3 to allow me to get the transaction_id (based on the clues above), but it seems like a pretty big oversight that it is not set in the $entry passed to the after_submit hook? An official fix would be great to see!

    Posted 6 years ago on Monday April 22, 2013 | Permalink
  17. Is there anyone still connected to this post that could forward me a copy of the 1.3.1 plugin? I've entered a ticket, but I'm trying to get this same issue worked out over the weekend.

    I'm using the confirmation and notification areas to generate a receipt after successful payment through the Authorize.net plugin, but—like you all—was surprised to discover that we're not given access to any merge tags to insert the transaction ID into the messages.

    Thanks…

    Posted 6 years ago on Saturday May 4, 2013 | Permalink
  18. Wes, I sent you the latest version, did I not? If not, please send an email to chris@rocketgenius.com - thanks.

    Posted 6 years ago on Monday May 6, 2013 | Permalink