As a follow up to my previous post about installing the DIBS module in Virtuemart, there is a poorly documented error you will run into when trying to use the payment module on a live site.
Basically, it will complain about a missing "paytype" which is actually not what is missing. What is missing is the "test parameter" as the error will tell you. After spending too much time trying to fix the "missing" paytype, I tried a different method and deduced that it really was missing a test parameter.
With the default setup, the DIBS payment processor will only send a "test" variable to DIBS when it is actually in testing mode. Makes sense, right?
Unfortunately, when it is not in testing mode, it does not send the "test" parameter to DIBS, as you can see in the above conditional statement.
It is an easy fix. You just need to add a line which will send a "test" value of "NO" to the DIBS payment site when you are not testing the site as shown below:
Basically, it will complain about a missing "paytype" which is actually not what is missing. What is missing is the "test parameter" as the error will tell you. After spending too much time trying to fix the "missing" paytype, I tried a different method and deduced that it really was missing a test parameter.
With the default setup, the DIBS payment processor will only send a "test" variable to DIBS when it is actually in testing mode. Makes sense, right?
if(DIBS_TESTMODE == "YES") { $oid = 'test-' . $db->f("order_id") . '-' . time(); $post_variables["test"] = "YES"; $post_variables["orderid"] = $oid; } else { $oid = $db->f("order_id") . '-' . time(); $post_variables["orderid"] = $oid; }
Unfortunately, when it is not in testing mode, it does not send the "test" parameter to DIBS, as you can see in the above conditional statement.
It is an easy fix. You just need to add a line which will send a "test" value of "NO" to the DIBS payment site when you are not testing the site as shown below:
if(DIBS_TESTMODE == "YES") { $oid = 'test-' . $db->f("order_id") . '-' . time(); $post_variables["test"] = "YES"; $post_variables["orderid"] = $oid; } else { $oid = $db->f("order_id") . '-' . time(); $post_variables["orderid"] = $oid; $post_variables["test"] = "NO"; }
Comments
Post a Comment