Skip to content

Commit

Permalink
Return failed authorization when doing a SkipJack purchase
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Fauser committed Nov 27, 2008
1 parent 596495b commit b146245
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
= ActiveMerchant CHANGELOG

== Version 1.4.0 (November 25, 2008)
== Version 1.4.0 (November 27, 2008)

* Return failed authorization when SkipJack purchase fails [Tron, cody]
* Update README [cody]
* Add metadata to Authorize.net CIM gateway [cody]
* Make ActionViewHelper compatible with changes to concat method in ActionPack [cody]
Expand Down
2 changes: 2 additions & 0 deletions lib/active_merchant/billing/gateways/skip_jack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ def purchase(money, creditcard, options = {})
authorization = authorize(money, creditcard, options)
if authorization.success?
capture(money, authorization.authorization)
else
authorization
end
end

Expand Down
8 changes: 8 additions & 0 deletions test/unit/gateways/skip_jack_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ def test_purchase_success
assert_success response
assert_equal "9802853155172.022", response.authorization
end

def test_purchase_failure
@gateway.expects(:ssl_post).returns(unsuccessful_authorization_response)

assert response = @gateway.purchase(@amount, @credit_card, @options)
assert_instance_of Response, response
assert_failure response
end

def test_split_line
keys = @gateway.send(:split_line, '"AUTHCODE","szSerialNumber","szTransactionAmount","szAuthorizationDeclinedMessage","szAVSResponseCode","szAVSResponseMessage","szOrderNumber","szAuthorizationResponseCode","szIsApproved","szCVV2ResponseCode","szCVV2ResponseMessage","szReturnCode","szTransactionFileName","szCAVVResponseCode"')
Expand Down

0 comments on commit b146245

Please sign in to comment.