4 replies [Last post]
j_ten_man's picture
Offline
Joined: 03/07/2008
Juice: 78
Was this information Helpful?

I don't know how to log feature requests, so hopefully this is the place. I was wondering if you would be possible to make the VERSION a variable that can be changed on the 'admin/store/settings/payment/edit/gateways' page. I am requesting this because 3.0 causes errors for trying to set up recurring payments with direct payments. Here is the link from the PayPal site where I am getting this from:

http://www.paypaldeveloper.com/pdn/board/message?board.id=nvp&thread.id=...

Please include this in your next updates so that we can easily change this through the UI. I would prefer to just use this API calling function rather than writing mine own which will be the exact same except 3.0 will be 50.0. It seems like a real waste.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Add the VERSION as a variable that can be changed.

Hmm... I'm not sure what you want the version of... Puzzled

Also, I did add uc_version() at the request of a developer to 1.3... it just returns the UC version string. The Drupal version can be assumed based on a module's .info file or found in the constant VERSION. But I'm not sure why they didn't make that DRUPAL_VERSION or something. Perhaps that's what you were referring to?

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Add the VERSION as a variable that can be changed.

That looks like the API Version? Is that a constant set somewhere before the request is made?

Also this forum on the PayPal site refers to it as the "NVP" API. I've never heard of that before... is that the PayPal Pro API?

--
Help directly fund development: Donate via PayPal!

j_ten_man's picture
Offline
Joined: 03/07/2008
Juice: 78
Re: Re: Add the VERSION as a variable that can be changed.

Sorry - I know I didn't make myself super clear (I had been working on this too long). So I will try and make things a little clearer. First of the NVP stands for Name Value Pair. It is simply one of the APIs that PayPal has. It is the API that is used by the developer that wrote the uc_paypal module.

So, one of the name value pairs is VERSION=3.0. the value for 'VERSION' is required by the 'NVP API' to create a request. In the uc_paypal module there is a function that adds this value to all the API requests sent to PayPal in the uc_paypal_api_request() function. You will notice that it is hard coded to 3.0, however this needs to be changed to a variable in order to account for the fact that some API calls require a different value for this.

Hopefully that is more clear. If you have any other questions then let me know.

Oh yeah, I am not sure what the VERSION number actually stands for but I believe it is the version of the PayPal API that you want your code to be called on. Ok - that is correct. Here is the post about the PayPal API VERSION: http://www.paypaldeveloper.com/blog/article?blog.id=devblog&message.id=511

--EDIT---
Here is a good explanation of the NVP API:
The PayPal Name-Value Pair API (NVP API) enables you to leverage the functionality of the PayPal API by simply sending an HTTP request to PayPal and specifying request parameters using name-value pairs. The NVP API is a lightweight alternative to the PayPal SOAP API and provides access to the same set of functionality as the SOAP API.
Source: https://www.paypal.com/IntegrationCenter/ic_nvp.html

j_ten_man's picture
Offline
Joined: 03/07/2008
Juice: 78
Re: Re: Re: Add the VERSION as a variable that can be changed.

Just as a note on this, it should be 50.0 or 3.0 (not 50 or 3). Just wanted to note this so that the formatting is correct when this is implemented in the module.

The function where the variable gets set is uc_paypal_wpp_settings_form(). It makes the most sense under the $form['paypal_wpp']['api'] fieldset.