SHA256 will make current implementation of commerce sermepa obsolete, I think we should take our chances and go for an integration using https://github.com/facine/sermepa which solves the issue and will be more maintainable.
Find attached an initial patch to test.
Comments
Comment #2
pcambraInitial review.
Do we want to use master?
we probably want to change the namespace to something else
Releases sound like a much better option
I don't think this wrapper is needed, you are already checking this in hook_requirements
we shouldn't name the function init, there's a hook_init and can be confusing
This will fail in php 5.3 I think, better to split it or to use if (! $settings...
libraries offers a way to know if a library has been loaded, no need to build our own.
The point of a try catch is to do something in the catch, I wouldn't do this here.
We need a way to do this without 4 ifs
not sure why we have try catches everywhere now :D
why don't just return $settings, avoid doing breaks here.
$settings can be initialized to an empty array so this function always return the same thing.
Why the change of Terminal?
Commerce Order, object doesn't add anything to the description
Same pattern as above, if (!$gateway or split
More trys?
Is this the Terminal? we had that in the settings above
Another try! :D
Comment #3
facine commentedHi Mr. Peter, thanks for your review!
This new patch solves 1, 2, 3, 5, 6, 8, 9, 10, 11, 13, 14, 15 and 17 points.
About 4 and 7 points, libraries_load don't throws any message, and would be easier localize the error in this way. hook_requirements just show us the error if we go to admin/reports/status
About 12 point, we have two environments, TEST and LIVE, LIVE terminal is usually 001, but not the other. I have removed the default, because we have also configured the test environment as default. I created this another issue to try to solve this problem creating credentials for each of the environments. #2603264: Add credential settings for LIVE and TEST environments
About 16 point, this for Sermepa user interface language (001 -> Spanish), create a new settings to the default language, and change the value order language is different and it is in the list of available languages? There is a issue about this: #2042253: Ds_Merchant_ConsumerLanguage in other languages
I look forward to your further review.
Thanks!
Comment #4
pcambraI disagree here, you're custom solving something that comes from libraries, admin/reports/status is enough because it will show up as a status message, we're doing a lot of extra work on loading the library and showing messages around in runtime when this is an install problem.
I'm not sure right now if these messages are clear enough or we need to do a reference to sermepa here.
Probably "Create" is better wording.
It seems a very odd parameter to me, one is a url one is a mode?
I would do it a bit different to simplify the code:
If no response or feedback is false (not sure if feedback could come up with the sermepa original error), watchdog and return.
$settings = array(), signature says you're returning an array.
Is this needed? shouldn't it be $form_state['rebuild'] = TRUE instead?
This needs a solid doc for the parameters
How can be this stored in the gateway?
Comment #5
lukitaBrands commentedHello Mr. Cambra, thank you for your contributions.
I have this same problem on a production site and I decided to use the solution recommended here, obviously first in a development environment.
I am eager to try it once my client authorizes me to use this patch.
I will return here to write my experience, if it helps.
Comment #6
facine commentedThis solve all points except last one, we have only to modify the library, create a new release and deploy it.
I look forward to your hard and new review.
Thanks!
Comment #7
pcambraNice work @facine!
I think the only thing pending here is to handle the storage of the feedback in the main class.
What if there's no $library? is such case possible?
We need a watchdog log here.
Comment #8
facine commentedThanks @pcambra!
And with that and a biscuit, the only thing pending here is to handle the storage of the feedback in the main class.
Comment #9
GoddamnNoise commentedHi,
I've received today a warning e-mail from Redsys talking about the incoming change that will make SHA-1 obsolete. This change will be made in November, 23th. But I think this is not the only change Redsys will make on that date. I've been reading the documentation provided by Redsys in the e-mail and on that documentation you can see a migration guide.
In that migration guide you can see a summary of the changes that will be made on November, 23th. And those changes are not only related to the substitution of the SHA-1 algorythm in favor of the SHA256 algorythm. Besides that, the format of the parameters sent between the website and the Redsys system will change too (see the point #2 on the migration guide).
Does that patches in #8 adapt the module to all of these changes?.
Comment #10
pcambra@GoddamnNoise, yes please try it out and provide feedback
Comment #11
GoddamnNoise commentedHi pcambra,
Thanks!. Ok, I'll try it asap. Maybe next week i'll be able to do some testing.
Comment #12
fraibsa commentedHello, I'm not an advanced user (sorry) but I would like to contribute what I know. For example testing the module because I have a TPV Virtual with Banco Sabadell running SHA-1 and now is not working because Banc Sabadell change my account to SHA256.
I patched the dev version with the last patch and install the module in my website.
Installation ok, but when I go to Admin>strore>settings>Payment methods and edit the action "Activate the payment method" appers the next message:
" Fatal error: Class 'CommerceRedsys\Payment\Sermepa' not found in /home/naranja/public_html/sites/all/modules/commerce_sermepa/commerce_sermepa.module on line 216 "
Comment #13
GoddamnNoise commentedHi, fraibsa,
I think you should install the sermepa library too. You'll need the libraries module and then you should download sermepa library from Github. Once downloaded, you should copy the extracted folder with the name "sermepa" to the "libraries" folder. So, you'll have something like:
.../sites/all/libraries/sermepa
Hope that helps!.
Comment #14
GoddamnNoise commentedHi again, facine and pcambra,
I've tried to test the patch, but i couldn't because of the use of namespaces, which are only available for PHP >= 5.3.0, so I'll have to move my site to another server with PHP >= 5.3.0 to be able to test it.
Comment #15
GoddamnNoise commentedHi again,
I've moved the site to another server with PHP >= 5.3.0 and tried to test the patch in the test environment. When the commerce_sermepa module has to redirect the user to the payment gateway, an error happens and it keeps trying forever to do the redirect and getting the same error each time.
This is the error reported:
Warning: Illegal string offset 'method_id' en commerce_sermepa_get_payment_settings() (línea 140 de .../sites/all/modules/commerce_sermepa/commerce_sermepa.module).And this is the code fragment where the error happens (the error is thrown by the if sentence):
Inserting a dpm($action) inside the foreach sentence before the if sentence, this is what the $action object contains:
So, is the "['method_id']" part necessary?.
And here it comes the amazing part: if i remove the "['method_id']", then i don't get the error, but instead of being redirected to the payment gateway, i get the site maintenance page!!!!!. WTF!?.
So, I think there is a problem too with the sentence:
return $action->settings['payment_method']['settings'];Because
$action->settings['payment_method']is a string, not an array.Update: inserting a dpm($rule_config) before the foreach, this is what i get:
I think this problem is happening because you are retrieving this rule information:
$rule_config = rules_config_load('commerce_payment_commerce_sermepa');But I have that rule deactivated and I'm using a cloned rule in my test environment. So, shouldn't rules_config_load() retrieve the information of the cloned rule instead of the default commerce_sermepa rule?.
Comment #16
GoddamnNoise commentedHi again,
I've been digging deeper. This is what i've done: i've deactivated the cloned rule i was using in my test environment. Then, I've activated the original Sermepa rule and i've configured this rule with the Redsys TPV's test environment data.
Then I've tried to pay with the Redsys TPV in the test environment. This time I haven't gotten any errors before the redirection to the payment gateway. So, I think that my theory from the previous post was true. So, I think that when rules_config_load function is called, it shouldn't retrieve the information from the "commerce_payment_commerce_sermepa" rule, it should retrieve the information from the actual sermepa rule you are using to make the payment.
Once i've been redirected to the payment gateway page, an error is shown. It seems that the order number and the order amount are not being correctly passed to the payment gateway.
I've made a screen capture i've attached to this post.
Update: digging even deeper. Repeating the last test, i've looked into the HTML code of the error page (that one on the screen capture) to find the error code. This is the error code:
<!--SIS0042:-->This code means that the sign received by the payment gateway is not correct. So, i have a question: which is the "Merchant SHA256 Password" for the payment gateway's test environment? is it the same that for the production environment? or is it the same test password used by the old SHA-1 system?.
Update: I've changed the test password used by the old SHA-1 system to use the new SHA256 password from the production environment, but i get the same error. So I think that's not the problem and maybe there is something wrong in the signing procedure.
Comment #17
GoddamnNoise commentedHi again,
I've been doing more tests. This time I've been trying to find out if it's a problem with the signing procedure. To find out, I've modified the getParameters() method of the Sermepa class inside the Sermepa.php file of the Sermepa library to control the values returned when that method is called. After that, I've modified the ejemploGeneraPet.php file provided by Redsys to use the same values. Then, I've compared the values returned by both for the Ds_MerchantParameters and Ds_Signature parameters. What i've found is that the values for those parameteres are not the same. The parameters computed by the commerce_sermepa module are different from those computed by the Redsys demo file. So, it seems it's a problem computing those parameters after all (if i haven't make any mistake during this test).
Hope this helps. Is there any way I could provide more help?.
Comment #18
David Hernández commentedOk, I've tested this on the test environment. Here are the steps I followed:
After this, I tested the full commerce process and everything worked like a charm. So, on my side, this is RTBC. I'm going to try it next on the live environment. I will update the issue as soon as I have tested it.
Some side notes:
Great work, facine!
Regards,
David.
Comment #19
David Hernández commentedI confirm that the patch also works on the real environment we are correctly handling payments through commerce_sermepa with the SHA256 algorithm.
Comment #20
GoddamnNoise commentedHi David,
I've followed the same steps you have, but, as you can see in my previous posts, it didn't work for me (no customized commerce process in my case, same Drupal Commerce version). Which "SHA256 Merchant Password" have you used for the sermepa test environment? Same password you were using for the sermepa test environment before patching the module?.
Comment #21
David Hernández commentedNo, the test environment password is also different. The bank provided both signatures upon request, the test environment and the live environment.
Comment #22
David Hernández commentedSeems that the #2434137: Ds_Merchant_Titular used with the wrong data issue is back. The comment says set merchant titular but we are invoking setMerchantName($settings['DS_MerchantName']).
Should we also add a new line with the function setTitular() or should that line be replaced with a setTitular call?
In our environment we are dinamically changing the Merchant Titular on a hook and this patch broke it.
Comment #23
GoddamnNoise commentedHi David,
Thanks, I'll ask for the new test environment password to be able to do more tests.
Comment #24
David Hernández commentedAfter more investigation I found out that the current implementation of the module, doesn't allow to modify the data sent to Sermepa / RedSys, because now it goes cyphered. And the data is cyphered before the form alter is called. And as the $gateway object, the $payment_method or the $order are not available, is not possible to modify the data and cypher it again.
Here is where we cypher the data, instead of doing it before the sumbit. I didn't find a way to call this on the _validate hook, where the redirect to the Sermepa platform is done.
Instead, I decided to put the $gateway object in the $form, so I can get it from a form_alter and call again the composeMerchantParameters() and the composeMerchantSignature, so I can modify the data.
Attached you can find the patch, that only adds an extra line.
Here is a sample of how the form alter can be implemented, just in case someone else needs it:
Comment #25
David Hernández commentedSorry, there was a small mistake on the patch. New patch and interdiff attached.
Comment #26
omarlopesinoPatch #24 worked for me, i could complete a payment in a dev environment (test).
The order is completed and hook_commerce_payment_order_paid_in_full is invoked.
Thanks!
Comment #27
cemana commentedHi David, thanks a lot for your work.
I have druppal commerce 7.x-1.10 and I would like to test your solution.
To test it, do I have to overwrite the commerce_sermepa.module with your patch? and to copy the file interdiff.txt in the commerce_sermepa folder? Or anything else?
Thanks a lot.
Comment #28
fraibsa commentedI achieve a complete payment with the patch #24 in TPV TEST mode. Good Job!
On the other hand, in the order list view the payment methot appears "unknown". I'm not sure if problem is caused by this module or another think. I try.
thanks
Comment #29
GoddamnNoise commentedHi,
After much more testing, I think my previous problem was not related with the patch. There must be something broken somewhere in my Drupal installation. Maybe some other module is the cause of the problem.
So, I've made a fresh install to test the patch again. I'll provide more feedback when tested again the patch in the fresh install.
Comment #30
David Hernández commentedHi cemana,
Thanks to facine and pcambra, who have made most of the work on this issue and the module itself. I only tested it and fixed a minor thing.
The interdiff is only to show the differences betweet the last patch and the previous one, so the people reviewing it can quickly see the last changes.
So you need to clone from git the last dev version of the module ( https://www.drupal.org/project/commerce_sermepa/git-instructions ) and apply the last patch ( https://www.drupal.org/patch/apply or https://www.drupal.org/node/1399218 ).
To summarize: you don't need to do anything with the interdiff and instead of replacing the .module file, you need to apply the patch, as specified on the links.
Best regards,
David.
Comment #31
cemana commentedThanks David,
I am doing this process...to download last dev version, to apply patch... there is a warning: 2 lines add whitespace errors.
I get Error server 500 when I want to edit the action to introduce the values of Redsys (/admin/commerce/config/payment-methods/manage/commerce_payment_commerce_sermepa/edit/3).
Any suggestions?
Best Regards,
Comment #32
GoddamnNoise commentedHi cemana,
Check your PHP version. As I stated in one of my previous posts, the patch uses namespaces, which need PHP >= 5.3.0 to work. Probably your PHP version is under 5.3.0 and that is the cause of your Error server 500.
Comment #33
cemana commentedOK, this was the problem...GoddamnNoise. Thanks.
Comment #34
David Hernández commentedOk, yes a few more things:
You need the version 5.3.0 or superior of PHP. You need to have mcrypt installed and enabled for php (sudo apt-get install php5-mcrypt; sudo php5enmod mcrypt; sudo service apache2 restart).
The error of the whitespaces is just a warning. Shouldn't be a problem, but yes, it should be fixed.
And the last issue, that URL is probably unique from my environment because I have multiple payment methods. Still you can find that page starting from the url admin/commerce/config/payment-methods
Comment #35
GoddamnNoise commentedYou're welcome, cemana.
I think that this issue about the PHP version and the PHP5 mcrypt module should be noted in the module description and the README file when the new version of the module will be released.
Comment #36
cemana commentedThanks everyone.
It works for me.
Bank: La Caixa
Comment #37
jlafu commentedHi guys, is this going to be on a new release of the 7.x-1 branch before November 23rd, or should I move to the dev branch and patch it?
Thanks for your answer and sorry for asking this here if this isn't the right place for asking about new release planning (please tell me where to ask about that in case it isn't).
Comment #38
pcambra@jlafu could you help testing it? the sooner we get it tested and reviewed, the sooner it'll be released!
@David Hernández thanks a lot for helping out here! it would be really useful to include your instructions in #34 in the readme and project page :)
Comment #39
jlafu commentedOK @pcambra, I'll give it a shot later in the day!
Comment #40
facine commentedMy last approach, anyone can test?
It would be great if someone could make a video explaining how to use the module, especially the parts of the configuration and use of the new function to overwrite the values of the gateway via rules.
Comment #41
GoddamnNoise commentedHi facine,
I'll test it. I hope I'd be able to do some tests this afternoon/night.
One question I don't know if you've considered. In my first tests with the first patch I couldn't make it work. After some debugging I found the problem: I was using a cloned rule instead of the default commerce sermepa rule. So, my question is: with this last patch, should it work with a cloned rule?. I think that in the first patch, the rule information is retrieved for the default rule only:
Comment #42
facine commentedComment #43
GoddamnNoise commentedHi facine,
I can't apply the patch to do the tests. I've downloaded the 7.x-1.x branch from the git repository using:
git clone --branch 7.x-1.x http://git.drupal.org/project/commerce_sermepa.gitAfter that, I've downloaded the patch from #40, and tried to apply it with git apply. I've gotten an error reporting the commerce_sermepa.api.php file doesn't exist. I've created an empty commerce_sermepa.api.php file and tried again. This time, the commerce_sermepa.rules.inc file doesn't exist. So, I've created an empty one and tried again.
This time, the git apply fails with this error:
Am I doing something wrong?.
Comment #44
facine commentedComment #45
enricperaI've tested #25 with #34 and it works, but not register payment transaction. Not print the transaction ID on Order payment tab it left empty.
I'll try #44 patch
thanks for hardwork
Comment #46
David Hernández commentedShould we use the markdown syntax?
We are missing PHP 5.3.0, mcrypt and the Sermepa library.
Examples are cool
Should we check here if the mcrypt library is enabled?
If we are using Sermepa / Redsys in the rest of the module, shouldn't we keep it in that way?
is the $order really necessary?
Comment #47
GoddamnNoise commentedHi facine,
I've downloaded the 7.x-1.x branch from the git repository using:
git clone --branch 7.x-1.x http://git.drupal.org/project/commerce_sermepa.gitThen, I've created this empty files:
Then I've applied the patch in #44. This time the patch applies without errors and with this warnings:
I'll try this patch asap (hopefully this afternoon) and will come back here to provide feedback.
Comment #48
GoddamnNoise commentedHi again,
I've removed the previous version of commerce_sermepa module (which i had patched with the previous patch) with the new patched one (with the patch in #44). I've updated the Sermepa library to the lastest version. I've run the update.php script.
After that, I've tried to complete a payment with the payment gateway's test environment configuration but when i get to the payment redirection step in the checkout process, i get the site maintenance page. This is what was logged in Drupal's log:
Comment #49
facine commented@GoddamnNoise, clear cache or resave the payment settings, we have new setting variables.
We should add a new hook_update_XXXX!
Thanks for testing
Comment #50
pcambraNot sure why you would do all this here, I think the library should be loaded already and then is just one line, if you need to use it elsewhere I think is fine to do Sermepa::method()
Comment #51
GoddamnNoise commentedHi again,
After resaving the payment settings (i didn't notice the new setting at the first glance) and clearing the cache, I've tried again to do a payment using the payment gateway's test environment configuration.
This time I could complete the payment. I've logged in the payment gateway's test environment administration website and checked for problems. It seems there were no problems and all the payment is correct. The asynchronous HTTP notification was sent back to my website and was correctly processed by the sermepa module.
If I edit the order, on the "Pago" tab, all seems to be ok now: the payment method is correctly filled and more information is provided. Clicking on the "See" link seems to work properly too. Then only field that is not set is the "Estado remoto" field, which is left blank.
Hope this information helps. Let me know if you need me to do any other tests.
Yes. A hook_update_XXXX should be added to avoid these kind of problems.
Please, could you answer my question in #41 (when you have the time to do it)?.
Comment #52
facine commented@GoddamnNoise We are thinking about how to resolve your issue.
Comment #53
GoddamnNoise commentedOk, thanks!. Let me know if i can help.
Comment #54
facine commented@GoddamnNoise This new patch should solve your problem. I can not test the asynchronous HTTP notification, can you test for me?
Thanks!
Comment #55
GoddamnNoise commentedHi again, facine,
I've made a git clone of the 7.x-1.x branch of the commerce_sermepa module, then i've applied the patch in #54. After that, I've run the update.php. Then I've tested the default commerce_sermepa rule with the payment gateway's test environment configuration. I was able to complete a payment. The HTTP asynchronous notification succeed too.
Then I've configured a cloned rule with the payment gateway's test environment configuration, and i've configured the default commerce_sermepa rule with a wrong SHA256 Merchant Password. Then I've disabled the default rule and enabled the cloned rule. Then I've tested again. I was able to complete the payment. The HTTP asynchronous notification succeed too.
So, It seems that this new patch solves all the problems detected until now.
Let me know if you need more testing or if i can help in any other way. Nice work!.
Comment #56
pcambraI don't think we need to translate PHP Mcrypt
Comment doesn't corresponds with what the function does, we're clearing caches, not resetting anyone's data
Why don't you use the "initialize" function here?
Not sure how getFeedback can be a static method of the class.
Method name with are is a bit weird, validSignatures() should do it
Comment #57
facine commentedhello!
Comment #58
facine commented@GoddamnNoise can you test it again?
Thanks!
Comment #59
GoddamnNoise commentedHi again facine,
I've followed same steps as in #55 for the new patch in #57. This time, when i've tried to complete a payment with the default rule provided by the commerce_sermepa module and the payment gateway's test environment configuration, I was able to complete the payment, but the asynchronous HTTP notification didn't work.
If I go to "Store > Orders" and edit the order, when i go to the "Payments" tab, there is no information on that tab, only the message "No payment methods available to add payments." and the order balance amount.
If i login into the payment gateways's administration website and check for the asynchronous HTTP notification, it logged an error:
-1 Server returned HTTP response code: 500 for URL: .../es/sermepa/callback/130
Checking Drupal's log, it logged an error too:
URL: http://...es/checkout/130/payment/return/JQmNwAg7wRe6YgcBt26tVPykYRNqxtq...
Message: Bad feedback response data.
Comment #60
facine commentedHave you update Sermepa library?
Comment #61
facine commentedSorry, i think this is the last one!
GET response works for me, only need you test POST method.
Also update Sermepa API
Thanks!
Comment #62
GoddamnNoise commentedHi facine,
No. I didn't notice that the Sermepa library had changed. I'll update the sermepa library and then I'll try the new patch. I'll provide feedback as soon as possible.
Comment #63
GoddamnNoise commentedHi again, facine,
I've updated the sermepa library, then I've patched the commerce_sermepa module with the patch in #61. When I've applied the patch, this warning appeared:
After aplying the new patch, I've executed the update.php script and then I've tried to make a payment with the default rule provided by the commerce_sermepa module, using the payment gateway's test environment configuration. I've been able to complete the payment with success. This time the asynchronous HTTP notification worked ok. When I edit the order, in the "Payment" tab all seems correct, except for the blank "Estado remoto" field showed when clicking on the "See" link (I've already noticed that in a previous post, but I don't know if this is important, so I tell you, just in case.)
When I log in the payment gateway's administration website and look for notifications' information, it seems all correct now. No errors reported.
But, when I've checked Drupal's logs, this time 18 PHP warnings appear. These are the warnings' messages (all of them happened on this URL: ...es/sermepa/callback/134):
These warnings didn't happen with previous patches.
After that, I've filled the SHA256 password with a wrong password, deactivated the default rule and activated the cloned one with the payment gateway's test environment configuration and tried to pay again.
The results are the same that for the default rule.
Comment #64
facine commentedCan you change in commerce_sermepa_callback function the last return from TRUE to FALSE and test again? (commerce_sermepa.module)
Thanks
Comment #65
GoddamnNoise commentedSure!. I'll be back soon.
Comment #66
GoddamnNoise commentedI'm back!.
I've made the change in commerce_sermepa_callback function and the I've made the same tests I did in #63. This time worked like a charm!. No errors in Drupal's log. No errors in the payment gateway's administration website.
This time I've made a payment attempt using an invalid credit card, too. All worked well. I've been redirected again to the checkout review page and the asynchronous HTTP notification was correctly processed by the commerce_sermepa module. No errors in Drupal's log. No errors in payment gateway's administration website.
All seems ok to me now, except for the "Estado remoto" field. Great job!.
Comment #68
facine commentedThanks you!
@GoddamnNoise: The other issue was fixed here #2609900: Fix missing remote status trasaction
Comment #69
GoddamnNoise commentedOk, great!.
Comment #70
pcambraComment #71
David Hernández commentedIs this change going to appear in a new release any time soon?
Comment #72
cemana commentedI want to test the last version of the patch (61).
1. cd modules/contrib/
2. Rename commerce_sermepa
3. git clone --branch 7.x-1.x http://git.drupal.org/project/commerce_sermepa.git
4. cd commerce_sermepa and copy the last patch
4. git apply -v commerce_sermepa-Add_SHA256_support_using_an_external_library-2602388-61.patch
I obtain a lot of errors... the last line is:
error: commerce_sermepa.rules.inc: patch does not apply
Is it accumulative?
I did this process for patch 24 and it worked.
Thanks,
Comment #73
David Hernández commentedHi cemana,
You don't need to apply the patch anymore if you download the last dev version, as the patch is already in the source.
Regards,
David.
Comment #74
ferrangil commentedI can confirm that the dev version works just fine on a Live site, using "La Caixa".
Just download the dev version, download the sermepa library, configure your bank info on the payment rule and that's all.
Can I recommend one minor improvement? I've changed the order number from
->setOrder(substr(date('ymdHis') . $order->order_id, -12, 12))to
->setOrder(substr(date('ymdHis') . '_' . $order->order_id, -12, 12))which basically makes the life so much easy for the one that needs to track order IDs on the TPV page (as the hyphen allows you to quickly see the order ID).
Great work! Thanks
Comment #75
GoddamnNoise commentedHi again, facine,
I'm doing some more tests simulating the process of updating one of my production sites in my developing environment. I've updated the commerce_sermepa module in this site from the 7.x-1.1 version to the last development version on the 7.x branch. When I've run the update.php script, I've noticed a PHP warning in Drupal's log. So I've come here again because I don't know if you are aware of that warning.
This is the warning I've gotten during the update.php script execution:
I'll try this updated commerce_sermepa version and I'll come back here if I notice any other issues.
Comment #76
carsato commentedHello GoddamnNoise,
I'm facing the same problem of you. Have you finally managed to get it working? how?
I downloaded the dev version of commerce_sermepa and cloned a brand new repo with git clone https://github.com/CommerceRedsys/sermepa.git in sites/all/libraries.
No luck with the sha256 test password.
Comment #77
GoddamnNoise commentedHi carsato,
Yes. I got it working. When you say you're facing the same problem, what of the many problems i've reported in this thread are you facing now?. That one in #75?.
Comment #78
izarco commentedHi,
I have a WSOD when i try to edit the rule settings to set the information of my bank.
Any idea?
Comment #79
GoddamnNoise commentedHi izarco,
Yeah. I've faced similar problems in servers with an old version of PHP. Check your server logs and your PHP Version. Try it again with a more recent PHP version.
Comment #80
izarco commentedHi GoddamnNoise,
I had not installed the sermepa library!
I uninstalled and installed again after download the library and now work fine.
Thanks for your attention!
Comment #81
idiaz.ronceroHi there!
Tried on a site using La Caixa's Sermepa TPV. Everything went fine.
thank you for your work!
Comment #82
vmunoz commentedHi!
Tested with "Banco Sabadell" and everything is working fine!
Great job!
Comment #83
Marcela V. commentedIt's working fine with BBVA (test environment). Thanks!
Comment #84
Marcela V. commentedHi again!
Will we have a stable version this week? Or should I use the .dev version? Is it safe? Thanks for your answer.
Comment #85
candelas commentedHello
Since I see that @izarco solved by uninstalling and installing, I made the same and now I can edit the rule.
Now I go to test and I will report. Thanks very much for the module.
Comment #86
polmaresma commentedHi, I'm locked here.
I'd done all the steps metioned above, but my system fails on payment step checkout/6944/payment with an error on screen.
Any idea where to find a solution?
I'v installed the library and DEV module, changed the SHA256 key...
Thank's for all
Comment #87
candelas commented@polmaresma Could you say which errors do you get?
Comment #88
polmaresma commented@candelas this is the error shown on the screen, nothing appears on Apache Log:
"Error
El sitio web encontró un error inesperado. Vuelva a intentarlo más tarde."
Comment #89
GoddamnNoise commentedHi polmaresma,
Check your Drupal's log and your web server's log. You'll find more information there. Check your PHP version too, this update only runs well with PHP >= 5.3.0
Comment #90
polmaresma commented@GoddamnNoise @candelas
Solved! It seems you have to set the Merchant Terminal as 001 and not 1 alone.
This is the error previously showed on the syslog.
CommerceRedsys\Payment\SermepaException: The specified Ds_Merchant_Terminal: 1 is not valid. en CommerceRedsys\Payment\Sermepa->setTerminal() (línea 1107 de /sites/all/libraries/sermepa/src/Sermepa.php).
Thank's to everybody.
Comment #91
candelas commentedJust in case somebody has errors, if you search in the html 'sis0', you will see an error number. Then, in the manual, at the end you get the error list.
Comment #92
jcerdan commentedHi,
I'm facing a problem installing the new 1.4 module version.
I always get the error: PHP Fatal error: Class 'CommerceRedsys\\Payment\\Sermepa' not found in ...../commerce_sermepa/commerce_sermepa.module on line 208,
I have uninstalled, reinstalled, git cloned several times and in different places, and there's no way. Always this error.
I'm using PHP 5.3.2 so there should be no problem.
Can someone point me an idea?
best
Comment #93
GoddamnNoise commentedHi jcerdan,
Have you installed the Sermepa library?. The module depends on that library now.
Comment #94
jcerdan commentedHi GoddamnNoise.
I finally managed to install it thanks!
Best,
Comment #95
candelas commentedI forgot to say that it is working with Banc Sabadell Atlántico. Mil gracias :)
Comment #96
santy commentedHello,
After install the module, when i try make a payment, redsys.es give me a error message
"Importe sin asignar Error de datos enviados"
" Unallocated amount of data sent Error "
Any Ideas? ¿Is it posible affect other rules?
thanks
Comment #97
GoddamnNoise commentedHi santy,
Have you installed the Sermepa library?. The module depends on that library now.
Comment #98
santy commentedthanks for answering GoddamNoise
Yes, I have copied the files in my path
sites/all/libraries/sermepa/src/Sermepa.php
Comment #99
GoddamnNoise commentedHave you changed the Sermepa rule configuration? You have to edit it and fill the information that has changed: Merchant Titular field has been renamed to Merchant Name and there is a new "SHA256 Merchant Password" field. You need to login into the Payment Gateway's administration website and look for the "SHA256 Merchant Password". You need to do this for the Payment Gateway's administration website in the test environment and for the Payment Gateway's administration website in the real/production environment. Some banks do not provide this information in the Payment Gateway's administration website and you need to call to your bank to get that information.
Comment #100
adriaav commentedHello,
Same issue as #96, using version 7.x-1.4
SHA256 field filled on card payment method
Mcrypt installed
Downladed and copied Sermepa library as #98
Error screen
Any help will be appreciated!
Thank you!
Comment #101
facine commented@adriaav are you using the new sha256 password?
Comment #102
adriaav commentedHi @facine,
Yes, the one the bank gives me from it's gateway admin website.
Payment config
Running php 5.3.3
Thank you!
Comment #103
adriaav commentedDon't know what happened there, pasted the sha256 key again and it worked....
Thanks everyone!!!
Comment #104
cemana commentedHello,
Is there a way where I can map the order_id of Drupal Commerce with some ID of Sermepa Redsys?
The question is because, for instance, a user wants to cancel an order, how I can know the autorization number of RedSys related to that order?
Thanks a lot.
Comment #105
GoddamnNoise commentedHi cemana,
I don't know how to do that kind of mapping, but you can see the Redsys id in the "Payment" tab of the order.
Comment #106
cemana commentedThanks GoddamnNoise, it would be enough for me... but at this moment I only see in that tab:
No payment methods available to add payments. Order balance 28,85 €
Do you know if I can see this Redsys id in the database?
Thanks
Comment #107
GoddamnNoise commentedIf there is no payment methods available, are you sure that order was paid?.
Comment #108
cemana commentedYes, in the admin website of RedSys I can see the payments...
Comment #109
GoddamnNoise commentedI don't know why you can't see the payments. Are you sure that order is the same order that is shown as paid in the Redsys Website?.
Comment #110
cemana commentedYes I am sure.
I have reviewed the log and I have found this warning: "Bad feedback response data."
Comment #111
cemana commented#64?
Comment #112
GoddamnNoise commentedThat is the problem. Check the "Notifications" tab in the Redsys website to see why the notification could not be done.
Comment #113
GoddamnNoise commentedDepends on when you've patched the module. There is a new release of the module that should work nice. Uninstall the module and install the new release to be sure that is not the problem.
Comment #114
David Hernández commentedAnswering to #104: The authorization code appears only when a payment is done. So, if the user cancels the order, there is no authorization code.
About mapping a Drupal order with the RedSys payment, Drupal sends as Order number and ID like this: 1234567890_X
The last part, the "X" is the Drupal Order ID. So you can use that ID to find the Drupal Commerce Order.
Comment #115
cemana commentedOK, I have this error in the Notifications:
Type: HTTP Asíncrona
Code: 0000
Detail:
http://www.xxx/sermepa/callback/2
-1 Server returned HTTP response code: 500 for URL: http://xxx/sermepa/callback/2
Comment #116
facine commented@David_Hernández There isn't any separator in the payment number (now). But the last X values are the oder id.
See: http://cgit.drupalcode.org/commerce_sermepa/tree/commerce_sermepa.module...
Comment #117
GoddamnNoise commentedAbout #115: Check your Webserver's error log. Maybe you'll find more information there about that HTTP 500 error.
Comment #118
cemana commentedThanks GoddamnNoise, I have updated the library of sermepa and it has solved the error.
Thanks David and facine, this information has been very helpful.
But, I do not get the Redsys ID in Drupal.
Comment #119
cemana commentedThanks everyone. I can see the payment information now. It was the library.
Comment #121
vacho commentedI have same error that #90
CommerceRedsys\Payment\SermepaException: The specified Ds_Merchant_Terminal: 1 is not valid. en CommerceRedsys\Payment\Sermepa->setTerminal() (línea 1107 de /home/hzvfnolg/public_html/sites/all/libraries/sermepa/src/Sermepa.php).
Comment #122
vacho commentedThe error report yesterday was because I had misconfigured values. Juuuu maybe same the #90