Greek_bank_Eurobank

Contrib type: 
Module
Status: 
Bug testing
Moderation: 
Awaiting moderation

Downloads

Compatibility: 
Ubercart 1.x
Compatibility: 
Ubercart 2.x

module for eurobank's proxypay3 (redirection) system
this module is working for some time in one of my sites.
I 'd say it's complete, but one site is not enough Smiling

waiting for comments

Demo for 1.x version can be found in http://kouzina.com.gr

2.x version was ported with help from Charis ( www.1024.gr )


PreviewAttachmentSize
uc_proxypay3_eurobank-1.x.zip28.34 KB
uc_proxypay3_eurobank-2.x.zip28.9 KB
bserem's picture
Offline
Joined: 07/13/2009
Juice: 30
type of module

Hello Jimkont!

It is very to see that a greek payment module is available Smiling

Could you tell me please, this module is for redirection or makes use of the proxypay API?

Thanks in advance

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
module type

it is for the redirection API

hope it helps!

Jim

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
6.x IE error

6.x IE error!!!

in uc_proxypay3_eurobank.module line 387
change the following code

$form['submit'] = array(
  '#type' => 'submit',
  //'#value' => variable_get('uc_proxypay3_eurobank_checkout_button', t('Submit Order')), // ALLAGi!!!!!!
  '#value' => t('Submit Order'),
  '#attributes' => array('onclick' => '$(this).click(function() { return false; });'),
);

to

$form['submit'] = array(
  '#type' => 'submit',
  '#value' => variable_get('uc_proxypay3_eurobank_checkout_button', t('Submit Order')),
);

in 5.x this was used to prevent double click in submit button

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
Hi guys, Jimkont thanx a lot

Hi guys,

Jimkont thanx a lot for the contribution. Very helpful for the greek community.
I would like to ask for your assit tho.
Since Eurobank requires specific links to function, i am experiencing a problem with multilinual sites. For one project i have greek as default and english as second langueges. This makes my cart and checkout page to be -> blablah.gr/en/cart etc
Therefore when i checkout from my default language site since the language prefix does not exist everything works as it should. I get redirected normally to eurobanks checkout page.
In the case of the english version i dont even get redirected. I simply get an error message and the end Smiling

Does enyone have a suggestion regarding my issue?
Thanks in advance

bserem's picture
Offline
Joined: 07/13/2009
Juice: 30
Re: Hi guys, Jimkont thanx a lot

it is a known problem, GiorgosK managed to bypass it in the Alphabank module (tested and verified by me).

Sadly I haven't used the module by Jimkont and Charis, you could probably help them with it!
I'll talk with Charis and see if he has it fixed.

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
Re: Re: Hi guys, Jimkont thanx a lot

Great, ill be waiting for your response. In the meantime ill try today and tomorrow to see if i can find a way to sort this out.

xaris.tsimpouris's picture
Offline
Joined: 01/03/2011
Juice: 28
Two suggestions

I have two suggestions/solutions.
A) You tell Eurobank to ignore REFERER from the cart review page. Now, you are beeing redirected from a page Eurobank cannot accept, and gives back [ERROR].
So, now you can work with both languages BUT.
When you move to the eurobank page, you always go the language you specified in the eurobank settings - even if in your site you navigate in greek or english. Also, when you come back from the eurobank page, you always come to the predefined language as defined in your multilingual settings.

B) You make changes to the drupal core and to the eurobank settings. (What I have done for a site of mine)
Drupal Core, you have to bypass the function which creates the url's (not at all a good solution, haven't found anything else) so as when you create the cart/review link, you always create it without the language prefix.
Also, you have to make changes to store the user's navigation language in the SESSION so as when the user comes back from the Eurobank, to restore it (as Eurobank has only one link to redirect to afte faile or success). This has to be done firstly in the eurobank module to store the language before leaving, and secondly in drupal core to restore language from SESSION.
Also, you can a small change so as not to go to predefined eurobank language. This has to be done in the eurobank module to check user's language and change the needed value in the Eurobank POST form.

bserem's picture
Offline
Joined: 07/13/2009
Juice: 30
Re: Two suggestions

I also suggest that you talk with GiorgosK who has solved this problem with the Alphabank module!

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
Re: Re: Two suggestions

Thanks for the replys guys. I also sent a message to GiorgosK.
I admit that the suggested solutions above sound a bit time consumming to me but at least i have something to work on now.
Thanks again for your help.

bserem's picture
Offline
Joined: 07/13/2009
Juice: 30
Re: Re: Re: Two suggestions

Don't forget that time consuming isn't always a matter when it comes to community projects (such as drupal and ubercart).

Maybe you come up with an easy and usefull solution that you share back with the rest of the community (just like the creators of these modules did)

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
Re: Re: Re: Re: Two suggestions

Definitely. If i find something ill post back.

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
Re: Re: Re: Re: Re: Two suggestions

i was off last week and i couldn't reply...

i haven't used a multilingual ubercart shop,
in fact http://kouzina.com.gr is my first and last e-shop,
so i wouldn't be able to give you an answer anyway...

Charis and Vasilis have now more experience in ubercart and i guess they 're right

however it's great that my first open-source project is used, supported and contributed...
i guess, this is the definition of the community!!! Smiling

bserem's picture
Offline
Joined: 07/13/2009
Juice: 30
Re: Re: Re: Re: Re: Re: Two suggestions

and it will continue to be used since it was ported for D6U2

as for multilingual sites with ubercart... as charis says "it is a royal pita" but it is possible and it works well

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
Re: Greek_bank_Eurobank

Guys this is starting to convert into a nightmare. From the modules perspective i have tried several things which dont end up somewhere. I have been trying with custom code trying to fool the system even with the use of XMLHttpRequest but not geting anywhere either. I am going to try and dig into drupal core now which i dont really like as a solution and try to figure something out from common.inc and perhaps path.inc.

It would be very helpful if someone who has achieved something in general to post here in more details in order to have a "mpousoula" where to search.

GeorgeK approach is sort of a temp solution to the problem but unfortunatelly has some issues as to the content displayed to the user when after the submit order button is pressed and dont know about where the user is returned after successful or not checkout in alphabanks secure page. I could try and modify the eurobank module in order to have the approach of GiorgosK (meaning an extra in between pay now button page), but i have the feeling that due to the language display my client is not going to accept it unfortunatelly.

Therefore in case someone can spare some knowledge with some detail this would be great, i dont have a lot of time right now so i will have to dig and modify drupal core (and hopefully come up with something) but because this whole thing has hit my ego, ill definitelly try to figure something out after the project ends in my spare time and solve this from the modules perspective.

But for now any drupal code modifications advice is welcome.

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
Just an idea Why don't you

Just an idea

Why don't you create a temp page after submit that will always (automatically) redirect you to the Greek version (goto 301) before you submit the purchase.
this way the referrer will always be the the Greek version to Eurobank
and do the opposite on the return page
(keep the language and redirect the user to the proper language)

xaris.tsimpouris's picture
Offline
Joined: 01/03/2011
Juice: 28
@jimkont You mean before

@jimkont
You mean before navigating the cart/review page? Then the cart/review page will always be in Greek, which apparenlty will be an issue for non-greek users.
However, in case you mean something else, you automatically redirect to a page and send GET information. You cannot send POST information automatically.
Maybe through javascript onLoad="form.submit()", would be a solution but also a submit button should be seen in case javascript is disabled.

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
Re: Greek_bank_Eurobank

Hmmm If i understantd correctly you meen something like what happens here during checkout

http://www.artemispetfood.gr/en

but withought asking the user to click pay now? Something more automated with onLoad javascript?

EDIT:

heh @xaris.tsimpouris

Talk about coincidence Sticking out tongue

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
@xaris You are right about

@xaris
You are right about the post....

i meant an intermediate page between submit and eurobank

It could be made more stylish as a new page with a message to the user
"You will be redirected to Eurobank server... blabla blabla...
press ok to continue

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
@jimcont This is what

@jimcont

This is what GiorgosK has done but in this case the rest of the page will be in Greek (Default language).
Menus, titles, etc

xaris.tsimpouris's picture
Offline
Joined: 01/03/2011
Juice: 28
Re: Re: Greek_bank_Eurobank

Yes, however you have to be careful so as to be browser-compliant as far as possible, in case Javascript is either enabled (fully automatical) or disabled (manually).
Also, the problem still exists when the client returns from the eurobank either succesfully or not.

PaniX's picture
Offline
Joined: 01/27/2010
Juice: 95
Re: Greek_bank_Eurobank

Regarding the return...i saw you have support for i18n multilingual variables for these two links

uc_proxypay3_eurobank_redirect_success
uc_proxypay3_eurobank_redirect_error

could it possibly do the trick?

In the part where

if ($status == 'Confirmed' || $status == 'Validated') {
if ($status == 'Validated')
drupal_set_message(variable_get('uc_proxypay3_eurobank_card_pending', ''));

$_SESSION['do_complete'] = TRUE;
drupal_goto(variable_get('uc_proxypay3_eurobank_redirect_success', ''));
}
else {
drupal_set_message( variable_get('uc_proxypay3_eurobank_card_error', '') . $status);
drupal_goto(variable_get('uc_proxypay3_eurobank_redirect_error', ''));
}
return ;

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
The return is easy... you can

The return is easy...
you can store the language in the database table and read it on return
and if it is different redirect to the proper page

the site language is the problem
you might be able to change the language programmatically
http://stackoverflow.com/questions/2261303/drupal-how-to-set-theme-langu...
found it (haven't used it)

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

Hello,
I have a problem with this module. It redirects me to the site front page instead of the Eurobank payment page. Any idea about this issue?

Best regards,
Nicholas

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
Re: Faulty redirection

Can you provide more details?
Drupal / Ubercart / php version
Did you setup all the needed configuration (password, urls, etc)
Do you have a demo or a full account?

Best,
Dimitris

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

I appreciate your fast reply.
It's an old site and unfortunately I can't make any update on this due because of too many customizations. Any update will break something. So I have to make the Eurobank payment to work as it is.

PHP Version 5.3.3-7+squeeze13
Drupal version 6.20
Ubercart version 6.2

I appreciate any help.
Thank you in advance,

Nicholas

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

..... I've done all the settings in the module. I kept the default urls and I gave them to the Eurobank for their settings.....

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
Re: Faulty redirection

Can you also check any messages in dblog?

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

Hi!
Maybe you have to know that Server is running with Suhosin.
I don't know how to check the dblog. I tried hard to find something with no luck. The server mysql log file is empty. Would you help me where to look for?

Best regards,
Nicholas

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

Hello,
I have good news!
Suddenly it worked. I tried it once again and it redirected me once to the eurobank page. But, when I used the browser "back" button and tried again I saw a blank page at https://ep.eurocommerce.gr/proxypay/apacs
No I see only this blank page
Perhaps is a Eurobank issue?

Best regards,
Nicholas

jimkont's picture
Offline
Joined: 10/16/2008
Juice: 63
Re: Faulty redirection

I was talking about these 2 pages for errors
/admin/reports/dblog
/admin/reports/status

You should also create a new order and resubmit in case there was an error with the previous order id

Then you should also check with Eurobank and see if they logged any error in the transaction

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

Hello again.
I think it starts work.
It seems like bank keeps IP's and block repeating requests.
We'll make some more tests.

Best regards,
Nicholas

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

Hi!
No there are not any errors. The system seems to work now. It's very strange. I still test it.

Thank you very much.

npapazoglou's picture
Offline
Joined: 12/11/2010
Juice: 29
Faulty redirection

Hello,
this is my final update.
The module works as we expect.
So, I believe that the bank needs more hours to work correct with new accounts. There is no other explanation...

Thank you very much.