News:

Looking for documentation? Take a look on our wiki

Main Menu

Trouble with payment plugin

Started by edcv, July 11, 2012, 21:52:46 PM

Previous topic - Next topic

edcv

Running VM2.08c

I have a payment plugin similar to the paypal plugin and I'm having trouble with this function call:
$this->storePSPluginInternalData ($response_fields, 'virtuemart_order_id', TRUE);

response_fields are the fields I want to update
The true flag should have it preserve the fields that are not updated but everything is set to default values every time
this function runs.

Is there someone here that has a paypal account and can confirm that this function does not overwrite the fields in 
the _virtuemart_payment_plg_paypal table with default values for everything that is not defined in response_fields?

(This function runs only after the payment has been received.)
all the best

edcv

Workaround was to pick out the data from the database and then write it all in the response_fields as so:

$db->setQuery("SELECT * FROM #__virtuemart_payment_plg_paypal WHERE virtuemart_order_id='".$virtuemart_order_id."'");
$databaseFields = $db->loadAssoc();
$response_fields['virtuemart_paymentmethod_id'] = $databaseFields['virtuemart_paymentmethod_id'];
$response_fields['payment_order_total'] = $databaseFields['payment_order_total'];
$response_fields['payment_currency'] = $databaseFields['payment_currency'];
$response_fields['cancelOrderCheck'] = $databaseFields['cancelOrderCheck'];