Skip to content

Form#redirect_signature: don't fail on empty input #46

Merged
merged 3 commits into from Apr 7, 2012

2 participants

@rngtng
Collaborator
rngtng commented Apr 7, 2012

This PR fixes failure of Form#redirect_signature on empty input by forcing the secret_key to be a string.

rngtng@ce96438

In addition in an extra commit: cleaned up whitespace chars of related files

Tobias Bielo... added some commits Apr 7, 2012
@wvanbergen
Owner

In what case should we calculate a signature without a secret key?

@rngtng
Collaborator
rngtng commented Apr 7, 2012

we had the case where the page was called without any params. It returned 500 error because of this problem. I'd like to be very defensive here and expect even a nil secretkey (which is default value anyway).

(btw. saw jruby tests failed, I'm on it..)

@wvanbergen
Owner

I prefer to raise an ArgumentError in this case, given that signing a form without a secret key is never what you want. Swallowing the error and send erroneous requests to Adyen might be even more confusing to users, causing debugging headaches.

In the end, your app should always make sure to set the secret key, and if for some reason this can be nil in your app, rescue the ArgumentError to deal with it nicely.

@rngtng
Collaborator
rngtng commented Apr 7, 2012

jruby fixed.

@rngtng
Collaborator
rngtng commented Apr 7, 2012

true ArgumentError is better solution here, I'll update it..

@wvanbergen
Owner

Cool, merging.

@wvanbergen wvanbergen merged commit 2aaffa8 into wvanbergen:master Apr 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.