Navigation Menu

Skip to content

Commit

Permalink
added test for capture
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusty Doris authored and Cody Fauser committed Dec 22, 2009
1 parent a0df168 commit 6d4f925
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,5 +1,6 @@
= ActiveMerchant CHANGELOG

* Add capture test to Linkpoint [Dusty Doris]
* Fix bug in Linkpoint with ternary operator and Ruby 1.9.1 [Dusty Doris]
* Add currency and processor options to Braintree gateway [cbillen]
* Unify API to always look for billing_address/address hash inside of options [stopdropandrew]
Expand Down
13 changes: 13 additions & 0 deletions test/unit/gateways/linkpoint_test.rb
Expand Up @@ -29,6 +29,15 @@ def test_successful_authorization
assert_equal '1000', response.authorization
end

def test_successful_capture
@gateway.expects(:ssl_post).returns(successful_capture_response)

assert response = @gateway.capture(@email, '1000', @options)
assert_instance_of Response, response
assert_success response
assert_equal '1000', response.authorization
end

def test_successful_purchase
@gateway.expects(:ssl_post).returns(successful_purchase_response)

Expand Down Expand Up @@ -170,6 +179,10 @@ def successful_authorization_response
'<r_csp>CSI</r_csp><r_time>Sun Jan 6 21:41:31 2008</r_time><r_ref>0004486182</r_ref><r_error/><r_ordernum>1000</r_ordernum><r_message>APPROVED</r_message><r_code>1234560004486182:NNNM:100018312899:</r_code><r_tdate>1199680890</r_tdate><r_score/><r_authresponse/><r_approved>APPROVED</r_approved><r_avs>NNNM</r_avs>'
end

def successful_capture_response
'<r_csp>CSI</r_csp><r_time>Wed Dec 2 13:57:19 2009</r_time><r_ref>0009554566</r_ref><r_error></r_error><r_ordernum>1000</r_ordernum><r_message>ACCEPTED</r_message><r_code>0000000009554566: :9554566:</r_code><r_tdate>1259780240</r_tdate><r_score></r_score><r_authresponse></r_authresponse><r_approved>APPROVED</r_approved><r_avs> </r_avs>'
end

def successful_purchase_response
'<r_csp>CSI</r_csp><r_time>Sun Jan 6 21:45:22 2008</r_time><r_ref>0004486195</r_ref><r_error></r_error><r_ordernum>1000</r_ordernum><r_message>APPROVED</r_message><r_code>1234560004486195:NNNM:100018312912:</r_code><r_tdate>1199681121</r_tdate><r_score></r_score><r_authresponse></r_authresponse><r_approved>APPROVED</r_approved><r_avs>NNNM</r_avs>'
end
Expand Down

0 comments on commit 6d4f925

Please sign in to comment.