News:

Support the VirtueMart project and become a member

Main Menu

Understand checkout proces

Started by wassie, July 03, 2014, 21:25:40 PM

Previous topic - Next topic

wassie

hi,

I want to use Virtuemart for selling licenses. When a payment is succesfull, I want to trigger a custom PHP script, that will get the license by a API. My problem is that I don't know where I have to place the trigger for my custom script. Can someone tell me where I can find information about the checkout proces and where I can include my scripts?

thank you!

GJC Web Design

What happens after a successful payment is handled by the payment plugin that calls various routines

have a look in a simple payment plugin (authorize etc)

these routines are in orders.php model .. some triggers like function plgVmConfirmedOrder ($cart, $order)

if you have that function in a vmcustom plugin it will be called by the orders.php on a successful payment
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

wassie

Thank you GJC Webdesign for your quick reply!

I have found that file in different directorys, but I guess that you mean the one in /administrator/components/com_virtuemart/models. I also found a $returnValues variable. But I don't know when the default paymentstatus of payment plugin status, is changed, and where I could call my script when the payment is succesfull.

I'm just a starter with PHP.

GJC Web Design

yes - it is the models/orders.php but you don't need to touch it - just look what is happening there and when the plugins are triggered

you need to build a custom vm plugin then to do what u want and that is triggered when the order is confirmed

e.g. on order confirmation any function named function plgVmConfirmedOrder ($cart, $order) in a vmcustom plugin will run
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

wassie

my script will not directly do anything with Virtuemart or Joomla. I want to first connect with a API to retrieve information. Then I want to send that information to my customer. I think it can work, without Virtuemart of Joomla. But my script can only be triggert when the payment was succesfull. So I need to know on which point that is, so where I can include my script.

GJC Web Design

Sorry. this is what I do for a job - I'm not going to write the thing for you.. need more help (which I think I gave enough) .. then employ me

I think I gave you enough pointers
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

wassie

I don't want to hire you, I just want to know how the proces of Virtuemart works. But okay, I respect your point and I will try to figure it out on a different way. Thanks!

GJC Web Design

hmmm - no one ever wants to pay for anything - when your car breaks down do u loiter outside garages asking for advice?

I explained what happens when an order is confirmed and what u need to do to fire your api upon this event... how else will you do it without a plugin?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

I would use a cutomplugin. It also makes sense to ask a pro like us todo it for you.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/