authorizenet 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authorize_net.rb +1 -0
- data/lib/authorize_net/aim/response.rb +2 -2
- data/lib/authorize_net/fields.rb +14 -1
- data/lib/authorize_net/key_value_transaction.rb +2 -0
- data/lib/authorize_net/reporting/response.rb +28 -2
- data/lib/authorize_net/reporting/returned_item.rb +46 -0
- data/lib/authorize_net/reporting/transaction_details.rb +4 -4
- data/lib/authorize_net/sim/response.rb +2 -2
- data/lib/authorize_net/sim/transaction.rb +2 -2
- data/lib/authorize_net/xml_transaction.rb +1 -0
- metadata +45 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cff60bfbd16f4de9a46d9b4e34193cd3480dcd7
|
4
|
+
data.tar.gz: 2c4fd6d232a0cc895bfa8264b418c3325ad5a4b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f01e13e78ba4ded7e83e6fd1cc981357adb5510333d97b2a40e9ef805d95c2935738d44604fa9fe3bf1f84a5594ef467c9ad6b2641c96730eb7c3aa7141c398
|
7
|
+
data.tar.gz: 538b6a17b2a6d198bfe572f995666a8a5539c9c97b4e2793af5408664c845915c33cc617b4c03cc3e33bd89757314b63233eb77862741102f5f35f55d161790d
|
data/lib/authorize_net.rb
CHANGED
@@ -29,6 +29,7 @@ require "authorize_net/reporting/batch"
|
|
29
29
|
require "authorize_net/reporting/batch_statistics"
|
30
30
|
require "authorize_net/reporting/transaction_details"
|
31
31
|
require "authorize_net/reporting/fds_filter"
|
32
|
+
require "authorize_net/reporting/returned_item"
|
32
33
|
require "authorize_net/response"
|
33
34
|
require "authorize_net/key_value_response"
|
34
35
|
require "authorize_net/xml_response"
|
@@ -4,8 +4,8 @@ module AuthorizeNet::AIM
|
|
4
4
|
class Response < AuthorizeNet::KeyValueResponse
|
5
5
|
|
6
6
|
# Our MD5 digest generator.
|
7
|
-
@@digest = OpenSSL::Digest
|
8
|
-
|
7
|
+
@@digest = OpenSSL::Digest.new('md5')
|
8
|
+
|
9
9
|
include AuthorizeNet::AIM::Fields
|
10
10
|
|
11
11
|
# Fields to convert to/from booleans.
|
data/lib/authorize_net/fields.rb
CHANGED
@@ -689,6 +689,18 @@ module AuthorizeNet
|
|
689
689
|
],
|
690
690
|
AuthorizeNet::LineItem
|
691
691
|
)
|
692
|
+
|
693
|
+
attr_accessor :id, :date_utc, :date_local, :code, :description
|
694
|
+
RETURNED_ITEM_ENTITY_DESCRIPTION = EntityDescription.new([
|
695
|
+
{:id => :id},
|
696
|
+
{:dateUTC => :date_utc},
|
697
|
+
{:dateLocal => :date_local},
|
698
|
+
{:code => :code},
|
699
|
+
{:description => :description}
|
700
|
+
],
|
701
|
+
AuthorizeNet::Reporting::ReturnedItem
|
702
|
+
)
|
703
|
+
|
692
704
|
|
693
705
|
TRANSACTION_DETAILS_ENTITY_DESCRIPTION = EntityDescription.new([
|
694
706
|
{:transId => :id},
|
@@ -721,7 +733,8 @@ module AuthorizeNet
|
|
721
733
|
{:customer => CUSTOMER_ENTITY_DESCRIPTION, :_value => :customer},
|
722
734
|
{:billTo => AuthorizeNet::CIM::Fields::ADDRESS_ENTITY_DESCRIPTION, :_value => :bill_to},
|
723
735
|
{:shipTo => AuthorizeNet::CIM::Fields::ADDRESS_ENTITY_DESCRIPTION, :_value => :ship_to},
|
724
|
-
{:recurringBilling => :recurring_billing, :_convert => :value_to_boolean}
|
736
|
+
{:recurringBilling => :recurring_billing, :_convert => :value_to_boolean},
|
737
|
+
{:hasReturnedItems => :returns, :_convert => :value_to_boolean}
|
725
738
|
],
|
726
739
|
AuthorizeNet::Reporting::TransactionDetails
|
727
740
|
)
|
@@ -8,8 +8,10 @@ module AuthorizeNet
|
|
8
8
|
module Gateway
|
9
9
|
LIVE = 'https://secure.authorize.net/gateway/transact.dll'
|
10
10
|
TEST = 'https://test.authorize.net/gateway/transact.dll'
|
11
|
+
#TEST = 'https://qagreta1d.qa.intra/gateway/transact.dll'
|
11
12
|
CARD_PRESENT_LIVE = 'https://cardpresent.authorize.net/gateway/transact.dll'
|
12
13
|
CARD_PRESENT_TEST = 'https://test.authorize.net/gateway/transact.dll'
|
14
|
+
#CARD_PRESENT_TEST = 'https://qagreta1d.qa.intra/gateway/transact.dll'
|
13
15
|
end
|
14
16
|
|
15
17
|
# Constants for both the various Authorize.Net payment transaction types are defined here.
|
@@ -42,7 +42,7 @@ module AuthorizeNet::Reporting
|
|
42
42
|
transaction = build_entity(child, Fields::TRANSACTION_DETAILS_ENTITY_DESCRIPTION)
|
43
43
|
|
44
44
|
# handle some stuff thats too tricky for EntityDecription to handle
|
45
|
-
|
45
|
+
first_name = node_content_unless_nil(child.at_css('firstName'))
|
46
46
|
last_name = node_content_unless_nil(child.at_css('lastName'))
|
47
47
|
unless first_name.nil? && last_name.nil?
|
48
48
|
address = AuthorizeNet::Address.new(:first_name => first_name, :last_name => last_name)
|
@@ -118,7 +118,33 @@ module AuthorizeNet::Reporting
|
|
118
118
|
transaction.customer ||= AuthorizeNet::CIM::CustomerProfile.new()
|
119
119
|
transaction.customer.payment_profiles = [AuthorizeNet::CIM::PaymentProfile.new(:cust_type => customer_type)]
|
120
120
|
end
|
121
|
-
|
121
|
+
|
122
|
+
subscription = @transaction.at_css('subscription')
|
123
|
+
unless subscription.nil?
|
124
|
+
subscription_id = node_content_unless_nil(@transaction.at_css('subscription').at_css('id'))
|
125
|
+
transaction.subscription_id = value_to_decimal(subscription_id) unless subscription_id.nil?
|
126
|
+
|
127
|
+
pay_num = node_content_unless_nil(@transaction.at_css('subscription').at_css('payNum'))
|
128
|
+
transaction.subscription_paynum = value_to_decimal(pay_num) unless pay_num.nil?
|
129
|
+
end
|
130
|
+
|
131
|
+
solution = @transaction.at_css('solution')
|
132
|
+
unless solution.nil?
|
133
|
+
solution_id = node_content_unless_nil(@transaction.at_css('solution').at_css('id'))
|
134
|
+
transaction.solution_id = value_to_decimal(solution_id) unless solution_id.nil?
|
135
|
+
|
136
|
+
transaction.solution_name = node_content_unless_nil(@transaction.at_css('solution').at_css('name'))
|
137
|
+
end
|
138
|
+
|
139
|
+
returned_items = @transaction.at_css('returnedItems')
|
140
|
+
unless returned_items.nil?
|
141
|
+
transaction.returns ||= AuthorizeNet::Reporting::ReturnedItem.new
|
142
|
+
returned_items.element_children.each do |child|
|
143
|
+
returned_item = build_entity(child, Fields::RETURNED_ITEM_ENTITY_DESCRIPTION)
|
144
|
+
transaction.returns.add_returned_item(returned_item)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
122
148
|
return transaction
|
123
149
|
end
|
124
150
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module AuthorizeNet::Reporting
|
2
|
+
|
3
|
+
class ReturnedItem
|
4
|
+
include AuthorizeNet::Model
|
5
|
+
|
6
|
+
attr_accessor :id, :date_utc, :date_local, :code, :description, :returned_items
|
7
|
+
|
8
|
+
def date_utc=(time)
|
9
|
+
if time.kind_of?(DateTime)
|
10
|
+
@date_utc = time
|
11
|
+
else
|
12
|
+
@date_utc = DateTime.parse(time.to_s)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def date_local=(time)
|
17
|
+
if time.kind_of?(DateTime)
|
18
|
+
@date_local = time
|
19
|
+
else
|
20
|
+
@date_local = DateTime.parse(time.to_s)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def add_returned_item(id = nil, date_utc = nil, date_local = nil, code = nil, description = nil)
|
25
|
+
if id.kind_of?(AuthorizeNet::Reporting::ReturnedItem)
|
26
|
+
returned_item = id
|
27
|
+
else
|
28
|
+
returned_item = AuthorizeNet::Reporting::ReturnedItem.new({:return_item_id => id, :return_item_date_utc => date_utc, :return_item_date_utc => date_local, :return_item_code => code, :line_item_description => description})
|
29
|
+
end
|
30
|
+
@returned_items = @returned_items.to_a << returned_item
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_hash
|
34
|
+
hash = {
|
35
|
+
:id => @id,
|
36
|
+
:date_utc => @date_utc,
|
37
|
+
:date_local => @date_local,
|
38
|
+
:code => @code,
|
39
|
+
:description => @description,
|
40
|
+
:returned_items => handle_multivalue_hashing(@returned_items)
|
41
|
+
}
|
42
|
+
hash.delete_if { |k, v| v.nil? }
|
43
|
+
hash
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -4,13 +4,14 @@ module AuthorizeNet::Reporting
|
|
4
4
|
class TransactionDetails
|
5
5
|
|
6
6
|
include AuthorizeNet::Model
|
7
|
-
|
7
|
+
|
8
8
|
attr_accessor :id, :submitted_at, :status, :order, :customer, :account_type,
|
9
9
|
:account_number, :settle_amount, :reference_id, :split_tender_id,
|
10
10
|
:type, :response_code, :response_reason_code, :response_reason_description,
|
11
11
|
:auth_code, :avs_response, :card_code_response, :cavv_response,
|
12
12
|
:fds_filter_action, :fds_filters, :batch, :prepaid_balance_remaining,
|
13
|
-
:payment_method, :recurring_billing, :bill_to, :ship_to, :auth_amount
|
13
|
+
:payment_method, :recurring_billing, :bill_to, :ship_to, :auth_amount,
|
14
|
+
:subscription_id, :subscription_paynum, :solution_id, :solution_name, :returns
|
14
15
|
|
15
16
|
def submitted_at=(time)
|
16
17
|
if time.kind_of?(DateTime)
|
@@ -19,7 +20,6 @@ module AuthorizeNet::Reporting
|
|
19
20
|
@submitted_at = DateTime.parse(time.to_s)
|
20
21
|
end
|
21
22
|
end
|
22
|
-
|
23
|
-
end
|
24
23
|
|
24
|
+
end
|
25
25
|
end
|
@@ -5,8 +5,8 @@ module AuthorizeNet::SIM
|
|
5
5
|
class Response < AuthorizeNet::KeyValueResponse
|
6
6
|
|
7
7
|
# Our MD5 digest generator.
|
8
|
-
@@digest = OpenSSL::Digest
|
9
|
-
|
8
|
+
@@digest = OpenSSL::Digest.new('md5')
|
9
|
+
|
10
10
|
include AuthorizeNet::SIM::Fields
|
11
11
|
|
12
12
|
# Constructs a new response object from a +raw_response+. Provides utility methods
|
@@ -7,8 +7,8 @@ module AuthorizeNet::SIM
|
|
7
7
|
RANDOM_SEQUENCE_MAX = (1 << 32) - 1
|
8
8
|
|
9
9
|
# Our MD5 digest generator.
|
10
|
-
@@digest = OpenSSL::Digest
|
11
|
-
|
10
|
+
@@digest = OpenSSL::Digest.new('md5')
|
11
|
+
|
12
12
|
# The default options for the constructor.
|
13
13
|
@@option_defaults = {
|
14
14
|
:sequence => nil,
|
@@ -10,6 +10,7 @@ module AuthorizeNet
|
|
10
10
|
module Gateway
|
11
11
|
LIVE = 'https://api.authorize.net/xml/v1/request.api'
|
12
12
|
TEST = 'https://apitest.authorize.net/xml/v1/request.api'
|
13
|
+
#TEST = 'https://qagrecp1d.vposdownload.qa.intra/xml/v1/request.api'
|
13
14
|
end
|
14
15
|
|
15
16
|
# Constants for both the various Authorize.Net transaction types are defined here.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authorizenet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Authorize.Net
|
@@ -14,22 +14,56 @@ dependencies:
|
|
14
14
|
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.4'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 1.4.3
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.6'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.4.3
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.6'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rake
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
26
36
|
requirements:
|
27
37
|
- - "~>"
|
28
38
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
39
|
+
version: '0.8'
|
30
40
|
- - ">="
|
31
41
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
42
|
+
version: 0.8.7
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0.8'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.8.7
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rspec
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '2.1'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '2.1'
|
33
67
|
description: Authorize.Net SDK includes standard payments, recurring billing, and
|
34
68
|
customer profiles
|
35
69
|
email: developer@authorize.net
|
@@ -38,6 +72,7 @@ extensions: []
|
|
38
72
|
extra_rdoc_files: []
|
39
73
|
files:
|
40
74
|
- lib/app/helpers/authorize_net_helper.rb
|
75
|
+
- lib/authorize_net.rb
|
41
76
|
- lib/authorize_net/addresses/address.rb
|
42
77
|
- lib/authorize_net/addresses/shipping_address.rb
|
43
78
|
- lib/authorize_net/aim/response.rb
|
@@ -63,6 +98,7 @@ files:
|
|
63
98
|
- lib/authorize_net/reporting/batch_statistics.rb
|
64
99
|
- lib/authorize_net/reporting/fds_filter.rb
|
65
100
|
- lib/authorize_net/reporting/response.rb
|
101
|
+
- lib/authorize_net/reporting/returned_item.rb
|
66
102
|
- lib/authorize_net/reporting/transaction.rb
|
67
103
|
- lib/authorize_net/reporting/transaction_details.rb
|
68
104
|
- lib/authorize_net/response.rb
|
@@ -73,7 +109,6 @@ files:
|
|
73
109
|
- lib/authorize_net/transaction.rb
|
74
110
|
- lib/authorize_net/xml_response.rb
|
75
111
|
- lib/authorize_net/xml_transaction.rb
|
76
|
-
- lib/authorize_net.rb
|
77
112
|
- lib/authorizenet.rb
|
78
113
|
- lib/generators/authorize_net/direct_post_generator.rb
|
79
114
|
- lib/generators/authorize_net/sim_generator.rb
|
@@ -89,15 +124,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
124
|
requirements:
|
90
125
|
- - ">="
|
91
126
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
127
|
+
version: 1.8.7
|
93
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
129
|
requirements:
|
95
130
|
- - ">="
|
96
131
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
132
|
+
version: 1.3.6
|
98
133
|
requirements: []
|
99
134
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.2.1
|
101
136
|
signing_key:
|
102
137
|
specification_version: 4
|
103
138
|
summary: Authorize.Net Payments SDK
|