Skip to content

Commit

Permalink
[Cybersource] Set authorization on the response even when in Fraud Re…
Browse files Browse the repository at this point in the history
…view
  • Loading branch information
Pierre Nespo authored and pi3r committed Jul 22, 2020
1 parent 7d2f31d commit 0fa1c93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/active_merchant/billing/gateways/cyber_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,7 @@ def commit(request, action, amount, options)

success = success?(response)
message = message_from(response)

authorization = success ? authorization_from(response, action, amount, options) : nil
authorization = success || in_fraud_review?(response) ? authorization_from(response, action, amount, options) : nil

Response.new(success, message, response,
test: test?,
Expand Down
1 change: 1 addition & 0 deletions test/unit/gateways/cyber_source_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ def test_authorization_under_review_request

assert_failure(response = @gateway.authorize(@amount, @credit_card, @options))
assert response.fraud_review?
assert_equal(response.authorization, "#{@options[:order_id]};#{response.params['requestID']};#{response.params['requestToken']};authorize;100;USD;")
end

def test_successful_credit_to_subscription_request
Expand Down

0 comments on commit 0fa1c93

Please sign in to comment.