VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: techwarehouse on September 16, 2013, 04:46:48 AM

Title: help setting up OSDS Payment plugin with a fee
Post by: techwarehouse on September 16, 2013, 04:46:48 AM
Hi,

I'm currently running the payment plugin listed here http://www.joomla-payment-gateways.osdcs.com/index.php?option=com_digistore&controller=digistoreProducts&task=view&pid=164&cid=9&Itemid=5

The problem im facing is i cant add a 3 percent fee to this form of payment as it doesnt have a setting for it.

What i would like to know is, is there a way to add this fee in mysql? It seems to have all the fields like cost per transaction i have tried adding a value in but doesn't seem to work. I don't know php but know enough to navigate around and change things.

Any ideas or help would be awesome. I have emailed the people who made it but am yet to hear back after a few days and this is getting urgent as people are placing orders.

Thanks.
Title: Re: OSDS Payment plugin. adding a fee
Post by: Maxim Pishnyak on September 16, 2013, 04:52:13 AM
You could dig available payment plugins, paypal plugin for ex.
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: techwarehouse on September 16, 2013, 04:55:24 AM
Hi,

Sorry I dont understand what you mean by dig available plugins? I need to use this plugin as its the only one that supports DPS payment gateway.
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: Maxim Pishnyak on September 16, 2013, 05:15:51 AM
Dig peace of code for fee from already available plugins - http://dev.virtuemart.net/attachments/download/642/com_virtuemart.2.0.22d_extract_first.zip
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: techwarehouse on September 16, 2013, 06:17:16 AM
Oh okay sorry new to all this stuff.

Okay i have found in the .xml file for the payment gateway the line i have to add which is

<param name="cost_percent_total" type="text"  label="VMPAYMENT_PXPAY_COST_PERCENT_TOTAL" description="VMPAYMENT_PXPAY_COST_PERCENT_TOTAL_EXPLAIN" />

and this exists as a field in the pxpay table in mysql. It shows up as a field now in virtuemart payment for this plugin but when i enter a value and hit save it disappears.

Everything seems to be the same as the paypal plugin is so any ideas what to try?

Thanks.
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: Maxim Pishnyak on September 16, 2013, 06:19:47 AM
Did you found "cost_percent_total" in nearby php file?
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: techwarehouse on September 16, 2013, 06:44:26 AM
Okay im in teh php file now.

The first line under $SQLfields = array says

'cost_percent_total' => ' decimal(10,2) DEFAULT NULL ',


Then further down is this


    function getCosts(VirtueMartCart $cart, $method, $cart_prices) {
   if (preg_match('/%$/', $method->cost_percent_total)) {
       $cost_percent_total = substr($method->cost_percent_total, 0, -1);
   } else {
       $cost_percent_total = $method->cost_percent_total;
   }
   return ($method->cost_per_transaction + ($cart_prices['salesPrice'] * $cost_percent_total * 0.01));
    }


These seem to be teh same settings as in the paypal one.
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: Maxim Pishnyak on September 16, 2013, 16:57:30 PM
You need to remember that if you'd changed files, you need apply these changes in the archived version of your plugin. And then install your modified plugin again.
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: techwarehouse on September 16, 2013, 22:55:29 PM
Hi,

Was performing these on the live version installed on the site.
Title: Re: help setting up OSDS Payment plugin with a fee
Post by: Maxim Pishnyak on September 17, 2013, 10:04:19 AM
Quote from: Maxim Pishnyak on September 16, 2013, 16:57:30 PM
You need to remember that if you'd changed files, you need apply these changes in the archived version of your plugin. And then install your modified plugin again.