souzadavi Posted January 29, 2019 Share Posted January 29, 2019 In clientarea.php?action=creditcard there is a error message to user, there is anyway to give a better error message that come from the payment module gateway? Example: I would like to tell my user the real problem and not only: Remote Transaction Failure. Please Contact Support. So I can tell my user, this credit card brand is wrong, or please check the validation date, or your credit card is not able to use in this country. I think it could be more useful, but I got no clue how to print the error message in template from a gateway payment module....This message error come from when the function _storeremote() is executed... Any ideia will be appreciate.... thanks 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted January 31, 2019 Share Posted January 31, 2019 Has to be returned by the module. Since you mentioned the function name, I will presume you are able to edit the module In _storeremote, return rawdata => "the actual error", so like: return array( "status" => "failed", "rawdata" => $results->errorText, ); 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted February 1, 2019 Author Share Posted February 1, 2019 @steven99 but this is only for the log in admin, I would like to show it for my user in client area.... 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 1, 2019 Share Posted February 1, 2019 Ah okay. Thought I saw another function return rawdata that outputted and figured it may work there also. One method may be to do a $_SESSION variable in storeremote, then do a hook for ClientAreaPageCreditCard and return errormessage = 'your error'; so like: <?php add_hook('ClientAreaPageCreditCard', 1, function($vars) { return array('errormessage'=>$_SESSION['gateway_error']); }); but have not tested that and so do not know if that replacement would work. If not, you could set your own template variable with the same method and just update the template file to show it. If session doesn't work, last option is to store the error somewhere else, like a db table, and then output that via above method. 2 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted February 1, 2019 Author Share Posted February 1, 2019 @steven99 thank you very much.... working nicely!!!! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.