You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a funny problem with the optional parameters. I was getting a SIS0024 error (Ds_Merchant_ConsumerLanguage has a length superior to 3), and I've found that when JSON encoding, of course, the generated JSON has a null parameter.
Unfortunately, Redsys does not parse the JSON well and reads the null parameter as a string, interpreting the parameter Ds_Merchant_ConsumerLanguage as "null". Also, once I've solved that parameter, Redsys redirected me to https://sis-t.redsys.es:25443/sis/null?[...] leading to a 404 page, and I guess that it is caused for the same reason.
I'd need to review the documentation. From memory I thought the consumer language was a required parameter, so unsetting it (or setting it to an invalid value like null) should rightly break the integration, as it hasn't been set up properly. Anything optional which is null can probably be unset, though. Happy to review a PR/tests.
It's not a mandatory field. The real problem is that Redsys reads null as a string. No joke.
I'm working on a fork, I could make a PR, but I'm afraid some things are not BC compatible! (but maybe we could leave a deprecated API still available)
For example, I've renamed the parameter consumerLanguage to language. Omnipay doesn't seem to define a standard parameter for language selection for a payment gateway, but the implementations I've seen around uses a plain language parameter, accepting only ISO 639 alpha 2 codes.
There is a funny problem with the optional parameters. I was getting a
SIS0024
error (Ds_Merchant_ConsumerLanguage
has a length superior to 3), and I've found that when JSON encoding, of course, the generated JSON has anull
parameter.Unfortunately, Redsys does not parse the JSON well and reads the
null
parameter as a string, interpreting the parameterDs_Merchant_ConsumerLanguage
as"null"
. Also, once I've solved that parameter, Redsys redirected me tohttps://sis-t.redsys.es:25443/sis/null?[...]
leading to a 404 page, and I guess that it is caused for the same reason.Maybe a solution could be to iterate through the params array, unsettling the null ones? (not the
empty()
ones to avoid unsetting a0
or"0"
value)https://github.com/PatronBase/omnipay-redsys/blob/master/src/Message/PurchaseRequest.php#L161-L175
The text was updated successfully, but these errors were encountered: