News:

Looking for documentation? Take a look on our wiki

Main Menu

Personalize PayPal plugin

Started by Vonavi, August 08, 2013, 00:19:00 AM

Previous topic - Next topic

Vonavi

Hi guys  ;D
I write code in PHP for a while time, but understand all the "hops" in Joomla and Virtuemart codes is really difficult, in fact I was really confused, even though I read the official documentation and PHPXRef for Joomla and Virtuemart, but that's not the point.

I need to implement a verification of the existence of one digital good in an outside web service, before the end customer makes the payment. I would have thought to change the PayPal Virtuemart plugin, but by opening its code, I've understand a little or nothing about its structure and functions.

In practice I would do this:
1. User puts the product in shopping cart
2. User goes to pay for the product
3. Just before it is sent to PayPal for payment, shall be activated one of my PHP scripts (which nothing to do with Joomla or Virtuemart)
4. If my script returns TRUE, everything is going fine as if nothing had happened, but if it returns FALSE, payment must complete stop and not proceed with the redirect to PayPal, perhaps displaying a written inside the shopping cart.

In short, I should put this code:
require ('script.php');
classescript $ var = new ();
if ($ var-> function () === FALSE) {
     die () / / Just for example, while to stop the purchase
}

The problem is that this piece of code I just can not figure out where in the plugin PayPal insert it and if I really have to insert it into the code of this plugin.

Some of you could give me an explanation on this?  :o
Please  :'( Thanks  ;)

Maxim Pishnyak

Quote from: Vonavi on August 08, 2013, 00:19:00 AM
3. Just before it is sent to PayPal for payment

I just can not figure out where in the plugin PayPal...
So you have no ideas where Paypal sends it for a payment?

Come on! There are not so much rows in paypal.php. Lesser then two thousands.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart