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

BlueSnap: Default to not send amount on capture #3270

Merged
merged 1 commit into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* CardConnect: Fix parsing of level 3 fields [hdeters] #3273
* TrustCommerce: Support void after purchase [jknipp] #3265
* Payflow: Support arbitrary level 2 + level 3 fields [therufs] #3272
* BlueSnap: Default to not send amount on capture [molbrown] #3270

== Version 1.95.0 (May 23, 2019)
* Adyen: Constantize version to fix subdomains [curiousepic] #3228
Expand Down
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/blue_snap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def capture(money, authorization, options={})
commit(:capture, :put) do |doc|
add_authorization(doc, authorization)
add_order(doc, options)
add_amount(doc, money, options)
add_amount(doc, money, options) if options[:include_capture_amount] == true
end
end

Expand Down
12 changes: 12 additions & 0 deletions test/unit/gateways/blue_snap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ def test_failed_authorize
def test_successful_capture
response = stub_comms(@gateway, :raw_ssl_request) do
@gateway.capture(@amount, @credit_card, @options)
end.check_request do |method, url, data|
assert_not_match(/<amount>1.00<\/amount>/, data)
assert_not_match(/<currency>USD<\/currency>/, data)
end.respond_with(successful_capture_response)

assert_success response
assert_equal '1012082881', response.authorization
end

def test_successful_partial_capture
response = stub_comms(@gateway, :raw_ssl_request) do
@gateway.capture(@amount, @credit_card, @options.merge(include_capture_amount: true))
end.check_request do |method, url, data|
assert_match(/<amount>1.00<\/amount>/, data)
assert_match(/<currency>USD<\/currency>/, data)
Expand Down