Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

Views: 1,170

Results 1 to 7 of 7
1 Aug 2014, 2:08 PM
#1
alexis avatar

alexis

New Zenner

Join Date:
Aug 2014
Posts:
6
Plugin Contributions:
0

EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

I'm using a payment module from Payson for two different shops, and it works correctly apart from one thing; the order confirmation e-mails come with the dynamic texts untranslated when using this payment method. The subject line of the mail is EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT3456, where the 3456 at the end is the correct order id. The first line in the mail is EMAIL_TEXT_HEADEREMAIL_TEXT_FROMOurStoreName, thus, the store name is correct, but the rest isn't and it keeps giving me mostly uppercase names instead of the actual text.

If I choose to pay by invoice instead the confirmation mail is correct. I've been trying to recreate the problem on my local testserver, by using the return address from the payson system locally, but then the mail looks like it should.
The return address from payson is:
http://ourserveraddress/index.php?main_page=checkout_process&payson-method=payson-card-bank&TOKEN=976cbc55-fb45-4dba-979c-55082f2ccc12

The file checkout_process exists in my language (and it works fine with any other payment method)

I've been trying every way I can think of to locate the problem, but can't seem to find it. If anyone could help me out a little, I'd be very happy.

Best regards,
Ulf

1 Aug 2014, 3:20 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

Those UPPERCASE_THINGS are called "constants", and must be "defined" in your language files.

So, two main possibilities here:
a) you're working in multiple languages and haven't set up the definitions for those constants in all your languages
b) your payment module is running an extra script that hasn't properly invoked language handling, and thus doesn't know how to make the correct substitutions. If it's running some sort of callback script, then it probably needs to run application_top.php but isn't doing so.

1 Aug 2014, 8:52 PM
#3
alexis avatar

alexis

New Zenner

Join Date:
Aug 2014
Posts:
6
Plugin Contributions:
0

Re: EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

Thank you for quick response.
I'm working in only one language (but english files are still in there as well) and the constants are defined in the checkout_process language files (which works for any other payment module).

The payment module leads me to a external site where I enter credit card information. At the end of the external process there's a link 'back to store' which has the address:
http://ourserveraddress/index.php?main_page=checkout_process&payson-method=payson-card-bank&TOKEN=976cbc55-fb45-4dba-979c-55082f2ccc12
So I don't think the external process can mess it up by not importing, but it sure seems that the language file is not loaded. When redirected to checkout_success all constants are found. Can the session lose the chosen language when going to the external site, or what else could be happening to make this?

Best regards,
Ulf

DrByte:

Those UPPERCASE_THINGS are called "constants", and must be "defined" in your language files.

So, two main possibilities here:
a) you're working in multiple languages and haven't set up the definitions for those constants in all your languages
b) your payment module is running an extra script that hasn't properly invoked language handling, and thus doesn't know how to make the correct substitutions. If it's running some sort of callback script, then it probably needs to run application_top.php but isn't doing so.

2 Aug 2014, 9:50 AM
#4
alexis avatar

alexis

New Zenner

Join Date:
Aug 2014
Posts:
6
Plugin Contributions:
0

Re: EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

I'm a little bit closer to a solution now at least. I put in a die-statement in the language-file and it was triggered upon returning from the external payment. But only after the mail was sent for some reason.

So I checked the index.php-file. If I put a die-statement before require application_top, I don't get any mail. If I put it after require, I do get the mail, with the incorrect constants. If however, I put the die-statement last in the application_top-file I don't get a mail. And after taking away the die-statement at the end of application-top and reloading the page, I get the mail, with the correct text instead of the constants. This makes no sense to me whatsoever. I've tried the same thing several times and the results are the same every time.

Thankful for any pointers.

Best regards
Ulf

2 Aug 2014, 4:02 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

Sounds like a bug in the payment module. Where did you get the module?

4 Aug 2014, 6:08 AM
#6
alexis avatar

alexis

New Zenner

Join Date:
Aug 2014
Posts:
6
Plugin Contributions:
0

Re: EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

Downloaded via the Payson website (https://www.payson.se/integration/moduler/zencart), but it's contributed by https://www.github.com.

Best regards,
Ulf

DrByte:

Sounds like a bug in the payment module. Where did you get the module?

5 Aug 2014, 2:38 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: EMAIL_TEXT_SUBJECTEMAIL_ORDER_NUMBER_SUBJECT with Payson payment module

Try editing the /ipn_payson.php file and adding the lines 7,8,9 as I did here: https://github.com/drbyte/module-payson-zencart/commit/05ec2dde855503eb7e37673ef0873fa52124de86

I think that'll resolve your problem. If it does, I'll submit it to payson to ask them to include the fix in their next update.