Skip to content

Commit

Permalink
Fail hard when attempting to capture without a credit card with NetRe…
Browse files Browse the repository at this point in the history
…gistry

git-svn-id: https://activemerchant.googlecode.com/svn/trunk/active_merchant@661 6513ea26-6c20-0410-8a68-89cd7235086d
  • Loading branch information
codyfauser committed Mar 28, 2008
1 parent a4b01ae commit 9f3e19f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,5 +1,6 @@
= ActiveMerchant CHANGELOG

* Fail hard when attempting to capture without a credit card with NetRegistry [cody]
* Add support for the order fields to the create_customer_profile_transaction in Authorize.net CIM. [Patrick T. Joyce]
* Strip invalid characters and limit lengths of Protx customer data [Simon Russell]
* Fix empty start or end dates in Protx [Simon Russell]
Expand Down
1 change: 1 addition & 0 deletions lib/active_merchant/billing/gateways/net_registry.rb
Expand Up @@ -72,6 +72,7 @@ def authorize(money, credit_card, options = {})
# described in "Programming for NetRegistry's E-commerce
# Gateway." [http://rubyurl.com/hNG]
def capture(money, authorization, options = {})
requires!(options, :credit_card)
credit_card = options[:credit_card]

params = {
Expand Down
6 changes: 6 additions & 0 deletions test/unit/gateways/net_registry_test.rb
Expand Up @@ -37,6 +37,12 @@ def test_successful_credit
response = @gateway.credit(@amount, '0707161858000000', @options)
assert_success response
end

def test_capture_without_credit_card_provided
assert_raise(ArgumentError) do
response = @gateway.capture(@amount, '0707161858000000', @options)
end
end

def test_successful_authorization
@gateway.stubs(:ssl_post).returns(successful_authorization_response)
Expand Down

0 comments on commit 9f3e19f

Please sign in to comment.