nBill Community nBill Home Page
21/May/2012, 11:43:02 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for the nBill home page, or take a tour.  
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Using PayPal Variables  (Read 2157 times)
n.richard
Jr. Member
**
Offline Offline

Posts: 69


View Profile
« on: 02/June/2010, 12:11:27 PM »

Hi,

Is there any way to add PayPal HTML variables to the query when nBill redirects to PayPal? (without hacking PayPal gateway code ;-)
E.g. I would like to add a '&page_style=my_style' variable that allows to use one of my customised PayPal payment pages...

Thanks!
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #1 on: 02/June/2010, 02:40:59 PM »

Other than hacking the code, you could add a new parameter in the database. In jos_nbill_payment_gateway, set the gateway_id to 'paypal', and enter the parameter name in g_key. You can then control the value of the parameter using the gateway settings page and if it is a valid Paypal parameter name, it should be sent through whenever a payment is made.
Logged
n.richard
Jr. Member
**
Offline Offline

Posts: 69


View Profile
« Reply #2 on: 03/June/2010, 12:51:51 PM »

It works like a charm, e.g. for me:

Code:
INSERT INTO `jos_nbill_payment_gateway` (`id`, `gateway_id`, `g_key`, `g_value`, `label`, `help_text`, `required`, `admin_can_edit`, `ordering`) VALUES
(15, 'paypal', 'page_style', 'Europatreffen2011', 'Page Style', 'The custom payment page style for checkout pages. If left blank, the page style that you marked as primary in your Paypal profile will be used.', 0, 1, 14);
Logged
n.richard
Jr. Member
**
Offline Offline

Posts: 69


View Profile
« Reply #3 on: 16/October/2010, 06:40:15 PM »

I tried exactly the same technique for the 'return' parameter but it does not work...

Code:
INSERT INTO `jos_nbill_payment_gateway` (`id`, `gateway_id`, `g_key`, `g_value`, `label`, `help_text`, `required`, `admin_can_edit`, `ordering`) VALUES
(16, 'paypal', 'return', '', 'Return', 'The URL to which the payer ??s browser is redirected after completing the payment. If left blank, the browser is redirected to a Paypal web page.', 0, 1, 15);

Despite all my efforts, this parameter is never added by nBill to the URL when redirecting to PayPal... Any clue?
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #4 on: 17/October/2010, 09:16:09 AM »

In the gateway settings the value of 'Success URL', if supplied, is passed to Paypal in the 'return' parameter. Please note however, that Paypal do not automatically redirect people to the return URL - they just provide a link.
Logged
PeterG
Jr. Member
**
Offline Offline

Posts: 7


View Profile
« Reply #5 on: 04/September/2011, 02:58:03 PM »

Other than hacking the code, you could add a new parameter in the database. In jos_nbill_payment_gateway, set the gateway_id to 'paypal', and enter the parameter name in g_key. You can then control the value of the parameter using the gateway settings page and if it is a valid Paypal parameter name, it should be sent through whenever a payment is made.

It works on our end too.
However, I'd also like to customize the success/failure page (adding lang=de or lang=en ... as we use joomfish)
How do I do this?

Any advice is appreciated.
Peter
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #6 on: 05/September/2011, 10:50:10 AM »

I'm not sure this is possible without hacking the code, but I'm also not clear on exactly how you would like this to work...?
Logged
PeterG
Jr. Member
**
Offline Offline

Posts: 7


View Profile
« Reply #7 on: 05/September/2011, 01:13:14 PM »

Thanks.
Because of the other nBill joomfish issue we decided setup two order forms, one in English and one in German language.

And, we have both, an English language success page and an English language failure page (and each page is also translated into German via joomfish). Please have a look at HappyEscorts.

The intention is, that paypal should redirect the user to either language:
If the English order form was used, they should land at www.***.com/success.html&lang=en
If the German order form was used, they should land at www.***.com/success.html&lang=de
(or to www.***.com/failure.html&lang=en or www.***.com/failure.html&lang=de).

Right now, however, I'm only able to enter a single success URL at the paypal payment plugin.
Where and how do I have to hack the code?

Thanks in advance,
Regards,
Peter
« Last Edit: 05/September/2011, 01:14:57 PM by PeterG » Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #8 on: 05/September/2011, 01:14:45 PM »

Ah you don't need to hack the code for that. As long as you are using the latest version of nBill (2.2.0) you can just use a thank you redirect on each order form (this now overrides the value on the Paypal settings).
Logged
PeterG
Jr. Member
**
Offline Offline

Posts: 7


View Profile
« Reply #9 on: 05/September/2011, 01:16:32 PM »

Of course!
Many thanks for your prompt reply!
Regards,
Peter
Logged
PeterG
Jr. Member
**
Offline Offline

Posts: 7


View Profile
« Reply #10 on: 06/September/2011, 08:06:45 PM »

Thanks again.
But I can only enter the success URL at each order form. How do I tell PayPal which URL to use for payment failures such as:

www.HappyEscorts.com/failure-page.html&lang=en
www.HappyEscorts.com/failure-page.html&lang=de

Thanks in advance,

Regards,
Peter
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #11 on: 06/September/2011, 10:50:14 PM »

I'm afraid there is no feature to help with that, although I'm not even sure if the client would leave Paypal's website if their payment failed so it might be a moot point. You could perhaps hack the code of the payment gateway, but it goes beyond the scope of support I'm afraid.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!