Author Topic: Virtuemart payment IPN  (Read 1284 times)

papelari

  • Beginner
  • *
  • Posts: 5
  • A beginner
Virtuemart payment IPN
« on: April 20, 2016, 11:08:42 am »
Hello all,

We're developing a payment module for Virtuemart. The module is processed offline but we need to comunicate with out module everytime the client has made a payment (machine 2 machine request).

Whats the best way to capture a URL request on our module?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27457
  • Always on vacation
    • Jenkin Hill Internet
Re: Virtuemart payment IPN
« Reply #1 on: April 20, 2016, 11:11:06 am »
VM payments are managed by plugins, not modules.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.10057 on Joomla 3.9.10 PHP 7.0.33
Testing VM 3.5.0.10097 on Joomla 3.9.10

papelari

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Virtuemart payment IPN
« Reply #2 on: April 20, 2016, 11:22:35 am »
VM payments are managed by plugins, not modules.
Sorry! I meant plugin. The paying workflow is completed, all that's left is being notified once the client pays.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Virtuemart payment IPN
« Reply #3 on: April 20, 2016, 23:36:58 pm »
do u mean TO VM when the payment is made?

It is normally a POST to index.php?option=com_virtuemart&view=vmplg&task=notify&tmpl=component&lang=xx

the POST should contain pm=xx  (the id of the payment method) and the order id etc etc a

so any other factors u want to pass/check

in the payment plug u need  a function plgVmOnPaymentNotification () {

check out the skrill payment plugin in VM

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

papelari

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Virtuemart payment IPN
« Reply #4 on: April 21, 2016, 13:10:40 pm »
do u mean TO VM when the payment is made?

It is normally a POST to index.php?option=com_virtuemart&view=vmplg&task=notify&tmpl=component&lang=xx

the POST should contain pm=xx  (the id of the payment method) and the order id etc etc a

so any other factors u want to pass/check

in the payment plug u need  a function plgVmOnPaymentNotification () {

check out the skrill payment plugin in VM

Thanks! Any chance in getting this working using a GET request instead of a POST one?

Also, is it normal that I place an echo "string"; and a die(); and I don't see string in the request response?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Virtuemart payment IPN
« Reply #5 on: April 21, 2016, 13:53:22 pm »
you can write your plgVmOnPaymentNotification () how ever u want it
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

papelari

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Virtuemart payment IPN
« Reply #6 on: April 21, 2016, 14:05:20 pm »
I'm afraid that the function is being called. When I view the page it shows a white page and when I see the source of the page I get the all the code inside the head tag and:

Code: [Select]
<body class="contentpane">
<div id="all">
<div id="main">

<div id="system-message-container">
</div>

</div>
</div>
</body>
</html>

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Virtuemart payment IPN
« Reply #7 on: April 21, 2016, 16:06:37 pm »
I'm sorry.. but this isn't a free coding forum...  the examples are there..  all the payment plugins taht have external notification work the same

If u want to employ me I can code your plugin..

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

papelari

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Virtuemart payment IPN
« Reply #8 on: April 21, 2016, 17:10:21 pm »
I understand.

Meanwhile I've managed to fix the problem, I was declaring the method outside the class.

Thanks for all the help