VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: andrecoolguy on February 14, 2018, 06:59:00 AM

Title: Payment plugin
Post by: andrecoolguy on February 14, 2018, 06:59:00 AM
hey there,
I'm making a new payment plugin for virtuemart 3.x and stuck on duplicating orders on each time confirm purchase button click if payment error, or payment is not enough.
I can't find 'event' or 'method' to check payment before confirm purchase button click. I search forum but has no luck. Any suggestion would be very helpful.
Title: Re: Payment plugin
Post by: Jörgen on February 14, 2018, 07:27:25 AM
If You mean the following. A payment does not get confirmed and You get a pending order. Afaik know is this behaviour not possible to circumvent today, Paypal for example does the exact same thing. The order is first created and then the payment gets checked.

I do not know of any way to get around this withot making Your own payment check to some payment processors API. I know of payment plugins that check the customers address Before payment is checked and order is created, but not where payment check is done Before order Creation.

best regards

Jörgen @ Kreativ Fotografi
Title: Re: Payment plugin
Post by: andrecoolguy on February 14, 2018, 09:11:10 AM
@Jörgen It could be after order created, so then I need to be able to set statuses to order which already created. Simply grab order with order_id from session for example. Then when I do redirect back to cart if payment failed, it generated new order on 'confirm purchase' button click. I guess I need to redirect to somewhere else? Or do I need to remove newly created order?
Title: Re: Payment plugin
Post by: Jörgen on February 14, 2018, 11:49:41 AM
Have You checked the paypal or sofort ideal plugin? They give a good understanding of what triggers and functions to create and use in the plugin.

Jörgen @ Kreativ Fotografi

Title: Re: Payment plugin
Post by: Studio 42 on February 14, 2018, 15:48:44 PM
When you use external paiment, a pending order is created, in case the user do not return to the shop after paiement.
Some other paiment check by ajax on confirm, so you dont need this pending order.
Check standard paiement for eg.