authorizenet 1.9.7 → 2.0.0

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 (74) hide show
  1. checksums.yaml +5 -5
  2. data/lib/app/helpers/authorize_net_helper.rb +23 -23
  3. data/lib/authorize_net.rb +62 -107
  4. data/lib/authorize_net/api/LogHelper.rb +97 -97
  5. data/lib/authorize_net/api/SensitiveDataFilter.rb +92 -92
  6. data/lib/authorize_net/api/api_transaction.rb +129 -129
  7. data/lib/authorize_net/api/constants.yml +1 -1
  8. data/lib/authorize_net/api/schema.rb +5421 -5421
  9. data/lib/authorize_net/api/transaction.rb +265 -265
  10. data/lib/authorize_net/authorize_net.rb +154 -154
  11. data/lib/authorize_net/response.rb +23 -25
  12. data/lib/authorize_net/transaction.rb +64 -66
  13. data/lib/authorize_net/xml_response.rb +154 -154
  14. data/lib/authorize_net/xml_transaction.rb +279 -279
  15. data/lib/authorizenet.rb +4 -4
  16. metadata +3 -61
  17. data/lib/authorize_net/addresses/address.rb +0 -25
  18. data/lib/authorize_net/addresses/shipping_address.rb +0 -22
  19. data/lib/authorize_net/aim/response.rb +0 -120
  20. data/lib/authorize_net/aim/transaction.rb +0 -171
  21. data/lib/authorize_net/arb/fields.rb +0 -24
  22. data/lib/authorize_net/arb/paging.rb +0 -29
  23. data/lib/authorize_net/arb/response.rb +0 -26
  24. data/lib/authorize_net/arb/sorting.rb +0 -39
  25. data/lib/authorize_net/arb/subscription.rb +0 -68
  26. data/lib/authorize_net/arb/subscription_detail.rb +0 -10
  27. data/lib/authorize_net/arb/subscription_list_response.rb +0 -36
  28. data/lib/authorize_net/arb/transaction.rb +0 -171
  29. data/lib/authorize_net/cim/customer_profile.rb +0 -15
  30. data/lib/authorize_net/cim/payment_profile.rb +0 -35
  31. data/lib/authorize_net/cim/response.rb +0 -111
  32. data/lib/authorize_net/cim/transaction.rb +0 -721
  33. data/lib/authorize_net/customer.rb +0 -24
  34. data/lib/authorize_net/email_receipt.rb +0 -20
  35. data/lib/authorize_net/fields.rb +0 -760
  36. data/lib/authorize_net/key_value_response.rb +0 -109
  37. data/lib/authorize_net/key_value_transaction.rb +0 -281
  38. data/lib/authorize_net/line_item.rb +0 -21
  39. data/lib/authorize_net/order.rb +0 -38
  40. data/lib/authorize_net/payment_methods/credit_card.rb +0 -61
  41. data/lib/authorize_net/payment_methods/echeck.rb +0 -70
  42. data/lib/authorize_net/reporting/batch.rb +0 -16
  43. data/lib/authorize_net/reporting/batch_statistics.rb +0 -15
  44. data/lib/authorize_net/reporting/fds_filter.rb +0 -8
  45. data/lib/authorize_net/reporting/response.rb +0 -157
  46. data/lib/authorize_net/reporting/returned_item.rb +0 -45
  47. data/lib/authorize_net/reporting/transaction.rb +0 -131
  48. data/lib/authorize_net/reporting/transaction_details.rb +0 -22
  49. data/lib/authorize_net/sim/hosted_payment_form.rb +0 -34
  50. data/lib/authorize_net/sim/hosted_receipt_page.rb +0 -32
  51. data/lib/authorize_net/sim/response.rb +0 -133
  52. data/lib/authorize_net/sim/transaction.rb +0 -128
  53. data/lib/generators/authorize_net/direct_post/direct_post_generator.rb +0 -52
  54. data/lib/generators/authorize_net/direct_post/templates/README-AuthorizeNet +0 -49
  55. data/lib/generators/authorize_net/direct_post/templates/config.yml.erb +0 -8
  56. data/lib/generators/authorize_net/direct_post/templates/config.yml.rails3.erb +0 -8
  57. data/lib/generators/authorize_net/direct_post/templates/controller.rb.erb +0 -31
  58. data/lib/generators/authorize_net/direct_post/templates/initializer.rb +0 -4
  59. data/lib/generators/authorize_net/direct_post/templates/layout.erb +0 -18
  60. data/lib/generators/authorize_net/direct_post/templates/payment.erb +0 -10
  61. data/lib/generators/authorize_net/direct_post/templates/payment.rails3.erb +0 -10
  62. data/lib/generators/authorize_net/direct_post/templates/receipt.erb +0 -1
  63. data/lib/generators/authorize_net/direct_post/templates/relay_response.erb +0 -1
  64. data/lib/generators/authorize_net/sim/sim_generator.rb +0 -46
  65. data/lib/generators/authorize_net/sim/templates/README-AuthorizeNet +0 -52
  66. data/lib/generators/authorize_net/sim/templates/config.yml.erb +0 -8
  67. data/lib/generators/authorize_net/sim/templates/config.yml.rails3.erb +0 -8
  68. data/lib/generators/authorize_net/sim/templates/controller.rb.erb +0 -21
  69. data/lib/generators/authorize_net/sim/templates/initializer.rb +0 -4
  70. data/lib/generators/authorize_net/sim/templates/layout.erb +0 -18
  71. data/lib/generators/authorize_net/sim/templates/payment.erb +0 -6
  72. data/lib/generators/authorize_net/sim/templates/payment.rails3.erb +0 -6
  73. data/lib/generators/authorize_net/sim/templates/thank_you.erb +0 -1
  74. data/lib/generators/generator_extensions.rb +0 -73
@@ -1,22 +0,0 @@
1
- module AuthorizeNet::Reporting
2
- # Models the details of a transaction.
3
- class TransactionDetails
4
- include AuthorizeNet::Model
5
-
6
- attr_accessor :id, :submitted_at, :status, :order, :customer, :account_type,
7
- :account_number, :settle_amount, :reference_id, :split_tender_id,
8
- :type, :response_code, :response_reason_code, :response_reason_description,
9
- :auth_code, :avs_response, :card_code_response, :cavv_response,
10
- :fds_filter_action, :fds_filters, :batch, :prepaid_balance_remaining,
11
- :payment_method, :recurring_billing, :bill_to, :ship_to, :auth_amount,
12
- :subscription_id, :subscription_paynum, :solution_id, :solution_name, :returns
13
-
14
- def submitted_at=(time)
15
- if time.is_a?(DateTime)
16
- @submitted_at = time
17
- else
18
- @submitted_at = DateTime.parse(time.to_s)
19
- end
20
- end
21
- end
22
- end
@@ -1,34 +0,0 @@
1
- module AuthorizeNet::SIM
2
- # Models a hosted payment form.
3
- class HostedPaymentForm
4
- include AuthorizeNet::Model
5
-
6
- attr_accessor :header_html, :footer_html, :color_background, :color_link, :color_text, :logo_url, :background_url, :rename
7
-
8
- # Convenience method for adding field rename requests to the transaction. This renames a field shown on
9
- # the hosted payment form.
10
- def add_rename(field, name)
11
- rename = "#{field},#{name}"
12
- if @rename.nil?
13
- @rename = [rename]
14
- else
15
- @rename = @rename.to_a << rename
16
- end
17
- end
18
-
19
- def to_hash
20
- hash = {
21
- header_html_payment_form: @header_html,
22
- footer_html_payment_form: @footer_html,
23
- color_background: @color_background,
24
- color_link: @color_link,
25
- color_text: @color_text,
26
- logo_url: @logo_url,
27
- background_url: @background_url,
28
- rename: @rename
29
- }
30
- hash.delete_if { |_k, v| v.nil? }
31
- hash
32
- end
33
- end
34
- end
@@ -1,32 +0,0 @@
1
- module AuthorizeNet::SIM
2
- # Models a hosted receipt page.
3
- class HostedReceiptPage
4
- # Defines constants for each of the link methods used by the hosted receipt page.
5
- module LinkMethod
6
- LINK = 'LINK'.freeze
7
- POST = 'POST'.freeze
8
- GET = 'GET'.freeze
9
- end
10
-
11
- include AuthorizeNet::Model
12
-
13
- attr_accessor :header_html, :footer_html, :color_background, :color_link, :color_text, :logo_url, :background_url, :link_method, :link_text, :link_url
14
-
15
- def to_hash
16
- hash = {
17
- header_html_receipt: @header_html,
18
- footer_html_receipt: @footer_html,
19
- color_background: @color_background,
20
- color_link: @color_link,
21
- color_text: @color_text,
22
- logo_url: @logo_url,
23
- background_url: @background_url,
24
- receipt_link_method: @link_method,
25
- receipt_link_text: @link_text,
26
- receipt_link_url: @link_url
27
- }
28
- hash.delete_if { |_k, v| v.nil? }
29
- hash
30
- end
31
- end
32
- end
@@ -1,133 +0,0 @@
1
- module AuthorizeNet::SIM
2
- # The SIM response class. Handles parsing the response from the gateway. Also
3
- # provides a few relay response helpers used to implement Direct Post Method.
4
- class Response < AuthorizeNet::KeyValueResponse
5
- # Our MD5 digest generator.
6
- @@digest = OpenSSL::Digest.new('md5')
7
-
8
- include AuthorizeNet::SIM::Fields
9
-
10
- # Constructs a new response object from a +raw_response+. Provides utility methods
11
- # for validating the response as authentic, and for handling the Direct Post Method
12
- # relay response.
13
- #
14
- # +raw_response+:: The raw response, either a string in POST body or GET query string format, or a hash of key/value pairs.
15
- #
16
- # Typical usage:
17
- # response = AuthorizeNet::SIM::Response("x_first_name=John&x_last_name=Doe")
18
- def initialize(raw_response)
19
- @raw_response = raw_response
20
- @custom_fields = {}
21
- @fields = {}
22
- parse_response(@raw_response)
23
- end
24
-
25
- # Returns True if the MD5 hash found in the response payload validates using
26
- # the supplied api_login and secret merchant_value (THIS IS NOT YOUR API KEY).
27
- def valid_md5?(api_login, merchant_value)
28
- return false if @fields[:MD5_Hash].nil?
29
- @@digest.hexdigest("#{merchant_value}#{api_login}#{@fields[:trans_id]}#{@fields[:amount]}").casecmp(@fields[:MD5_Hash]).zero?
30
- end
31
-
32
- # Returns an HTML string that can be returned to the gateway during the Relay Response,
33
- # and will send the user on to URL you specify. Takes a hash of options, currently the
34
- # only option is :include, which can be True to include all fields returned in the response
35
- # as query string parameters, or it can be an array of fields to include.
36
- def direct_post_reply(url, options = {})
37
- url = direct_post_url(url, options[:include]) if options.key?(:include)
38
- js_url = url.tr("'", '\'')
39
- html_url = url.gsub('&', '&amp;').tr('"', "\"")
40
- html = <<-HTML
41
- <html><head><script type="text/javascript" charset="utf-8">window.location='#{js_url}';</script><noscript><meta http-equiv="refresh" content="1;url=#{html_url}"></noscript></head><body></body></html>
42
- HTML
43
- end
44
-
45
- # Returns an URL with the fields found in the response and specified in include_fields attached as
46
- # part of the URL's query string. If you pass true instead of an array of fields, all fields will be
47
- # attached.
48
- def direct_post_url(base_url, include_fields = true)
49
- url = base_url
50
- if include_fields
51
- fields = []
52
- case include_fields
53
- when TrueClass
54
- fields = FIELDS.collect do |k|
55
- k_str = k.to_s
56
- k_str[2..k_str.length].to_sym
57
- end
58
- when Array
59
- fields = include_fields
60
- else
61
- fields = include_fields.to_a
62
- end
63
- parsed_url = URI.parse(url)
64
- if parsed_url.query.nil?
65
- parsed_url.query = ''
66
- elsif !parsed_url.query.empty?
67
- parsed_url.query = parsed_url.query.chomp('&') + '&'
68
- end
69
- parsed_url.query += ((fields.select { |k| @fields.key?(k) }).collect { |k| to_param(k, @fields[k]) }).join('&')
70
- parsed_url.query.chomp('&')
71
- url = parsed_url.to_s
72
- end
73
- url
74
- end
75
-
76
- # Check to see if the response indicated success. Success is defined as a valid MD5 hash
77
- # and an response code of AuthorizeNet::Response::ResponseCode::APPROVED.
78
- def success?(api_login, merchant_value)
79
- valid_md5?(api_login, merchant_value) && approved?
80
- end
81
-
82
- # Returns the transaction's authorization code. This should be shown to the
83
- # end user.
84
- def authorization_code
85
- @fields[:auth_code]
86
- end
87
-
88
- # Returns the transaction's authorization id. You will need this for future void, refund
89
- # and prior authorization capture requests.
90
- def transaction_id
91
- @fields[:trans_id]
92
- end
93
-
94
- # Returns the customer id from the response.
95
- def customer_id
96
- @fields[:cust_id]
97
- end
98
-
99
- # Returns a response code (from AVSResponseCode) indicating the result of any Address Verification
100
- # Service checks.
101
- def avs_response
102
- @fields[:avs_code]
103
- end
104
-
105
- #:enddoc:
106
- protected
107
-
108
- # Internal helper to parse the raw response object. It handles both raw POST bodies and
109
- # hashes.
110
- def parse_response(raw_response)
111
- case raw_response
112
- when Hash
113
- raw_response.each do |k, v|
114
- k = k.to_sym
115
- if FIELDS.include?(k)
116
- @fields[to_internal_field(k)] = v # remove x_ from sym and stick in @fields
117
- else
118
- @custom_fields[k] = v
119
- end
120
- end
121
- when String
122
- # convert to hash and re-parse
123
- hash = CGI.parse(raw_response)
124
- hash.each do |k, v|
125
- hash[k] = v[0] if v.is_a?(Array) && v.length == 1
126
- end
127
- parse_response(hash)
128
- else
129
- parse_response(@raw_response.to_s)
130
- end
131
- end
132
- end
133
- end
@@ -1,128 +0,0 @@
1
- module AuthorizeNet::SIM
2
- # The SIM transaction class. Handles building the transaction payload and
3
- # generating a set of hidden form fields to be POSTed to the gateway.
4
- class Transaction < AuthorizeNet::KeyValueTransaction
5
- RANDOM_SEQUENCE_MAX = (1 << 32) - 1
6
-
7
- # Our MD5 digest generator.
8
- @@digest = OpenSSL::Digest.new('md5')
9
-
10
- # The default options for the constructor.
11
- @@option_defaults = {
12
- sequence: nil,
13
- timestamp: nil,
14
- test: false,
15
- hosted_payment_form: false,
16
- relay_response: true,
17
- relay_url: nil,
18
- transaction_type: Type::AUTHORIZE_AND_CAPTURE
19
- }
20
-
21
- # Constructs a SIM transaction. You can use the new SIM transaction object
22
- # to build the hidden field payload needed to process a SIM transaction with
23
- # the gateway. In particular, this class handles generating the MD5 fingerprint
24
- # used to authenticate transactions at the gateway. Since the fingerprint includes
25
- # the amount to charge, you should not construct this object until you know EXACTLY
26
- # how much you want to charge (or authorize).
27
- #
28
- # +api_login_id+:: Your API login ID, as a string.
29
- # +api_transaction_key+:: Your API transaction key, as a string.
30
- # +amount+:: The amount of the transaction, as a string, Float or BigDecimal.
31
- # +options+:: A hash of options. See below for values.
32
- #
33
- # Options
34
- # +sequence+:: The sequence number of the transaction as a string or Integer. This is usually something like an invoice number. If none is provided, the SDK generates one at random.
35
- # +timestamp+:: The time the transaction was initiated as a string or Integer. This needs to be within 15 minutes of when the gateway receives the transaction. If no value is provided, the SDK defaults it to Time.now().
36
- # +test+:: A boolean indicating if the transaction should be run in test mode or not (defaults to false).
37
- # +hosted_payment_form+:: A boolean indicating if the transaction should use a hosted payment form (defaults to false).
38
- # +relay_response+:: A boolean indicating if the transaction should use the relay response feature to return a receipt to the customer (defaults to true). Direct Post Method requires using a relay response.
39
- # +relay_url+:: A string of the URL that the gateway should hit to get the relay response (defaults to nil).
40
- # +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.
41
- #
42
- def initialize(api_login_id, api_transaction_key, amount, options = {})
43
- ActiveSupport::Deprecation.warn "use AuthorizeNet::API::Transaction"
44
- super()
45
- @api_transaction_key = api_transaction_key
46
- @api_login_id = api_login_id
47
- @amount = decimal_to_value(amount)
48
- options = @@option_defaults.merge(options)
49
- @sequence = options[:sequence]
50
- @timestamp = options[:timestamp]
51
- @test_mode = options[:test]
52
- @hosted_payment_form = options[:hosted_payment_form]
53
- @relay_url = options[:relay_url]
54
- @type = options[:transaction_type]
55
- if @relay_url.nil?
56
- @relay_response = !!options[:relay_response]
57
- else
58
- @relay_response = true
59
- end
60
- @delim_data = !@relay_response
61
- end
62
-
63
- # Calculates and returns the HMAC-MD5 fingerprint needed to authenticate the transaction
64
- # with the SIM gateway.
65
- def fingerprint
66
- @timestamp = Time.now.to_i if @timestamp.nil?
67
-
68
- @sequence = rand(RANDOM_SEQUENCE_MAX) if @sequence.nil?
69
- OpenSSL::HMAC.hexdigest(@@digest, @api_transaction_key, "#{@api_login_id.to_s.rstrip}^#{@sequence.to_s.rstrip}^#{@timestamp.to_s.rstrip}^#{@amount.to_s.rstrip}^")
70
- end
71
-
72
- # Returns all the fields needed for the fingerprint. These must all be passed to the SIM
73
- # exactly as returned. And these values are time sensitive.
74
- def fingerprint_fields
75
- {
76
- login: @api_login_id,
77
- fp_hash: fingerprint,
78
- fp_sequence: @sequence,
79
- fp_timestamp: @timestamp,
80
- amount: @amount
81
- }
82
- end
83
-
84
- # Returns all the fields (including custom) exactly as they should be named
85
- # in the SIM form. Fields with multiple values are returned with an array
86
- # for the key's value.
87
- def form_fields
88
- form_fields = {}
89
- form_fields[:x_test_request] = boolean_to_value(@test_mode)
90
- form_fields[:x_show_form] = 'PAYMENT_FORM' if @hosted_payment_form
91
- if @relay_response && !@relay_url.nil?
92
- form_fields[:x_relay_url] = @relay_url
93
- end
94
- fields.merge(type: @type, version: @version, delim_data: boolean_to_value(@delim_data), relay_response: boolean_to_value(@relay_response)).each do |k, v|
95
- form_fields[to_external_field(k)] = v
96
- end
97
- fingerprint_fields.each do |k, v|
98
- form_fields[to_external_field(k)] = v
99
- end
100
- form_fields.merge(custom_fields)
101
- end
102
-
103
- # Takes an instance of AuthorizeNet::SIM::HostedPaymentForm and adds it to the transaction. Note that
104
- # many of the fields in AuthorizeNet::SIM::HostedPaymentForm are shared with those in
105
- # AuthorizeNet::SIM::HostedReceiptPage. For the duplicate fields, which ever value
106
- # is added to the transaction last will be the one used.
107
- def set_hosted_payment_form(form)
108
- @fields.merge!(form.to_hash)
109
- @hosted_payment_form = true
110
- end
111
-
112
- # Takes an instance of AuthorizeNet::SIM::HostedReceiptPage and adds it to the transaction. Note that
113
- # many of the fields in AuthorizeNet::SIM::HostedReceiptPage are shared with those in
114
- # AuthorizeNet::SIM::HostedPaymentForm. For the duplicate fields, which ever value
115
- # is added to the transaction last will be the one used. If you set a hosted payment receipt,
116
- # the relay response will be disabled.
117
- def set_hosted_payment_receipt(form)
118
- @fields.merge!(form.to_hash)
119
- @relay_response = false
120
- @delim_data = true
121
- end
122
-
123
- # An alias for form_fields.
124
- def run
125
- form_fields
126
- end
127
- end
128
- end
@@ -1,52 +0,0 @@
1
- require 'rails/generators'
2
- require 'rails/generators/named_base'
3
-
4
- module AuthorizeNet
5
- module Generators
6
- class DirectPostGenerator < Rails::Generators::NamedBase
7
- source_root File.expand_path('templates', __dir__)
8
- p '__FILE__:' + __FILE__
9
- p 'source_root:' + source_root
10
- argument :api_login_id, type: :string, desc: 'Your Authorize.Net API login ID.', optional: true
11
- argument :api_transaction_key, type: :string, desc: 'Your Authorize.Net API transaction key.', optional: true
12
- argument :merchant_hash_value, type: :string, desc: 'Your Authorize.Net merchant hash value.', optional: true
13
- desc <<-DESC
14
- Description
15
- Generates a simple implementation of Authorize.Net's Direct Post Method integration method.
16
-
17
- Example:
18
- rails generate authorize_net:direct_post payments API_LOGIN_ID API_TRANSACTION_KEY MERCHANT_HASH_VALUE
19
-
20
- This will create:
21
- create README-AuthorizeNet
22
- create app/views/payments
23
- create app/views/payments/payment.erb
24
- create app/views/payments/receipt.erb
25
- create app/views/payments/relay_response.erb
26
- create app/views/layouts/authorize_net.erb
27
- create config/authorize_net.yml
28
- create config/initializers/authorize_net.rb
29
- create app/controllers/payments_controller.rb
30
- route match '/payments/receipt', :to => 'payments#receipt', :as => 'payments_receipt', :via => [:get]
31
- route match '/payments/relay_response', :to => 'payments#relay_response', :as => 'payments_relay_response', :via => [:post]
32
- route match '/payments/payment', :to => 'payments#payment', :as => 'paymentspayment', :via => [:get]
33
-
34
- DESC
35
-
36
- def manifest
37
- copy_file "README-AuthorizeNet", "README-AuthorizeNet"
38
- empty_directory "app/views/#{file_name}"
39
- copy_file "payment.rails3.erb", "app/views/#{file_name}/payment.erb"
40
- copy_file "receipt.erb", "app/views/#{file_name}/receipt.erb"
41
- copy_file "relay_response.erb", "app/views/#{file_name}/relay_response.erb"
42
- copy_file "layout.erb", "app/views/layouts/authorize_net.erb"
43
- template "config.yml.rails3.erb", "config/authorize_net.yml"
44
- copy_file "initializer.rb", "config/initializers/authorize_net.rb"
45
- template "controller.rb.erb", "app/controllers/#{file_name}_controller.rb"
46
- route "match '/#{plural_name}/receipt', :to => '#{file_name}#receipt', :as => '#{singular_name}_receipt', :via => [:get]"
47
- route "match '/#{plural_name}/relay_response', :to => '#{file_name}#relay_response', :as => '#{singular_name}_relay_response', :via => [:post]"
48
- route "match '/#{plural_name}/payment', :to => '#{file_name}#payment', :as => '#{singular_name}payment', :via => [:get]"
49
- end
50
- end
51
- end
52
- end
@@ -1,49 +0,0 @@
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
- A generator is provided to aid in setting up a Direct Post Method application. In the example below 'payments' is the name of the controller to generate.
27
-
28
- > sudo gem install rails -v '~> 2.1'
29
- > rails my_direct_post_app
30
- > cd my_direct_post_app
31
- > script/generate authorize_net_direct_post payments YOUR_API_LOGIN_ID YOUR_TRANSACTION_KEY MERCH_HASH_KEY
32
- > script/server
33
-
34
- After running the generator you will probably want to customize the payment form found in 'app/views/payments/payment.erb' and the receipt found in 'app/views/payments/receipt.erb'.
35
-
36
- 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').
37
-
38
-
39
- == Credit Card Test Numbers
40
-
41
- For your reference, you can use the following test credit card numbers.
42
- The expiration date must be set to the present date or later. Use 123 for
43
- the CCV code.
44
-
45
- American Express:: 370000000000002
46
- Discover:: 6011000000000012
47
- Visa:: 4007000000027
48
- JCB:: 3088000000000017
49
- Diners Club/ Carte Blanche:: 38000000000006