VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Federcio2 on November 13, 2015, 09:53:00 AM

Title: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 13, 2015, 09:53:00 AM
Greetings to all,
I'm starting to develop a new method of payment for VirtueMart 3.0.10 (use Joomla 3.4.0).
In practice, the customer, after "Confirmation Order", is re-directed to the payment site by a post xml/html containing the order data (amount, etc.).

What I do not understand, looking the other payment methods integrated, is how/where to save the data I need and then, such as Paypal, make the call to the external page, taking with him the order number, amount, etc.

Someone can help me?

I appreciate any suggestions / help.

Thanks to those who will be kind enough to spend some time for me. :)
Title: Re: Custom Payment Method Develop: can you help me?
Post by: GJC Web Design on November 13, 2015, 21:48:52 PM
study the bundled Skrill plugin .. this is probably the simplest to understand
plugins\vmpayment\skrill\skrill.php
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Studio 42 on November 13, 2015, 21:55:34 PM
The base is here :
http://dev.virtuemart.net/projects/virtuemart/wiki/Payment_plugins
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 13, 2015, 22:29:57 PM
Quote from: GJC Web Design on November 13, 2015, 21:48:52 PM
study the bundled Skrill plugin .. this is probably the simplest to understand
plugins\vmpayment\skrill\skrill.php

Today I looked at the standard payment. If I understand correctly, in this case, after checkout the order is processed but there is no payment.
It's interesting, because to me it would be enough that, after clicking on "confirm order", make a post xml/html which redirects to the page I want.
But if you tell me that Skrill is more intuitive, I'll look too. :)
Title: Re: Custom Payment Method Develop: can you help me?
Post by: GJC Web Design on November 13, 2015, 22:54:02 PM
yes- standard isn't a payment.. it just stores the order and redirects to the thank you..
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 13, 2015, 22:59:36 PM
Quote from: GJC Web Design on November 13, 2015, 22:54:02 PM
yes- standard isn't a payment.. it just stores the order and redirects to the thank you..

Okay, thanks. When the customer presses the button "confirm order", which could be the function that is used for the post xml/html? :)
Title: Re: Custom Payment Method Develop: can you help me?
Post by: GJC Web Design on November 13, 2015, 23:02:28 PM
all in the skrill....   

function plgVmConfirmedOrder ($cart, $order) {
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 13, 2015, 23:06:58 PM
Quote from: GJC Web Design on November 13, 2015, 23:02:28 PM
all in the skrill....   

function plgVmConfirmedOrder ($cart, $order) {

Thank you man. ;)
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Studio 42 on November 14, 2015, 00:05:22 AM
Use debug, fonctionnality, or add break jexit('Im here');
We cannot do all the work for you. YOu have already main information to do your plugin
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 14, 2015, 00:07:46 AM
Quote from: Studio 42 on November 14, 2015, 00:05:22 AM
Use debug, fonctionnality, or add break jexit('Im here');
We cannot do all the work for you. YOu have already main information to do your plugin

Yep, ok. Thanks!
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 16, 2015, 16:11:19 PM
Uhm... In Skrill ConfirmedOrder, there is an iframe, right?
There is a way to make a post form parameterized as a redirect to external site (like Paypal)?
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Studio 42 on November 16, 2015, 17:25:19 PM
TO redirect, you have to submit by javascript on document load.
Fiil all the form with your values(all can be type=hidden) and add a Javascript submit(); in your HTML
DO not remove the submit button, else when ajavascript is not active, you cannot submit the form
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 19, 2015, 16:48:41 PM
Awesome. :) First step is ok.

Two questions for ya:

- How do I create the fields to fill in the payment settings, admin side?
- How can I create the installation of the plugin?

Thank you for all your helps. :)
Title: Re: Custom Payment Method Develop: can you help me?
Post by: GJC Web Design on November 19, 2015, 17:18:06 PM
Honestly.. I think you hit the limit of free help here..
Your questions aren't even VM related.. have you read ANY documentation on how to build a Joomla plugin?????

VM plugs are Joomla plugs
Title: Re: Custom Payment Method Develop: can you help me?
Post by: Federcio2 on November 19, 2015, 17:22:46 PM
Ok, thanks anyway.  ;D