Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ogone: Fix signature calulcation for blank fields #4963

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

Heavyblade
Copy link
Collaborator

@Heavyblade Heavyblade commented Nov 20, 2023

Summary:

Add changes to deal with ogone signature when there are empty fields on the passed params

SER-965

Tests

Remote Test:

Finished in 135.715931 seconds.
33 tests, 138 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
96.9697% passed

Unit Tests:

Finished in 38.938916 seconds.
5733 tests, 78693 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

RuboCop:

784 files inspected, no offenses detected

@Heavyblade Heavyblade force-pushed the SER-965_fixing_signature_calulcation_for_ogone branch from 7ddc191 to 445f34f Compare November 20, 2023 20:34
Copy link
Contributor

@sinourain sinourain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just leave a comment

lib/active_merchant/billing/gateways/ogone.rb Show resolved Hide resolved
@Heavyblade Heavyblade marked this pull request as ready for review November 21, 2023 01:44
@naashton naashton force-pushed the SER-965_fixing_signature_calulcation_for_ogone branch from 445f34f to cad0cfc Compare November 21, 2023 18:47
Summary:
------------------------------
Add changes to deal with ogone signature when
there are empty fields on the passed params

[SER-965](https://spreedly.atlassian.net/browse/SER-965)

Remote Test:
------------------------------
Finished in 135.715931 seconds.
33 tests, 138 assertions, 1 failures, 0 errors,
0 pendings, 0 omissions, 0 notifications
96.9697% passed

Unit Tests:
------------------------------
Finished in 38.938916 seconds.
5733 tests, 78693 assertions, 0 failures, 0 errors,
0 pendings, 0 omissions, 0 notifications
100% passed

RuboCop:
------------------------------
784 files inspected, no offenses detected
@naashton naashton force-pushed the SER-965_fixing_signature_calulcation_for_ogone branch from cad0cfc to 211e4d8 Compare November 21, 2023 18:48
@@ -460,7 +460,7 @@ def calculate_signature(signed_parameters, algorithm, secret)
raise "Unknown signature algorithm #{algorithm}"
end

filtered_params = signed_parameters.compact
filtered_params = signed_parameters.reject { |_k, v| v.nil? || v == '' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This reject method is new to me, but this is pretty clever.

@naashton naashton merged commit fd6ec7b into master Nov 21, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants