authorizenet 1.8.7 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/app/helpers/authorize_net_helper.rb +23 -23
  3. data/lib/authorize_net.rb +107 -103
  4. data/lib/authorize_net/addresses/address.rb +28 -28
  5. data/lib/authorize_net/addresses/shipping_address.rb +25 -25
  6. data/lib/authorize_net/aim/response.rb +130 -130
  7. data/lib/authorize_net/aim/transaction.rb +190 -190
  8. data/lib/authorize_net/api/api_transaction.rb +103 -102
  9. data/lib/authorize_net/api/schema.rb +4283 -4283
  10. data/lib/authorize_net/api/transaction.rb +240 -240
  11. data/lib/authorize_net/arb/fields.rb +24 -24
  12. data/lib/authorize_net/arb/paging.rb +33 -33
  13. data/lib/authorize_net/arb/response.rb +33 -33
  14. data/lib/authorize_net/arb/sorting.rb +43 -43
  15. data/lib/authorize_net/arb/subscription.rb +71 -71
  16. data/lib/authorize_net/arb/subscription_detail.rb +14 -14
  17. data/lib/authorize_net/arb/subscription_list_response.rb +43 -43
  18. data/lib/authorize_net/arb/transaction.rb +177 -177
  19. data/lib/authorize_net/authorize_net.rb +153 -153
  20. data/lib/authorize_net/cim/customer_profile.rb +18 -18
  21. data/lib/authorize_net/cim/payment_profile.rb +36 -36
  22. data/lib/authorize_net/cim/response.rb +115 -115
  23. data/lib/authorize_net/cim/transaction.rb +727 -727
  24. data/lib/authorize_net/customer.rb +26 -26
  25. data/lib/authorize_net/email_receipt.rb +23 -23
  26. data/lib/authorize_net/fields.rb +779 -779
  27. data/lib/authorize_net/key_value_response.rb +116 -116
  28. data/lib/authorize_net/key_value_transaction.rb +290 -290
  29. data/lib/authorize_net/line_item.rb +24 -24
  30. data/lib/authorize_net/order.rb +41 -41
  31. data/lib/authorize_net/payment_methods/credit_card.rb +62 -62
  32. data/lib/authorize_net/payment_methods/echeck.rb +71 -71
  33. data/lib/authorize_net/reporting/batch.rb +18 -18
  34. data/lib/authorize_net/reporting/batch_statistics.rb +18 -18
  35. data/lib/authorize_net/reporting/fds_filter.rb +10 -10
  36. data/lib/authorize_net/reporting/response.rb +162 -162
  37. data/lib/authorize_net/reporting/returned_item.rb +46 -46
  38. data/lib/authorize_net/reporting/transaction.rb +133 -133
  39. data/lib/authorize_net/reporting/transaction_details.rb +24 -24
  40. data/lib/authorize_net/response.rb +26 -26
  41. data/lib/authorize_net/sim/hosted_payment_form.rb +37 -37
  42. data/lib/authorize_net/sim/hosted_receipt_page.rb +36 -36
  43. data/lib/authorize_net/sim/response.rb +141 -141
  44. data/lib/authorize_net/sim/transaction.rb +137 -137
  45. data/lib/authorize_net/transaction.rb +65 -65
  46. data/lib/authorize_net/xml_response.rb +171 -171
  47. data/lib/authorize_net/xml_transaction.rb +280 -280
  48. data/lib/authorizenet.rb +4 -4
  49. data/lib/generators/authorize_net/direct_post/direct_post_generator.rb +53 -53
  50. data/lib/generators/authorize_net/direct_post/templates/README-AuthorizeNet +48 -48
  51. data/lib/generators/authorize_net/direct_post/templates/config.yml.erb +8 -8
  52. data/lib/generators/authorize_net/direct_post/templates/config.yml.rails3.erb +8 -8
  53. data/lib/generators/authorize_net/direct_post/templates/controller.rb.erb +30 -30
  54. data/lib/generators/authorize_net/direct_post/templates/initializer.rb +4 -4
  55. data/lib/generators/authorize_net/direct_post/templates/layout.erb +17 -17
  56. data/lib/generators/authorize_net/direct_post/templates/payment.erb +9 -9
  57. data/lib/generators/authorize_net/direct_post/templates/payment.rails3.erb +9 -9
  58. data/lib/generators/authorize_net/sim/sim_generator.rb +47 -47
  59. data/lib/generators/authorize_net/sim/templates/README-AuthorizeNet +51 -51
  60. data/lib/generators/authorize_net/sim/templates/config.yml.erb +8 -8
  61. data/lib/generators/authorize_net/sim/templates/config.yml.rails3.erb +8 -8
  62. data/lib/generators/authorize_net/sim/templates/controller.rb.erb +20 -20
  63. data/lib/generators/authorize_net/sim/templates/initializer.rb +4 -4
  64. data/lib/generators/authorize_net/sim/templates/layout.erb +17 -17
  65. data/lib/generators/authorize_net/sim/templates/payment.erb +5 -5
  66. data/lib/generators/authorize_net/sim/templates/payment.rails3.erb +5 -5
  67. data/lib/generators/generator_extensions.rb +74 -74
  68. metadata +4 -3
@@ -1,52 +1,52 @@
1
- = Authorize.Net Ruby SDK
2
-
3
- The Authorize.Net Ruby SDK is meant to offer an alternate object-oriented
4
- model of development with the Authorize.net APIs (Version 3.1). The SDK is
5
- based entirely off the name-value pair API, but performs the core payment
6
- activities (such as error handling/parsing, network communication, and data
7
- encoding) behind the scenes. Providing the end developer with this allows the
8
- developer to start integrating immediately without having to write out a mass
9
- of boiler plate code.
10
-
11
- == Prerequisites
12
-
13
- * Ruby 1.8.7 or higher
14
- * RubyGem 1.3.7 or higher (to build the gem)
15
- * RDoc 1.0 or higher (to build documentation)
16
- * Rake 0.8.7 or higher (to use the rake tasks)
17
-
18
- == Installation
19
-
20
- Goto the Authorize.Net SDK download page and download the Ruby gem. Then
21
-
22
- > gem install authorize-net-1.0.0.gem
23
-
24
- == Usage
25
-
26
- === Server Integration Method (SIM)
27
-
28
- A generator is provided to aid in setting up a Server Integration Method application. In the example below 'payments' is the name of the controller to generate.
29
-
30
- > sudo gem install rails -v '~> 2.1'
31
- > rails my_sim_app
32
- > cd my_sim_app
33
- > script/generate authorize_net_sim payments YOUR_API_LOGIN_ID YOUR_TRANSACTION_KEY MERCH_HASH_KEY
34
- > script/server
35
-
36
- After running the generator you will probably want to customize the payment page found in 'app/views/payments/payment.erb' and the thank you page found in 'app/views/payments/thank_you.erb'.
37
-
38
- You may also want to customize the actual payment form and receipt pages. That can be done by making the necessary changes to the AuthorizeNet::SIM::Transaction object ('@sim_transaction') found in the +payment+ action in 'app/controllers/payments_controller.rb'. The styling of those hosted pages are controlled by the AuthorizeNet::SIM::HostedReceiptPage and AuthorizeNet::SIM::HostedPaymentForm objects (which are passed to the AuthorizeNet::SIM::Transaction).
39
-
40
- There is also a default layout generated, 'app/views/layouts/authorize_net.erb'. If you already have your own layout, you can delete that file and the reference to it in the controller ('app/controllers/payments_controller.rb').
41
-
42
- == Credit Card Test Numbers
43
-
44
- For your reference, you can use the following test credit card numbers.
45
- The expiration date must be set to the present date or later. Use 123 for
46
- the CCV code.
47
-
48
- American Express:: 370000000000002
49
- Discover:: 6011000000000012
50
- Visa:: 4007000000027
51
- JCB:: 3088000000000017
1
+ = Authorize.Net Ruby SDK
2
+
3
+ The Authorize.Net Ruby SDK is meant to offer an alternate object-oriented
4
+ model of development with the Authorize.net APIs (Version 3.1). The SDK is
5
+ based entirely off the name-value pair API, but performs the core payment
6
+ activities (such as error handling/parsing, network communication, and data
7
+ encoding) behind the scenes. Providing the end developer with this allows the
8
+ developer to start integrating immediately without having to write out a mass
9
+ of boiler plate code.
10
+
11
+ == Prerequisites
12
+
13
+ * Ruby 1.8.7 or higher
14
+ * RubyGem 1.3.7 or higher (to build the gem)
15
+ * RDoc 1.0 or higher (to build documentation)
16
+ * Rake 0.8.7 or higher (to use the rake tasks)
17
+
18
+ == Installation
19
+
20
+ Goto the Authorize.Net SDK download page and download the Ruby gem. Then
21
+
22
+ > gem install authorize-net-1.0.0.gem
23
+
24
+ == Usage
25
+
26
+ === Server Integration Method (SIM)
27
+
28
+ A generator is provided to aid in setting up a Server Integration Method application. In the example below 'payments' is the name of the controller to generate.
29
+
30
+ > sudo gem install rails -v '~> 2.1'
31
+ > rails my_sim_app
32
+ > cd my_sim_app
33
+ > script/generate authorize_net_sim payments YOUR_API_LOGIN_ID YOUR_TRANSACTION_KEY MERCH_HASH_KEY
34
+ > script/server
35
+
36
+ After running the generator you will probably want to customize the payment page found in 'app/views/payments/payment.erb' and the thank you page found in 'app/views/payments/thank_you.erb'.
37
+
38
+ You may also want to customize the actual payment form and receipt pages. That can be done by making the necessary changes to the AuthorizeNet::SIM::Transaction object ('@sim_transaction') found in the +payment+ action in 'app/controllers/payments_controller.rb'. The styling of those hosted pages are controlled by the AuthorizeNet::SIM::HostedReceiptPage and AuthorizeNet::SIM::HostedPaymentForm objects (which are passed to the AuthorizeNet::SIM::Transaction).
39
+
40
+ There is also a default layout generated, 'app/views/layouts/authorize_net.erb'. If you already have your own layout, you can delete that file and the reference to it in the controller ('app/controllers/payments_controller.rb').
41
+
42
+ == Credit Card Test Numbers
43
+
44
+ For your reference, you can use the following test credit card numbers.
45
+ The expiration date must be set to the present date or later. Use 123 for
46
+ the CCV code.
47
+
48
+ American Express:: 370000000000002
49
+ Discover:: 6011000000000012
50
+ Visa:: 4007000000027
51
+ JCB:: 3088000000000017
52
52
  Diners Club/ Carte Blanche:: 38000000000006
@@ -1,8 +1,8 @@
1
- default:
2
- api_login_id: <%= args[0] %>
3
- api_transaction_key: <%= args[1] %>
4
- merchant_hash_value: <%= args[2] %>
5
-
6
- development:
7
- test:
8
- production:
1
+ default:
2
+ api_login_id: <%= args[0] %>
3
+ api_transaction_key: <%= args[1] %>
4
+ merchant_hash_value: <%= args[2] %>
5
+
6
+ development:
7
+ test:
8
+ production:
@@ -1,8 +1,8 @@
1
- default:
2
- api_login_id: <%= self.api_login_id %>
3
- api_transaction_key: <%= self.api_transaction_key %>
4
- merchant_hash_value: <%= self.merchant_hash_value %>
5
-
6
- development:
7
- test:
8
- production:
1
+ default:
2
+ api_login_id: <%= self.api_login_id %>
3
+ api_transaction_key: <%= self.api_transaction_key %>
4
+ merchant_hash_value: <%= self.merchant_hash_value %>
5
+
6
+ development:
7
+ test:
8
+ production:
@@ -1,21 +1,21 @@
1
- class <%= class_name %>Controller < ApplicationController
2
-
3
- layout 'authorize_net'
4
- helper :authorize_net
5
- protect_from_forgery :except => :relay_response
6
-
7
- # GET
8
- # Displays a payment form.
9
- def payment
10
- @amount = 10.00
11
- @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)
12
- @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => <%= singular_name %>_thank_you_url(:only_path => false)))
13
- end
14
-
15
- # GET
16
- # Displays a thank you page.
17
- def thank_you
18
- @auth_code = params[:x_auth_code]
19
- end
20
-
1
+ class <%= class_name %>Controller < ApplicationController
2
+
3
+ layout 'authorize_net'
4
+ helper :authorize_net
5
+ protect_from_forgery :except => :relay_response
6
+
7
+ # GET
8
+ # Displays a payment form.
9
+ def payment
10
+ @amount = 10.00
11
+ @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)
12
+ @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => <%= singular_name %>_thank_you_url(:only_path => false)))
13
+ end
14
+
15
+ # GET
16
+ # Displays a thank you page.
17
+ def thank_you
18
+ @auth_code = params[:x_auth_code]
19
+ end
20
+
21
21
  end
@@ -1,4 +1,4 @@
1
- yml = YAML.load_file("#{Rails.root}/config/authorize_net.yml")
2
- AUTHORIZE_NET_CONFIG = yml['default']
3
- AUTHORIZE_NET_CONFIG.merge!(yml[Rails.env]) unless yml[Rails.env].nil?
4
- AUTHORIZE_NET_CONFIG.freeze
1
+ yml = YAML.load_file("#{Rails.root}/config/authorize_net.yml")
2
+ AUTHORIZE_NET_CONFIG = yml['default']
3
+ AUTHORIZE_NET_CONFIG.merge!(yml[Rails.env]) unless yml[Rails.env].nil?
4
+ AUTHORIZE_NET_CONFIG.freeze
@@ -1,18 +1,18 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>SIM Sample App</title>
5
- <style>
6
- body {
7
- text-align: center;
8
- font-family: Helvetica;
9
- }
10
- label {
11
- display: block;
12
- }
13
- </style>
14
- </head>
15
- <body>
16
- <%= yield %>
17
- </body>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>SIM Sample App</title>
5
+ <style>
6
+ body {
7
+ text-align: center;
8
+ font-family: Helvetica;
9
+ }
10
+ label {
11
+ display: block;
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <%= yield %>
17
+ </body>
18
18
  </html>
@@ -1,6 +1,6 @@
1
- <% form_for :sim_transaction, :url => AuthorizeNet::SIM::Transaction::Gateway::TEST do |f| %>
2
- <%= sim_fields(@sim_transaction) %>
3
- <%= label_tag 'x_amount', "Total: #{number_to_currency(@amount)}" %>
4
- <br />
5
- <%= f.submit 'Purchase'%>
1
+ <% form_for :sim_transaction, :url => AuthorizeNet::SIM::Transaction::Gateway::TEST do |f| %>
2
+ <%= sim_fields(@sim_transaction) %>
3
+ <%= label_tag 'x_amount', "Total: #{number_to_currency(@amount)}" %>
4
+ <br />
5
+ <%= f.submit 'Purchase'%>
6
6
  <% end %>
@@ -1,6 +1,6 @@
1
- <%= form_for :sim_transaction, :url => AuthorizeNet::SIM::Transaction::Gateway::TEST do |f| %>
2
- <%= sim_fields(@sim_transaction) %>
3
- <%= label_tag 'x_amount', "Total: #{number_to_currency(@amount)}" %>
4
- <br />
5
- <%= f.submit 'Purchase'%>
1
+ <%= form_for :sim_transaction, :url => AuthorizeNet::SIM::Transaction::Gateway::TEST do |f| %>
2
+ <%= sim_fields(@sim_transaction) %>
3
+ <%= label_tag 'x_amount', "Total: #{number_to_currency(@amount)}" %>
4
+ <br />
5
+ <%= f.submit 'Purchase'%>
6
6
  <% end %>
@@ -1,75 +1,75 @@
1
- # Extends the Rails::Generator::Commands classes to add support for route and gem configuration generation.
2
-
3
- module Rails
4
- module Generator
5
- module Commands
6
-
7
- class Base
8
- def route_code(route_options)
9
- route_options[:path] = route_options[:name] unless route_options.has_key? :path
10
- code = "map.#{route_options[:name]} '#{route_options[:path]}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
11
- code += ", :conditions => #{route_options[:conditions]}" if route_options.has_key? :conditions
12
- end
13
-
14
- def gsub_file_check(relative_destination, regexp, *args, &block)
15
- path = destination_path(relative_destination)
16
- content = File.read(path)
17
- !(content =~ regexp).nil?
18
- end
19
-
20
- def gem_code(gem_options)
21
- gem_options[:lib] = gem_options[:name] unless gem_options.has_key? :lib
22
- code = "config.gem '#{gem_options[:name]}', :lib => '#{gem_options[:lib]}'"
23
- end
24
- end
25
-
26
- # Here's a readable version of the long string used above in route_code;
27
- # but it should be kept on one line to avoid inserting extra whitespace
28
- # into routes.rb when the generator is run:
29
- # "map.#{route_options[:name]} '#{route_options[:name]}',
30
- # :controller => '#{route_options[:controller]}',
31
- # :action => '#{route_options[:action]}'"
32
-
33
- class Create
34
- def route(route_options)
35
- sentinel = 'ActionController::Routing::Routes.draw do |map|'
36
- unless gsub_file_check 'config/routes.rb', /(#{Regexp.escape(route_code(route_options))})/mi
37
- logger.route route_code(route_options)
38
- gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |m|
39
- "#{m}\n #{route_code(route_options)}"
40
- end
41
- else
42
- logger.identical route_code(route_options)
43
- end
44
- end
45
-
46
- def gem(gem_options)
47
- sentinel = 'Rails::Initializer.run do |config|'
48
- unless gsub_file_check 'config/environment.rb', /(#{Regexp.escape(gem_code(gem_options))})/mi
49
- logger.gem gem_code(gem_options)
50
- gsub_file 'config/environment.rb', /(#{Regexp.escape(sentinel)})/mi do |m|
51
- "#{m}\n #{gem_code(gem_options)}"
52
- end
53
- else
54
- logger.identical gem_code(gem_options)
55
- end
56
- end
57
- end
58
-
59
- class Destroy
60
- def route(route_options)
61
- logger.remove_route route_code(route_options)
62
- to_remove = "\n #{Regexp.escape(route_code(route_options))}"
63
- gsub_file 'config/routes.rb', /(#{to_remove})/mi, ''
64
- end
65
-
66
- def gem(gem_options)
67
- logger.remove_gem gem_code(gem_options)
68
- to_remove = "\n #{Regexp.escape(gem_code(gem_options))}"
69
- gsub_file 'config/environment.rb', /(#{to_remove})/mi, ''
70
- end
71
- end
72
-
73
- end
74
- end
1
+ # Extends the Rails::Generator::Commands classes to add support for route and gem configuration generation.
2
+
3
+ module Rails
4
+ module Generator
5
+ module Commands
6
+
7
+ class Base
8
+ def route_code(route_options)
9
+ route_options[:path] = route_options[:name] unless route_options.has_key? :path
10
+ code = "map.#{route_options[:name]} '#{route_options[:path]}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
11
+ code += ", :conditions => #{route_options[:conditions]}" if route_options.has_key? :conditions
12
+ end
13
+
14
+ def gsub_file_check(relative_destination, regexp, *args, &block)
15
+ path = destination_path(relative_destination)
16
+ content = File.read(path)
17
+ !(content =~ regexp).nil?
18
+ end
19
+
20
+ def gem_code(gem_options)
21
+ gem_options[:lib] = gem_options[:name] unless gem_options.has_key? :lib
22
+ code = "config.gem '#{gem_options[:name]}', :lib => '#{gem_options[:lib]}'"
23
+ end
24
+ end
25
+
26
+ # Here's a readable version of the long string used above in route_code;
27
+ # but it should be kept on one line to avoid inserting extra whitespace
28
+ # into routes.rb when the generator is run:
29
+ # "map.#{route_options[:name]} '#{route_options[:name]}',
30
+ # :controller => '#{route_options[:controller]}',
31
+ # :action => '#{route_options[:action]}'"
32
+
33
+ class Create
34
+ def route(route_options)
35
+ sentinel = 'ActionController::Routing::Routes.draw do |map|'
36
+ unless gsub_file_check 'config/routes.rb', /(#{Regexp.escape(route_code(route_options))})/mi
37
+ logger.route route_code(route_options)
38
+ gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |m|
39
+ "#{m}\n #{route_code(route_options)}"
40
+ end
41
+ else
42
+ logger.identical route_code(route_options)
43
+ end
44
+ end
45
+
46
+ def gem(gem_options)
47
+ sentinel = 'Rails::Initializer.run do |config|'
48
+ unless gsub_file_check 'config/environment.rb', /(#{Regexp.escape(gem_code(gem_options))})/mi
49
+ logger.gem gem_code(gem_options)
50
+ gsub_file 'config/environment.rb', /(#{Regexp.escape(sentinel)})/mi do |m|
51
+ "#{m}\n #{gem_code(gem_options)}"
52
+ end
53
+ else
54
+ logger.identical gem_code(gem_options)
55
+ end
56
+ end
57
+ end
58
+
59
+ class Destroy
60
+ def route(route_options)
61
+ logger.remove_route route_code(route_options)
62
+ to_remove = "\n #{Regexp.escape(route_code(route_options))}"
63
+ gsub_file 'config/routes.rb', /(#{to_remove})/mi, ''
64
+ end
65
+
66
+ def gem(gem_options)
67
+ logger.remove_gem gem_code(gem_options)
68
+ to_remove = "\n #{Regexp.escape(gem_code(gem_options))}"
69
+ gsub_file 'config/environment.rb', /(#{to_remove})/mi, ''
70
+ end
71
+ end
72
+
73
+ end
74
+ end
75
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authorizenet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.7
4
+ version: 1.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Authorize.Net
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2016-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -174,8 +174,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: 1.3.6
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.2.2
177
+ rubygems_version: 2.4.4
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Authorize.Net Payments SDK
181
181
  test_files: []
182
+ has_rdoc: