activemerchant 1.22.0 → 1.23.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,44 +7,65 @@ module ActiveMerchant #:nodoc:
7
7
  module Integrations #:nodoc:
8
8
  module TwoCheckout
9
9
  class Notification < ActiveMerchant::Billing::Integrations::Notification
10
- # order_number 2Checkout.com order number
11
- # card_holder_name Card holder's name
12
- # street_address Card holder's address
13
- # city Card holder's city
14
- # state Card holder's state
15
- # zip Card holder's zip
16
- # country Card holder's country
17
- # email Card holder's email
18
- # phone Card holder's phone
19
- # credit_card_processed Y if successful, K if waiting for approval
20
- # total Total purchase amount
21
- # ship_name Shipping information
22
- # ship_street_address Shipping information
23
- # ship_city Shipping information
24
- # ship_state Shipping information
25
- # ship_zip Shipping information
26
- # ship_country Shipping information
27
- # product_id 2Checkout product ID for purchased items will append a number if more than one item.
28
- # ex. product_id,product_id1,product_id2
29
- # quantity quantity of corresponding product will append a number if more than one item.
30
- # ex. quantity,quantity1,quantity2
31
- # merchant_product_id your product ID for purchased items will append a number if more than one item.
32
- # ex. merchant_product_id,merchant_product_id1,merchant_product_id2
33
- # product_description your description for purchased items will append a number if more than one item.
34
- # ex. product_description,product_description1,product_description2
35
-
10
+ # card_holder_name - Provides the customer’s name.
11
+ # city - Provides the customer’s city.
12
+ # country - Provides the customer’s country.
13
+ # credit_card_processed - This parameter will always be passed back as Y.
14
+ # demo - Defines if an order was live, or if the order was a demo order. If the order was a demo, the MD5 hash will fail.
15
+ # email - Provides the email address the customer provided when placing the order.
16
+ # fixed - This parameter will only be passed back if it was passed into the purchase routine.
17
+ # ip_country - Provides the customer’s IP location.
18
+ # key - An MD5 hash used to confirm the validity of a sale.
19
+ # lang - Customer language
20
+ # merchant_order_id - The order ID you had assigned to the order.
21
+ # order_number - The 2Checkout order number associated with the order.
22
+ # invoice_id - The 2Checkout invoice number.
23
+ # pay_method - Provides seller with the customer’s payment method. CC for Credit Card, PPI for PayPal.
24
+ # phone - Provides the phone number the customer provided when placing the order.
25
+ # ship_name - Provides the ship to name for the order.
26
+ # ship_street_address - Provides ship to address.
27
+ # ship_street_address2 - Provides more detailed shipping address if this information was provided by the customer.
28
+ # ship_city - Provides ship to city.
29
+ # ship_state - Provides ship to state.
30
+ # ship_zip - Ship Zip
31
+
32
+ # Pass Through Products Only
33
+ # li_#_name - Name of the corresponding lineitem.
34
+ # li_#_quantity - Quantity of the corresponding lineitem.
35
+ # li_#_price - Price of the corresponding lineitem.
36
+ # li_#_tangible - Specifies if the corresponding li_#_type is a tangible or intangible. ‘Y’ OR ‘N’
37
+ # li_#_product_id - ID of the corresponding lineitem.
38
+ # li_#_product_description - Description of the corresponding lineitem.
39
+ # li_#_recurrence - # WEEK | MONTH | YEAR – always singular.
40
+ # li_#_duration - Forever or # WEEK | MONTH | YEAR – always singular, defaults to Forever.
41
+ # li_#_startup_fee - Amount in account pricing currency.
42
+ # li_#_option_#_name - Name of option. 64 characters max – cannot include '<' or '>'.
43
+ # li_#_option_#_value - Name of option. 64 characters max – cannot include '<' or '>'.
44
+ # li_#_option_#_surcharge - Amount in account pricing currency.
45
+
46
+ #Third Party Cart Only
47
+ # cart_order_id - The order ID you had assigned to the order.
48
+
49
+ # Allow seller to define default currency (should match 2Checkout account pricing currency)
36
50
  def currency
37
- 'USD'
51
+ 'USD'
38
52
  end
39
-
53
+
40
54
  def complete?
41
55
  status == 'Completed'
42
- end
56
+ end
43
57
 
58
+ # Third Party Cart parameters will return 'card_order_id'
59
+ # Pass Through Product parameters will only return 'merchant_order_id'
44
60
  def item_id
45
- params['cart_order_id']
61
+ if (params['cart_order_id'].nil?)
62
+ params['merchant_order_id']
63
+ else
64
+ params['cart_order_id']
65
+ end
46
66
  end
47
67
 
68
+ # 2Checkout Sale ID
48
69
  def transaction_id
49
70
  params['order_number']
50
71
  end
@@ -53,60 +74,64 @@ module ActiveMerchant #:nodoc:
53
74
  params['']
54
75
  end
55
76
 
77
+ #Customer Email
56
78
  def payer_email
57
79
  params['email']
58
80
  end
59
-
81
+
60
82
  def receiver_email
61
83
  params['']
62
- end
84
+ end
63
85
 
64
86
  # The MD5 Hash
65
87
  def security_key
66
88
  params['key']
67
89
  end
68
90
 
69
- # the money amount we received in X.2 decimal.
91
+ # The money amount we received in X.2 decimal.
70
92
  def gross
71
93
  params['total']
72
94
  end
73
95
 
74
96
  # Was this a test transaction? # Use the hash
97
+ # Please note 2Checkout forces the order number computed in the hash to '1' on demo sales.
75
98
  def test?
76
99
  params['demo'] == 'Y'
77
100
  end
78
101
 
102
+ # 2Checkout only returns 'Y' for this parameter. If the sale is not authorized, no passback occurs.
79
103
  def status
80
104
  case params['credit_card_processed']
81
- when 'Y'
82
- 'Completed'
83
- when 'K'
84
- 'Pending'
85
- else
86
- 'Failed'
105
+ when 'Y'
106
+ 'Completed'
107
+ else
108
+ 'Failed'
87
109
  end
88
110
  end
89
-
111
+
112
+ # Secret Word defined in 2Checkout account
90
113
  def secret
91
114
  @options[:credential2]
92
115
  end
93
-
116
+
117
+ # Checks against MD5 Hash
94
118
  def acknowledge
95
119
  return false if security_key.blank?
96
-
120
+
97
121
  Digest::MD5.hexdigest("#{secret}#{params['sid']}#{transaction_id}#{gross}").upcase == security_key.upcase
98
122
  end
99
-
123
+
100
124
  private
101
-
125
+
126
+ # Parses Header Redirect Query String
102
127
  def parse(post)
103
128
  @raw = post.to_s
104
- for line in @raw.split('&')
129
+ for line in @raw.split('&')
105
130
  key, value = *line.scan( %r{^(\w+)\=(.*)$} ).flatten
106
131
  params[key] = CGI.unescape(value || '')
107
132
  end
108
133
  end
109
-
134
+
110
135
  end
111
136
  end
112
137
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.22.0"
2
+ VERSION = "1.23.0"
3
3
  end
metadata CHANGED
@@ -1,188 +1,218 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
- version: !ruby/object:Gem::Version
4
- version: 1.22.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 75
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 23
9
+ - 0
10
+ version: 1.23.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Tobias Luetke
9
14
  autorequire:
10
15
  bindir: bin
11
- cert_chain:
12
- - ! '-----BEGIN CERTIFICATE-----
13
-
16
+ cert_chain:
17
+ - |
18
+ -----BEGIN CERTIFICATE-----
14
19
  MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBBMRMwEQYDVQQDDApjb2R5
15
-
16
20
  ZmF1c2VyMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNj
17
-
18
21
  b20wHhcNMDcwMjIyMTcyMTI3WhcNMDgwMjIyMTcyMTI3WjBBMRMwEQYDVQQDDApj
19
-
20
22
  b2R5ZmF1c2VyMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
21
-
22
23
  FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6T4Iqt5iWvAlU
23
-
24
24
  iXI6L8UO0URQhIC65X/gJ9hL/x4lwSl/ckVm/R/bPrJGmifT+YooFv824N3y/TIX
25
-
26
25
  25o/lZtRj1TUZJK4OCb0aVzosQVxBHSe6rLmxO8cItNTMOM9wn3thaITFrTa1DOQ
27
-
28
26
  O3wqEjvW2L6VMozVfK1MfjL9IGgy0rCnl+2g4Gh4jDDpkLfnMG5CWI6cTCf3C1ye
29
-
30
27
  ytOpWgi0XpOEy8nQWcFmt/KCQ/kFfzBo4QxqJi54b80842EyvzWT9OB7Oew/CXZG
31
-
32
28
  F2yIHtiYxonz6N09vvSzq4CvEuisoUFLKZnktndxMEBKwJU3XeSHAbuS7ix40OKO
33
-
34
29
  WKuI54fHAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
35
-
36
30
  BBR9QQpefI3oDCAxiqJW/3Gg6jI6qjANBgkqhkiG9w0BAQUFAAOCAQEAs0lX26O+
37
-
38
31
  HpyMp7WL+SgZuM8k76AjfOHuKajl2GEn3S8pWYGpsa0xu07HtehJhKLiavrfUYeE
39
-
40
32
  qlFtyYMUyOh6/1S2vfkH6VqjX7mWjoi7XKHW/99fkMS40B5SbN+ypAUst+6c5R84
41
-
42
33
  w390mjtLHpdDE6WQYhS6bFvBN53vK6jG3DLyCJc0K9uMQ7gdHWoxq7RnG92ncQpT
43
-
44
34
  ThpRA+fky5Xt2Q63YJDnJpkYAz79QIama1enSnd4jslKzSl89JS2luq/zioPe/Us
45
-
46
35
  hbyalWR1+HrhgPoSPq7nk+s2FQUBJ9UZFK1lgMzho/4fZgzJwbu+cO8SNuaLS/bj
47
-
48
36
  hPaSTyVU0yCSnw==
49
-
50
37
  -----END CERTIFICATE-----
51
38
 
52
- '
53
- date: 2012-05-17 00:00:00.000000000 Z
54
- dependencies:
55
- - !ruby/object:Gem::Dependency
39
+ date: 2012-05-23 00:00:00 Z
40
+ dependencies:
41
+ - !ruby/object:Gem::Dependency
56
42
  name: activesupport
57
- requirement: &2153311280 !ruby/object:Gem::Requirement
43
+ prerelease: false
44
+ requirement: &id001 !ruby/object:Gem::Requirement
58
45
  none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ hash: 21
50
+ segments:
51
+ - 2
52
+ - 3
53
+ - 11
62
54
  version: 2.3.11
63
55
  type: :runtime
64
- prerelease: false
65
- version_requirements: *2153311280
66
- - !ruby/object:Gem::Dependency
56
+ version_requirements: *id001
57
+ - !ruby/object:Gem::Dependency
67
58
  name: i18n
68
- requirement: &2153310640 !ruby/object:Gem::Requirement
59
+ prerelease: false
60
+ requirement: &id002 !ruby/object:Gem::Requirement
69
61
  none: false
70
- requirements:
71
- - - ! '>='
72
- - !ruby/object:Gem::Version
73
- version: '0'
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
68
+ version: "0"
74
69
  type: :runtime
75
- prerelease: false
76
- version_requirements: *2153310640
77
- - !ruby/object:Gem::Dependency
70
+ version_requirements: *id002
71
+ - !ruby/object:Gem::Dependency
78
72
  name: money
79
- requirement: &2153310060 !ruby/object:Gem::Requirement
73
+ prerelease: false
74
+ requirement: &id003 !ruby/object:Gem::Requirement
80
75
  none: false
81
- requirements:
82
- - - ! '>='
83
- - !ruby/object:Gem::Version
84
- version: '0'
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ hash: 3
80
+ segments:
81
+ - 0
82
+ version: "0"
85
83
  type: :runtime
86
- prerelease: false
87
- version_requirements: *2153310060
88
- - !ruby/object:Gem::Dependency
84
+ version_requirements: *id003
85
+ - !ruby/object:Gem::Dependency
89
86
  name: builder
90
- requirement: &2153309500 !ruby/object:Gem::Requirement
87
+ prerelease: false
88
+ requirement: &id004 !ruby/object:Gem::Requirement
91
89
  none: false
92
- requirements:
93
- - - ! '>='
94
- - !ruby/object:Gem::Version
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ hash: 15
94
+ segments:
95
+ - 2
96
+ - 0
97
+ - 0
95
98
  version: 2.0.0
96
99
  type: :runtime
97
- prerelease: false
98
- version_requirements: *2153309500
99
- - !ruby/object:Gem::Dependency
100
+ version_requirements: *id004
101
+ - !ruby/object:Gem::Dependency
100
102
  name: json
101
- requirement: &2153309000 !ruby/object:Gem::Requirement
103
+ prerelease: false
104
+ requirement: &id005 !ruby/object:Gem::Requirement
102
105
  none: false
103
- requirements:
104
- - - ! '>='
105
- - !ruby/object:Gem::Version
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ hash: 1
110
+ segments:
111
+ - 1
112
+ - 5
113
+ - 1
106
114
  version: 1.5.1
107
115
  type: :runtime
108
- prerelease: false
109
- version_requirements: *2153309000
110
- - !ruby/object:Gem::Dependency
116
+ version_requirements: *id005
117
+ - !ruby/object:Gem::Dependency
111
118
  name: active_utils
112
- requirement: &2153324800 !ruby/object:Gem::Requirement
119
+ prerelease: false
120
+ requirement: &id006 !ruby/object:Gem::Requirement
113
121
  none: false
114
- requirements:
115
- - - ! '>='
116
- - !ruby/object:Gem::Version
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ hash: 19
126
+ segments:
127
+ - 1
128
+ - 0
129
+ - 2
117
130
  version: 1.0.2
118
131
  type: :runtime
119
- prerelease: false
120
- version_requirements: *2153324800
121
- - !ruby/object:Gem::Dependency
132
+ version_requirements: *id006
133
+ - !ruby/object:Gem::Dependency
122
134
  name: nokogiri
123
- requirement: &2153324160 !ruby/object:Gem::Requirement
135
+ prerelease: false
136
+ requirement: &id007 !ruby/object:Gem::Requirement
124
137
  none: false
125
- requirements:
126
- - - ! '>='
127
- - !ruby/object:Gem::Version
128
- version: '0'
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
144
+ version: "0"
129
145
  type: :runtime
130
- prerelease: false
131
- version_requirements: *2153324160
132
- - !ruby/object:Gem::Dependency
146
+ version_requirements: *id007
147
+ - !ruby/object:Gem::Dependency
133
148
  name: rake
134
- requirement: &2153323500 !ruby/object:Gem::Requirement
149
+ prerelease: false
150
+ requirement: &id008 !ruby/object:Gem::Requirement
135
151
  none: false
136
- requirements:
137
- - - ! '>='
138
- - !ruby/object:Gem::Version
139
- version: '0'
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ hash: 3
156
+ segments:
157
+ - 0
158
+ version: "0"
140
159
  type: :development
141
- prerelease: false
142
- version_requirements: *2153323500
143
- - !ruby/object:Gem::Dependency
160
+ version_requirements: *id008
161
+ - !ruby/object:Gem::Dependency
144
162
  name: mocha
145
- requirement: &2153322880 !ruby/object:Gem::Requirement
163
+ prerelease: false
164
+ requirement: &id009 !ruby/object:Gem::Requirement
146
165
  none: false
147
- requirements:
166
+ requirements:
148
167
  - - ~>
149
- - !ruby/object:Gem::Version
168
+ - !ruby/object:Gem::Version
169
+ hash: 53
170
+ segments:
171
+ - 0
172
+ - 11
173
+ - 3
150
174
  version: 0.11.3
151
175
  type: :development
152
- prerelease: false
153
- version_requirements: *2153322880
154
- - !ruby/object:Gem::Dependency
176
+ version_requirements: *id009
177
+ - !ruby/object:Gem::Dependency
155
178
  name: rails
156
- requirement: &2153322200 !ruby/object:Gem::Requirement
179
+ prerelease: false
180
+ requirement: &id010 !ruby/object:Gem::Requirement
157
181
  none: false
158
- requirements:
159
- - - ! '>='
160
- - !ruby/object:Gem::Version
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ hash: 21
186
+ segments:
187
+ - 2
188
+ - 3
189
+ - 11
161
190
  version: 2.3.11
162
191
  type: :development
163
- prerelease: false
164
- version_requirements: *2153322200
165
- - !ruby/object:Gem::Dependency
192
+ version_requirements: *id010
193
+ - !ruby/object:Gem::Dependency
166
194
  name: rubigen
167
- requirement: &2153321560 !ruby/object:Gem::Requirement
195
+ prerelease: false
196
+ requirement: &id011 !ruby/object:Gem::Requirement
168
197
  none: false
169
- requirements:
170
- - - ! '>='
171
- - !ruby/object:Gem::Version
172
- version: '0'
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ hash: 3
202
+ segments:
203
+ - 0
204
+ version: "0"
173
205
  type: :development
174
- prerelease: false
175
- version_requirements: *2153321560
176
- description: Active Merchant is a simple payment abstraction library used in and sponsored
177
- by Shopify. It is written by Tobias Luetke, Cody Fauser, and contributors. The aim
178
- of the project is to feel natural to Ruby users and to abstract as many parts as
179
- possible away from the user to offer a consistent interface across all supported
180
- gateways.
206
+ version_requirements: *id011
207
+ description: Active Merchant is a simple payment abstraction library used in and sponsored by Shopify. It is written by Tobias Luetke, Cody Fauser, and contributors. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.
181
208
  email: tobi@leetsoft.com
182
209
  executables: []
210
+
183
211
  extensions: []
212
+
184
213
  extra_rdoc_files: []
185
- files:
214
+
215
+ files:
186
216
  - CHANGELOG
187
217
  - README.md
188
218
  - MIT-LICENSE
@@ -233,6 +263,7 @@ files:
233
263
  - lib/active_merchant/billing/gateways/itransact.rb
234
264
  - lib/active_merchant/billing/gateways/jetpay.rb
235
265
  - lib/active_merchant/billing/gateways/linkpoint.rb
266
+ - lib/active_merchant/billing/gateways/litle.rb
236
267
  - lib/active_merchant/billing/gateways/merchant_e_solutions.rb
237
268
  - lib/active_merchant/billing/gateways/merchant_ware.rb
238
269
  - lib/active_merchant/billing/gateways/migs/migs_codes.rb
@@ -402,26 +433,36 @@ files:
402
433
  - lib/support/outbound_hosts.rb
403
434
  homepage: http://activemerchant.org/
404
435
  licenses: []
436
+
405
437
  post_install_message:
406
438
  rdoc_options: []
407
- require_paths:
439
+
440
+ require_paths:
408
441
  - lib
409
- required_ruby_version: !ruby/object:Gem::Requirement
442
+ required_ruby_version: !ruby/object:Gem::Requirement
410
443
  none: false
411
- requirements:
412
- - - ! '>='
413
- - !ruby/object:Gem::Version
414
- version: '0'
415
- required_rubygems_version: !ruby/object:Gem::Requirement
444
+ requirements:
445
+ - - ">="
446
+ - !ruby/object:Gem::Version
447
+ hash: 3
448
+ segments:
449
+ - 0
450
+ version: "0"
451
+ required_rubygems_version: !ruby/object:Gem::Requirement
416
452
  none: false
417
- requirements:
418
- - - ! '>='
419
- - !ruby/object:Gem::Version
420
- version: '0'
453
+ requirements:
454
+ - - ">="
455
+ - !ruby/object:Gem::Version
456
+ hash: 3
457
+ segments:
458
+ - 0
459
+ version: "0"
421
460
  requirements: []
461
+
422
462
  rubyforge_project: activemerchant
423
- rubygems_version: 1.8.16
463
+ rubygems_version: 1.8.15
424
464
  signing_key:
425
465
  specification_version: 3
426
466
  summary: Framework and tools for dealing with credit card transactions.
427
467
  test_files: []
468
+