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
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | commerce_realex_redirect_issues.patch | 9.21 KB | sandboxpl |
Comments
Comment #1
frankdesign commentedComment #2
stella commented@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:
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.
Comment #3
frankdesign commentedThanks 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
Comment #4
stella commentedExcellent! Will close this one off after I add it to a 'known issues' list in the readme.
Comment #5
pslcbs commentedHello,
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!
Comment #6
frankdesign commented@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
Comment #7
frankdesign commentedGot 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
Comment #8
7thkey commentedI 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.
Comment #9
sandboxplHi, 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:
I'm thinking about adding some preprocesses to limit markup displayed on the confirmation page, maybe that's the key..
Comment #10
sandboxplHere's my proposal:
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:
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
Comment #11
stella commentedhmmm 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.
Comment #12
stella commentedComment #13
ikit-claw commentedGiven 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.