Closed (won't fix)
Project:
SOFORT Banking for Ubercart
Version:
6.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2011 at 11:15 UTC
Updated:
3 Sep 2013 at 11:46 UTC
I noticed when i complete payment and returns to the site, it goes to the default page (english in my case)
But users can checkout in 3 different languages (Dutch/German/English)
Now when i complete payment in Dutch or maybe German it returns to the English complete page.
(perhaps this is a issue because my payment isn't working correct yet: http://drupal.org/node/1070384 but i guess it would also do the same when it should work correct?)
Comments
Comment #1
jurgenhaasNot sure to be honest. It may depend on the way how languages are negotiated in your setup but I'm not an expert in that area.
What happens when the session comes back from the payment provider is that the function uc_pnag_payment_success() calls drupal_goto('cart/checkout/complete'); I would have expected drupal_goto to redirect the session to the page in the right language. But again, I'm not sure how languages are handled in your setup.
Comment #2
janton commentedi use the i18 module with the Path prefix only.
i noticed the same thing when i cancel my payment, it then returns to the default language /cart/checkout and not nl/cart/checkout
with the ideal drupal plugin for example it returns to the correct language..(or more the correct prefix) i will check there code now:
http://drupal.org/project/uc_ideal_pro
Comment #3
janton commentedstraingly ideal pro module works the same, but returns in the correct prefix.
They also use: drupal_goto('cart');
But i'm not a programmer but just a starter in all this, so i think i won't find where it goes wrong, or should be different.
I also tested the paypal module and this also works correct with the pathprefix
Comment #4
jurgenhaasAnother difference I have found is that with iDeal they always submit an individual return URL to iDeal and it could well be that this URL already includes the language specific part in the URL.
With Payment Network the return URL is stored in the project profile on their site and can not be changed individually.
Not sure if this analysis is fully correct but I can't think of anything else right now.
Comment #5
janton commentedjurgenhaas thx, i see you mean the abort and succes link?
i see you can add "Possible replacement variables"
so i will check how it respons if i change the url with the right prefix... but i don't know how to add information to -USER_VARIABLE_1- so you get this:
https://www.domain.com/-USER_VARIABLE_1-cart/uc_pnag/payment/success?ord...
https://www.domain.com/-USER_VARIABLE_1-cart/uc_pnag/payment/cancel
but then we need to add user language in that variable.. and i have no idee how to do this? (i guess it's not verry difficult)
So you add -USER_VARIABLE_1- = nl/
and when it's english or the default language i only use /
i will test now if i return to the right language.. with only changing the link
Comment #6
janton commentedok it seems to work!
https://www.domain.com/nl/cart/uc_pnag/payment/cancel
then i return to https://www.domain.com/nl/cart/checkout
:)
now i only need to know how to add somthing in that variable... i will try to code something, only i really really sux in this.
Comment #7
janton commentedOk i have done it :) but not the way it should be i think.. so look to my code:
uc_pnag.pages.inc
https://www.domain.com-USER_VARIABLE_1-/cart/uc_pnag/payment/success?ord...
https://www.domain.com-USER_VARIABLE_1-/cart/uc_pnag/payment/cancel
I think it should be done different.. but it works for me.. but i think i should add the code in somekind of function? i now just typed it above the $data = array
Comment #8
janton commentedi found another problem, but i will open a new ticket for this.. (it's not connected with this ticket but it had to do with languages)
Comment #9
jurgenhaasHave you tested it, does it work this way? Do you get redirected properly to the correct page in the correct language after you have completed or canceled your payment?
Comment #10
janton commentedYes i tested this and it works perfect! (for me)
only i think it should be done different if you want to include such thing in this module.
So it also works correct if a user has a different default language then English
Because i now say in the code that the $language->language != 'en'
Also what if a user doesn't have languages (i18 module) well then i guess that line is also not triggered but...
also i'm not 100% sure $language->language will show all correct prefixes, for Dutch and German and Frans it did.. but i'm not sure how prefixes are created
But this is a good start! (i think)
Comment #11
jurgenhaasOK, let's see if others will come up with similar requirements
Comment #12
jurgenhaasLooks like this is very old and no replies since, so I'm going to close this. Another reason for this is that we've release new releases for Ubercart 2 and 3 and things have changed there a lot, so this older one most certainly doesn't apply anymore.
Comment #12.0
jurgenhaasi thought i could add a link for drupal ticket with #1070384 but it did not work so i will give the full link http://drupal.org/node/1070384