Can someone please give me an example of the extra code onsubmit after email that will return the confirmation or rejection of charge from authorize.net?
This is the only thing missing in our form, and we really need it.
Thank you,
Cheryl
This is the only thing missing in our form, and we really need it.
Thank you,
Cheryl
Hi Cheryl,
I don't know much about the plug-in but don't the codes on the "Useful Variables" tab give you what you need?
Bob
I don't know much about the plug-in but don't the codes on the "Useful Variables" tab give you what you need?
Response Code: $MyPlugins->cf_Authorize_dotnet['response_code']
Response Subcode: $MyPlugins->cf_Authorize_dotnet['response_subcode']
Response Reason Code: $MyPlugins->cf_Authorize_dotnet['response_reason_code']
Response Reason Text: $MyPlugins->cf_Authorize_dotnet['response_reason_text']
Approval Code: $MyPlugins->cf_Authorize_dotnet['approval_code']
AVS Result Code: $MyPlugins->cf_Authorize_dotnet['avs_result_code']
Transaction ID: $MyPlugins->cf_Authorize_dotnet['transaction_id']
Bob
Well I think I can figure out the codes, just not sure of syntax that goes in that extra info field. does it have to have some php code or something to tell it what to do with those codes?
Hi Cheryl.
What do you want it to do?
It does have to be some PHP to make use of those codes.
Bob
What do you want it to do?
It does have to be some PHP to make use of those codes.
Bob
Hi Bob,
I want it to check the auth.net then return a screen to the person saying approved or denied, and if denied take them back to the form to try again.
Cheryl
I want it to check the auth.net then return a screen to the person saying approved or denied, and if denied take them back to the form to try again.
Cheryl
Hi Cheryl,
I found a list of respose codes here. Looking at these 1 = success and anything else is failure. Here's some basic code that will handle this. You may need to add more checks and formatting in a live version:
Bob
I found a list of respose codes here. Looking at these 1 = success and anything else is failure. Here's some basic code that will handle this. You may need to add more checks and formatting in a live version:
<?php
global $MyPlugins->cf_Authorize_dotnet; // not sure if this is needed or not
if ( $MyPlugins->cf_Authorize_dotnet['response_code'] == 1 ) {
echo "Your purchase has been approved";
} else {
$message = "Authorise net has declined your purchase with this message:<br />".
$MyPlugins->cf_Authorize_dotnet['response_reason_text'];
$mainframe->redirect('form_url_here', $message, 'error');
}
?>This method uses Joomla! system messages and will be OK as long as your template supports them.Bob
Thank you !!! WE will try this, and I really appreciate your help.
Merry Christmas to you and all the Chrono Engine team.
Cheryl
😀
Merry Christmas to you and all the Chrono Engine team.
Cheryl
😀
I too need to receive a response from authorize.net as to whether the transactions was or was not successful.
I pasted the code suggested here into the "On Submit code - before sending email" field, but it's not working. It just returns the following error when I submit the form:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /home/jewishex/public_html/components/com_chronocontact/libraries/customcode.php(51) : eval()'d code on line 2
Should I be pasting the suggested code somewhere else to receive the feedback from authorize.net? (I do have the paid plugin and I'm not running it in Test mode.....)
Any ideas what I'm doing wrong?
I pasted the code suggested here into the "On Submit code - before sending email" field, but it's not working. It just returns the following error when I submit the form:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /home/jewishex/public_html/components/com_chronocontact/libraries/customcode.php(51) : eval()'d code on line 2
Should I be pasting the suggested code somewhere else to receive the feedback from authorize.net? (I do have the paid plugin and I'm not running it in Test mode.....)
Any ideas what I'm doing wrong?
Hi 4web,
This code has to run *after* the submission to Authorize.net, the OnSubmit Before Email runs before the plug-ins do. The best place to add it is in the Extra after onsubmit code in the plug-in configuration.
Bob
This code has to run *after* the submission to Authorize.net, the OnSubmit Before Email runs before the plug-ins do. The best place to add it is in the Extra after onsubmit code in the plug-in configuration.
Bob
Well that certainly makes sense -- thank you! Unfortunately I'm getting the same error code when I place it in the 'extra after onsubmit code' field.
I followed the authorize.net plugin tutorial posted by another user last year and I think I have all the bases covered correctly.... HOWEVER: When I run in test mode with authorize.net I get "approved"... Debug tells me everything is working correctly... But then when I put the plug-in in live mode (and the client's authorize.net account *is* live) the transactions aren't actually getting through to authorize.net. I was hoping that the response info from authorize.net would help me diagnose the problem, but I obviously can't get that to work either.
I have the first name, last name, CC#, and exp. month and year fields correctly configured between the form and the plug-in... Correct API Login and Transaction Key entered.... Do you have any suggestions as to what else I should be looking at? I feel that I'm so close to getting this working (at least I HOPE I am after spending so much time creating the form and emails...) but this final step is a killer!
Thanks so much for any additional suggestions/help!
I followed the authorize.net plugin tutorial posted by another user last year and I think I have all the bases covered correctly.... HOWEVER: When I run in test mode with authorize.net I get "approved"... Debug tells me everything is working correctly... But then when I put the plug-in in live mode (and the client's authorize.net account *is* live) the transactions aren't actually getting through to authorize.net. I was hoping that the response info from authorize.net would help me diagnose the problem, but I obviously can't get that to work either.
I have the first name, last name, CC#, and exp. month and year fields correctly configured between the form and the plug-in... Correct API Login and Transaction Key entered.... Do you have any suggestions as to what else I should be looking at? I feel that I'm so close to getting this working (at least I HOPE I am after spending so much time creating the form and emails...) but this final step is a killer!
Thanks so much for any additional suggestions/help!
Hi 4web,
Did you try V4 ? if you can enable the Mootools 1.2 on your website then please try the Auth.net on V4 and let me know any comments through the "Contact Us" page.
Regards,
Max
Did you try V4 ? if you can enable the Mootools 1.2 on your website then please try the Auth.net on V4 and let me know any comments through the "Contact Us" page.
Regards,
Max
Hi web4,
Just a footnote to Max's post. While you can install v4 alongside v3.2 you cannot run them both at the same time without encountering some problems as they require different versions of the MooToolsl library to be installed.
With the v3.2 test:
Have you tried the 'Useful variables' to see if you get any response code at all?
It's possible that authorize.net have changed something in the requirements? I haven't used this plug-in for many months - but it was then working OK.
By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.
Bob
Just a footnote to Max's post. While you can install v4 alongside v3.2 you cannot run them both at the same time without encountering some problems as they require different versions of the MooToolsl library to be installed.
With the v3.2 test:
Have you tried the 'Useful variables' to see if you get any response code at all?
It's possible that authorize.net have changed something in the requirements? I haven't used this plug-in for many months - but it was then working OK.
By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.
Bob
Bob and Max,
Thanks for your continued suggestions. It turns out the plugin IS working after all -- it just took longer than expected for all those test $1 charges to show up! However I really need to get the response codes working. I'm hesitant to upgrade from 3.2 to 4 since the client insisted on launching the form as soon as he learned it was "mostly" functional. I don't have the php knowledge to know what to do with the 'Useful variables' -- my understanding is that I can't just drop them as-is into the appropriate fields...
Are you still willing to take a peak into the backend re: getting the response codes working?
Thanks --
Thanks for your continued suggestions. It turns out the plugin IS working after all -- it just took longer than expected for all those test $1 charges to show up! However I really need to get the response codes working. I'm hesitant to upgrade from 3.2 to 4 since the client insisted on launching the form as soon as he learned it was "mostly" functional. I don't have the php knowledge to know what to do with the 'Useful variables' -- my understanding is that I can't just drop them as-is into the appropriate fields...
Are you still willing to take a peak into the backend re: getting the response codes working?
Thanks --
Hi 4web,
I've got the Response code showing up for the second form on the site FormID 19.
Here's the code I used. You don't want the error codes showing for 'normal users' so I've set up a little hidden key to turn them on. If you enter 9999 into the 'Number attending' input then the messages will display.
In the Form OnSubmit Before Email box is the code to check the key
Then in the Plug-in Extra Code | 'Extra after onsubmit code' box we have
The messages show up as in the image below.
Bob
I've got the Response code showing up for the second form on the site FormID 19.
Here's the code I used. You don't want the error codes showing for 'normal users' so I've set up a little hidden key to turn them on. If you enter 9999 into the 'Number attending' input then the messages will display.
In the Form OnSubmit Before Email box is the code to check the key
<?php
if ( !$mainframe->isSite() ) { return; }
$count = JRequest::getInt('attending');
if ( $count == 9999 ) {
JRequest::setVar('attending', 1);
JRequest::setVar('test', true);
} else {
JRequest::setVar('test', false);
}
?>This checks the number attending, if it is 9999 then it sets the number back to 1 and sets a 'test' variable to 'true'.Then in the Plug-in Extra Code | 'Extra after onsubmit code' box we have
<?php
$test = JRequest::getBool('test', false, 'post');
if ( $test ) {
global $mainframe;
$mainframe->enqueuemessage('Response code: '.print_r($MyPlugins->cf_Authorize_dotnet['response_code'], true));
$mainframe->enqueuemessage('Response reason code: '.print_r($MyPlugins->cf_Authorize_dotnet['response_reason_code'], true));
$mainframe->enqueuemessage('Response reason text: '.print_r($MyPlugins->cf_Authorize_dotnet['response_reason_text'], true));
}
?>This checks the 'test' variable and is it is true outputs a selection of the 'Useful Variable' messages. (You could add more.)The messages show up as in the image below.
Bob
This topic is locked and no more replies can be posted.
