Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrustCommerce Verify feature added #4699

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/active_merchant/billing/gateways/trust_commerce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ def void(authorization, options = {})
end

def verify(credit_card, options = {})
add_creditcard(options, credit_card)
commit('verify', options)
parameters = {}
add_creditcard(parameters, credit_card)
commit('verify', parameters)
end

# recurring() a TrustCommerce account that is activated for Citadel, TrustCommerce's
Expand Down
7 changes: 7 additions & 0 deletions test/remote/gateways/remote_trust_commerce_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ def test_successful_verify
assert_success response
end

def test_failed_verify_with_invalid_card
assert response = @gateway.verify(@declined_credit_card)
assert_equal 'baddata', response.params['status']
assert_match %r{A field was improperly formatted}, response.message
assert_failure response
end

def test_successful_recurring
assert response = @gateway.recurring(@amount, @credit_card, periodicity: :weekly)

Expand Down