Skip to content

Commit

Permalink
Merge pull request #2 from janjiss/master
Browse files Browse the repository at this point in the history
Added request_id for redirect_url
  • Loading branch information
ebeigarts committed Jan 8, 2013
2 parents 2edd9df + 2c43815 commit a814ac6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/active_merchant/billing/first_data_gateway.rb
Expand Up @@ -280,8 +280,10 @@ def endpoint_url
test? ? test_url : live_url
end

def redirect_url
test? ? test_redirect_url : live_redirect_url
def redirect_url(trans_id = nil)
url = test? ? test_redirect_url : live_redirect_url
url += "?trans_id=#{CGI.escape trans_id}" if trans_id
url
end

private
Expand Down
7 changes: 7 additions & 0 deletions spec/active_merchant/billing/first_data_gateway_spec.rb
Expand Up @@ -685,6 +685,13 @@
end
end

it "26) return correct redirect url with transaction id" do
@gateway.redirect_url.should == @gateway.test_redirect_url
end

it "27) return correct redirect url without transaction id" do
@gateway.redirect_url("2SGip+TK/dVYe+XMSeQuECMs//S=").should == @gateway.test_redirect_url + "?trans_id=2SGip%2BTK%2FdVYe%2BXMSeQuECMs%2F%2FS%3D"
end
end

def submit_form(url, params, cassette_prefix)
Expand Down

0 comments on commit a814ac6

Please sign in to comment.