Stella

I'm afraid having more problems with this module. The PCI compliance issue when using Realex Remote has become such a pain, that my client has decided to switch to Realex Redirect now that that is an available option with the latest version of the module. So on my dev site I have upgraded the module to 7.x-1.1 and swapped the payment processor to Realex Redirect. When testing, the payment goes through correctly but the Realex site displays an error "Your transaction has been successful but there was a problem connecting back to the merchant's web site. Please contact the merchant and advise them that you received this error message."

I checked with Realex and they said that the response URL sent to them from my site contains too much information - from what they sent me, it contains the whole <head> section from my site - with all the linked CSS & Javascript files etc...

In the logs on my site there are a few errors listed (I've put them in chronological order - I've swapped out the actual domain)

Notice: Undefined index: commerce_order_id in commerce_realex_redirect_checkout_complete() (line 251 of /var/www/vhosts/mydomain.com/dev.mydomain.com/sites/all/modules/commerce_realex/includes/commerce_realex_redirect.inc).

Notice: Undefined index: message in commerce_realex_redirect_checkout_complete() (line 273 of /var/www/vhosts/mydomain.com/dev.mydomain.com/sites/all/modules/commerce_realex/includes/commerce_realex_redirect.inc).

Notice: Undefined variable: order in commerce_realex_redirect_checkout_complete() (line 274 of /var/www/vhosts/mydomain.com/dev.mydomain.com/sites/all/modules/commerce_realex/includes/commerce_realex_redirect.inc).

Notice: Trying to get property of non-object in commerce_order_status_update() (line 1263 of /var/www/vhosts/mydomain.com/dev.mydomain.com/sites/all/modules/commerce/modules/order/commerce_order.module).

Warning: Creating default object from empty value in commerce_order_status_update() (line 1264 of /var/www/vhosts/mydomain.com/dev.mydomain.com/sites/all/modules/commerce/modules/order/commerce_order.module).

EntityMalformedException: Missing bundle property on entity of type commerce_order. in entity_extract_ids() (line 7766 of /var/www/vhosts/mydomain.com/dev.mydomain.com/includes/common.inc).

EntityMalformedException: Missing bundle property on entity of type commerce_order. in entity_extract_ids() (line 7766 of /var/www/vhosts/mydomain.com/dev.mydomain.com/includes/common.inc).

Any ideas how I can fix this

Thanks a mil

Frank

Comments

frankdesign’s picture

Issue summary: View changes
stella’s picture

@frankdesign so first the errors you've listed are all because the data posted to the checkout page are invalid. There's no commerce_order_id, no message variable, etc.

As for what Realex have said about the response url containing the full head tag, rather than just the url, it's set like this:

'MERCHANT_RESPONSE_URL' => url('commerce-realex/redirect/complete', array('absolute' => TRUE)),

So the code just sends the url in that field, not html.

Now, the only other thing that they might mean is that when they load the content of the response url from your site into their iframe, that it contains too much data. Background: the drupal website will send a response url in the request message to Realex. This is just a url (no html). Realex don't redirect back to that url, instead they load into an iframe on their site. The drupal site updates the order when that page is loaded, and outputs 2 lines of html in _commerce_realex_redirect_back() to redirect the user back to checkout/$orderid/complete breaking out of the iframe.

I imagine that they're complaining that when they load the contents of into the iframe, there's too much content perhaps? Perhaps you need to do something in your theme to compress css files or strip down the css that is loaded on that commerce-realex/redirect/complete page to reduce the load on it.

On further thought this is probably the scenario they mean, as otherwise commerce_realex_redirect_checkout_complete() function wouldn't be reached (where you see those warnings appear).

However, it'd be good to clarify what exactly they mean and what size of html response they can handle. Maybe this is obvious from what they've shown you, I don't know.

I presume this is just on the test site so far, yes? I think the quickest way for me to investigate this further if needed would be if you could share access with me or if we can look at it when at the meetup tomorrow night.

frankdesign’s picture

Thanks Stella - you were right.

It is a dev site that I was using for testing and the CSS and Javascript were not compressed. Although when I did compress them, it didn't sort the problem. So then I tried turning off all blocks for the page commerce-realex/redirect/complete and that did solve the problem. I have just tested all test cards from Realex and all are working as they should.

Thanks a mil

See you later at the meet-up

F

stella’s picture

Excellent! Will close this one off after I add it to a 'known issues' list in the readme.

pslcbs’s picture

Hello,

I'm experiencing the same issue and I would like to try the @frankdesign solution "turning off all blocks for the page commerce-realex/redirect/complete" but the question is: you did it on the manual way, block per block or with a script.
If you choosed the second path, could you point me on the good way please?

EDIT: DId it manually and I confirm that it works

Thank you!

frankdesign’s picture

@pslcbs - just to confirm, I did it manually per block as well. Glad you got it working.

Stella - having got it to work on the dev site, when I tested it on the live site, it didn't work :o( I've been on hols for the last two weeks, and only got to do a small bit of testing before I left, so I may need to do more investigating. But at the time I contacted Realex and they said that they don't think it will work as I have a SSL cert and using https on my clients website (I love their uncertainty). I don't really want to go down the road of removing the SSL cert, so before I investigate that, have you come across this before?

F

frankdesign’s picture

Got it sorted. It turns out that Realex have updated their testing environment and it no longer supports SHA-1 or TLS Version 1.0 or 1.1. So if you have a SSL cert on the domain and either the SSL cert uses SHA-1 or the server uses TLS less than version 1.2, then it won't work. In my case, the TLS version I was using was 1.0, hence the error (not that the error was any help as all it said was "Your transaction has been successful but there was a problem connecting back to the merchant's web site. Please contact the merchant and advise them that you received this error message.")

Note: Realex will be updated their live environment in the near future and will be removing support for SHA-1 and TLS 1.0 and 1.1, so if you have a SSL Cert in place, now is the time to check it.

F

7thkey’s picture

I have a similar problem but instead an error message i get a blank screen as a response. The problem has to do with the answer, Drupal prints all styles, scripts and other stuff. The response should avoid going through the TPL's Drupal because Realex gateway does not like too much content as a response.

sandboxpl’s picture

Hi, I've got the same problem, after successfull transaction I've get an error and the script won't redirect me back to the website, I've had a little chat with Realex staff, and I recieved few details about what's happening:

When attempting to connect back we are receiving an error : Too_Much_Data_sent_from_merchant_response_url.
The Response URL is where your response script should be set up.
This script has two functions :
1) To 'accept' the response message sent back with the result of the transaction
2) To define the result message to be displayed to the card holder after the transaction has been processed.

If there is too much information on the response page it will not render correctly and can cause an error to be displayed.

I'm thinking about adding some preprocesses to limit markup displayed on the confirmation page, maybe that's the key..

sandboxpl’s picture

StatusFileSize
new9.21 KB

Here's my proposal:

  1. Alter theme registry and allow module to use it's own template files
  2. Add custom templates for path commerce-realex/redirect/complete
  3. Provide html.tpl.php file without styles, scripts and other additional markup
  4. Provide page.tpl.php file which is rendering content region only

This solution will allow module to do the job and will return ~20-30 lines of HTML, so it should be parsed well on Realex side in all scenarios/configurations.

Tested on D7.41 with:

  • cache and aggregation disabled
  • cache and aggregation enabled
  • advagg module turned on
  • boost module turned on
  • memcached integration turned on
  • zen and bootstrap themes

I think there are multiple ways to limit markup, for example I think my idea is also achievable via few combinations of hook_preprocess_hook(); function and theme suggestions, so please treat this patch as a proposal rather than perfect solution

stella’s picture

hmmm I don't see how the patch would work as hook_theme_registry_alter() only happens when the theme cache is rebuilt, so the call to current_path() would never match.

stella’s picture

Status: Active » Needs work
ikit-claw’s picture

Status: Needs work » Closed (outdated)

Given the amount of time that has elapsed I am unsure if this is needed or even wanted at this point and given that drupal is now on D9 the maintainers won't have time to work on this. If you want to contribute a patch however I am more than happy to review and have it tested. I will make this as closed but if you still want to work on feel free to reopen it.