Author Topic: Payment plugin  (Read 378 times)

andrecoolguy

  • Beginner
  • *
  • Posts: 2
  • A beginner
Payment plugin
« 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.

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1608
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Payment plugin
« Reply #1 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

andrecoolguy

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Payment plugin
« Reply #2 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?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1608
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Payment plugin
« Reply #3 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

Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3244
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Payment plugin
« Reply #4 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.