Skip to content

Commit 23f326d

Browse files
author
Sunny Raj Rathod
authored
Merge pull request #154 from varyonic/deprecated
Clarify that the old APIs have been deprecated.
2 parents 4389360 + 3aa2f65 commit 23f326d

File tree

7 files changed

+15
-0
lines changed

7 files changed

+15
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
[![Coverage ][coverage_badge]][coverage]
66
[![Scrutinizer ][scrutinizer_badge]][scrutinizer]
77

8+
Starting Release 1.8.6 November 2015 the Authorize.Net API has been [reorganized to be more merchant focused](https://developer.authorize.net/api/upgrade_guide/).
9+
AIM, ARB, CIM, Reporting and SIM have all been deprecated in favor of AuthorizeNet::API.
10+
811
## Requirements
912
* Ruby 2.2.2 or higher
1013
* RubyGem 1.3.7 or higher (to build the gem)

lib/authorize_net/aim/transaction.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class Transaction < AuthorizeNet::KeyValueTransaction
4141
# +market_type+:: A constant from MarketType indicating your industry. Used for card present transactions. Defaults to MarketType::RETAIL.
4242
#
4343
def initialize(api_login_id, api_transaction_key, options = {})
44+
ActiveSupport::Deprecation.warn "use AuthorizeNet::API::Transaction"
4445
super()
4546
options = @@option_defaults.merge(options)
4647
@api_login_id = api_login_id

lib/authorize_net/arb/transaction.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Transaction < AuthorizeNet::XmlTransaction
3636
# +reference_id+:: A string that can be used to identify a particular transaction with its response. Will be echo'd in the response, only if it was provided in the transaction. Defaults to nil.
3737
#
3838
def initialize(api_login_id, api_transaction_key, options = {})
39+
ActiveSupport::Deprecation.warn "use AuthorizeNet::API::Transaction"
3940
super
4041
end
4142

lib/authorize_net/cim/transaction.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Transaction < AuthorizeNet::XmlTransaction
2727
# +reference_id+:: A string that can be used to identify a particular transaction with its response. Will be echo'd in the response, only if it was provided in the transaction. Defaults to nil.
2828
#
2929
def initialize(api_login_id, api_transaction_key, options = {})
30+
ActiveSupport::Deprecation.warn "use AuthorizeNet::API::Transaction"
3031
super
3132
@delim_char = ','
3233
@encap_char = nil

lib/authorize_net/reporting/transaction.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Transaction < AuthorizeNet::XmlTransaction
2323
# +reference_id+:: A string that can be used to identify a particular transaction with its response. Will be echo'd in the response, only if it was provided in the transaction. Defaults to nil.
2424
#
2525
def initialize(api_login_id, api_transaction_key, options = {})
26+
ActiveSupport::Deprecation.warn "use AuthorizeNet::API::Transaction"
2627
super
2728
end
2829

lib/authorize_net/sim/transaction.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Transaction < AuthorizeNet::KeyValueTransaction
4040
# +transaction_type+:: The type of transaction to perform. Defaults to AuthorizeNet::Type::AUTHORIZE_AND_CAPTURE. This value is only used if run is called directly.
4141
#
4242
def initialize(api_login_id, api_transaction_key, amount, options = {})
43+
ActiveSupport::Deprecation.warn "use AuthorizeNet::API::Transaction"
4344
super()
4445
@api_transaction_key = api_transaction_key
4546
@api_login_id = api_login_id

spec/spec_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
require "authorizenet"
88
require "yaml"
99

10+
ActiveSupport::Deprecation.behavior = lambda do |msg, stack|
11+
# when running this test suite ignore our own deprecation warnings
12+
unless /use AuthorizeNet::API::Transaction/ =~ msg
13+
ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:stderr].call(msg,stack)
14+
end
15+
end
16+
1017
Dir['./spec/support/**/*.rb'].each { |f| require f }
1118

1219
RSpec.configure do |config|

0 commit comments

Comments
 (0)