News:

Looking for documentation? Take a look on our wiki

Main Menu

Payment plugin development

Started by smashingpumpkins, October 05, 2011, 22:42:26 PM

Previous topic - Next topic

smashingpumpkins

Hi,

I am about to migrate an existing payment solution from virtuemart 1.x to 2. I have three questions.

I see that everything is different, and the module should now be implemented as a plugin.

1. Does any guides exist for porting from old payment extensions to new payment plugins?

Also i have looked a bit at the standard and paypal solution for v2 - a method called "plgVmAfterCheckoutDoPayment" is used.  But i cannot find any documentation at all about this function.

2. Any fresh documentation that describes plgVmAfterCheckoutDoPayment?

3. Should i wait with the implementation until v2 is more mature and documented, or can i expect the current release to be close to the final thing?

Regards Jens



alatak

Hi,

I rewrote the payment workflow last week.
QuoteAlso i have looked a bit at the standard and paypal solution for v2 - a method called "plgVmAfterCheckoutDoPayment" is used.  But i cannot find any documentation at all about this function.

And added some functions. I still need to update the wiki ...

I will tell you as soon as i have done it.
If you use the SVN you can have a look at the new paypal plugin.


DannyM

i have question :)
how to get paramters in plgVmOnPaymentNotification?

$params->get('some_param');
Web Designer  <- PL|UK : VirtueMart Support
Platform: Mac OsX
http://www.danielmiara.com

alatak

Hi,

Please have a look at the paypal plugin.

DannyM

yes, but in PP function > plgVmOnPaymentNotification dont have parametrs :)
Web Designer  <- PL|UK : VirtueMart Support
Platform: Mac OsX
http://www.danielmiara.com

alatak

Hi,


Quoteyes, but in PP function > plgVmOnPaymentNotification dont have parametrs :)
Are we looking at the same code?

here are the parameters for that function
    function plgVmOnPaymentNotification($pelement, $virtuemart_paymentmethod_id, $return_context, $virtuemart_order_id, $new_status) 


The method called plgVmAfterCheckoutDoPayment has been replaced by:
function plgVmOnConfirmedOrderGetPaymentForm($virtuemart_order_id, $orderData, $return_context, $html)

All the bank payment i know have a return context parameter in their forms. You must send it.
And afaik, this parameter is always sent back with the notification.
This parameter actually contains the session id. It is used when the shopper did not return to the shop after his payment, to delete his cart.

Quote1. Does any guides exist for porting from old payment extensions to new payment plugins?
plgVmOnPaymentNotification corresponds to the notify.php for paypal for example in VM1.
plgVmOnConfirmedOrderGetPaymentForm correspond to the code that was excuted in the "more payment info" in VM1






DannyM

thx, but my mistake
I try add to function plgVmOnPaymentNotification param $params->get('debug')
Web Designer  <- PL|UK : VirtueMart Support
Platform: Mac OsX
http://www.danielmiara.com

DannyM

Web Designer  <- PL|UK : VirtueMart Support
Platform: Mac OsX
http://www.danielmiara.com

alatak

Hi,

Yes i can help.
But what is the question?

DannyM

#9
:)
how add paramter

$params->get('debug')

to plgVmOnPaymentNotification?

I add

$params = new JParameter($paramstring);
$params->get('debug')


Web Designer  <- PL|UK : VirtueMart Support
Platform: Mac OsX
http://www.danielmiara.com

alatak

#10
Hi,
Payment methods are joomla plugins.
The parameters you have in $params come from the xml file.
Please read this
http://docs.joomla.org/Creating_a_Plugin_for_Joomla_1.5

and ofc
http://dev.virtuemart.net/projects/virtuemart/wiki/Plugin_system

DannyM

ok i know
but tell me - why the double set param?

1. once in plugin
2. second in vm payments
Web Designer  <- PL|UK : VirtueMart Support
Platform: Mac OsX
http://www.danielmiara.com

alatak

Hi,

No there is no double set of parameters. There is only one xml file. There is one Joomla plugin.
But you can use several times the same plugin.

Look at the shipping. You have one Joomla plugin, but you can reuse the same ode to create several rates.

You can do the same with the payment.



Milbo

The xml gives you the possible params, as in joomla

But the values must be stored in the datebase, for this we provide some tools, so that plugins can use their own tables.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

DannyM

ok thx
how to send post_variables  method="post"? :)
Web Designer  <- PL|UK : VirtueMart Support
Platform: Mac OsX
http://www.danielmiara.com