Skip to content

Commit

Permalink
Raven: update description, test url, and routing; fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bslobodin authored and girasquid committed Jul 21, 2015
1 parent 93251aa commit e4ec319
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= ActiveMerchant CHANGELOG

* Redsys: Add a number of currencies [agseco]

* Raven: update description, test url, and routing; fix tests [bslobodin]

== Version 1.52.0 (July 20, 2015)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ The [ActiveMerchant Wiki](http://github.com/activemerchant/active_merchant/wikis
* [Quantum Gateway](http://www.quantumgateway.com) - US
* [QuickPay](http://quickpay.net/) - DE, DK, ES, FI, FR, FO, GB, IS, NO, SE
* [Qvalent](https://www.qvalent.com/) - AU
* [Raven PacNet](http://www.pacnetservices.com/) - US
* [Raven](http://www.deepcovelabs.com/raven) - AI, AN, AT, AU, BE, BG, BS, BZ, CA, CH, CR, CY, CZ, DE, DK, DM, DO, EE, EL, ES, FI, FR, GB, GG, GI, HK, HR, HU, IE, IL, IM, IN, IT, JE, KN, LI, LT, LU, LV, MH, MT, MY, NL, NO, NZ, PA, PE, PH, PL, PT, RO, RS, SC, SE, SG, SI, SK, UK, US, VG, ZA
* [Realex](http://www.realexpayments.com/) - IE, GB, FR, BE, NL, LU, IT
* [Redsys](http://www.redsys.es/) - ES
* [S5](http://www.s5.dk/) - DK
Expand Down
8 changes: 4 additions & 4 deletions lib/active_merchant/billing/gateways/pac_net_raven.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class PacNetRavenGateway < Gateway
'cvv2_not_checked' => 'X'
}

self.test_url = 'https://demo.deepcovelabs.com/realtime/'
self.live_url = 'https://raven.pacnetservices.com/realtime/'
self.test_url = 'https://raven.deepcovelabs.com/realtime/'
self.live_url = 'https://raven.deepcovelabs.com/realtime/'

self.supported_countries = ['US']
self.supported_cardtypes = [:visa, :master]
self.money_format = :cents
self.default_currency = 'USD'
self.homepage_url = 'http://www.pacnetservices.com/'
self.display_name = 'Raven PacNet'
self.homepage_url = 'http://www.deepcovelabs.com/raven'
self.display_name = 'Raven'

def initialize(options = {})
requires!(options, :user, :secret, :prn)
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ qvalent:
raven_pac_net:
user: ernest
secret: "all good men die young"
prn: 840033
prn: 987743

realex:
login: X
Expand Down
32 changes: 16 additions & 16 deletions test/remote/gateways/remote_pac_net_raven_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def test_expired_credit_card_purchese
assert_equal "Invalid because the card expiry date (mmyy) \"0912\" is not a date in the future", purchase.params['Message']
end

def test_declined_purchese
def test_declined_purchase
assert purchase = @gateway.purchase(@amount, @declined_card, @options)
assert_failure purchase
assert_equal 'RepeatDeclined', purchase.message
assert_equal 'This transaction has been declined', purchase.message
end

def test_successful_authorization
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_expired_credit_card_authorization
def test_declined_authorization
assert auth = @gateway.authorize(@amount, @declined_card, @options)
assert_failure auth
assert_equal 'RepeatDeclined', auth.message
assert_equal 'This transaction has been declined', auth.message
end

def test_successful_refund
Expand Down Expand Up @@ -142,7 +142,7 @@ def test_purchase_and_void

def test_authorize_and_void
auth = @gateway.authorize(@amount, @credit_card, @options)
assert void = @gateway.void(auth.authorization)
assert void = @gateway.void(auth.authorization, {:pymt_type => auth.params['PymtType']})
assert_failure void
assert void.params['ApprovalCode']
assert void.params['TrackingNumber']
Expand All @@ -156,15 +156,15 @@ def test_authorize_and_void
def test_authorize_capture_and_void
auth = @gateway.authorize(@amount, @credit_card, @options)
assert capture = @gateway.capture(@amount, auth.authorization)
assert void = @gateway.void(capture.authorization, {:pymt_type => capture.params['PymtType']})
assert_failure void
assert void = @gateway.void(capture.authorization, {:pymt_type => capture.params['PymtType']})
assert_success void
assert void.params['ApprovalCode']
assert void.params['TrackingNumber']
assert_equal 'error:canNotBeVoided', void.params['ErrorCode']
assert_nil void.params['ErrorCode']
assert_equal 'ok', void.params['RequestResult']
assert_equal "Error processing transaction because the payment may not be voided.", void.params['Message']
assert_equal 'Approved', void.params['Status']
assert_equal "Error processing transaction because the payment may not be voided.", void.message
assert_nil void.params['Message']
assert_equal 'Voided', void.params['Status']
assert_equal "This transaction has been voided", void.message
end

def test_successful_capture
Expand All @@ -185,11 +185,11 @@ def test_invalid_preauth_number_capture
assert_failure capture
assert_nil capture.params['ApprovalCode']
assert capture.params['TrackingNumber']
assert_equal 'invalid:PreAuthNumber', capture.params['ErrorCode']
assert_equal 'Invalid:PreauthNumber', capture.params['Status']
assert_equal 'rejected:UnknownPreauthNumber', capture.params['ErrorCode']
assert_equal 'Rejected:UnknownPreauthNumber', capture.params['Status']
assert_equal 'ok', capture.params['RequestResult']
assert_equal "Error processing transaction because the pre-auth number \"0\" does not correspond to a pre-existing payment.", capture.params['Message']
assert capture.message.include?('Error processing transaction because the pre-auth number')
assert_equal 'Invalid because the preauthorization # does not exist', capture.params['Message']
assert_equal 'Invalid because the preauthorization # does not exist', capture.message
end

def test_insufficient_preauth_amount_capture
Expand All @@ -201,7 +201,7 @@ def test_insufficient_preauth_amount_capture
assert_equal 'rejected:PreauthAmountInsufficient', capture.params['ErrorCode']
assert_equal 'Rejected:PreauthAmountInsufficient', capture.params['Status']
assert_equal 'ok', capture.params['RequestResult']
assert_equal "Invalid because the preauthorization amount 100 is insufficient", capture.params['Message']
assert_equal 'Invalid because the preauthorization amount 100 is insufficient', capture.message
assert_equal 'Invalid because the preauthorization amount 100 is not identical to the amount to be settled', capture.params['Message']
assert_equal 'Invalid because the preauthorization amount 100 is not identical to the amount to be settled', capture.message
end
end

0 comments on commit e4ec319

Please sign in to comment.