tlconnor-activemerchant 1.20.4 → 1.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/CHANGELOG +86 -6
  2. data/CONTRIBUTORS +33 -0
  3. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -0
  4. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +4 -4
  5. data/lib/active_merchant/billing/gateways/blue_pay.rb +492 -11
  6. data/lib/active_merchant/billing/gateways/braintree_blue.rb +46 -19
  7. data/lib/active_merchant/billing/gateways/certo_direct.rb +1 -1
  8. data/lib/active_merchant/billing/gateways/elavon.rb +2 -0
  9. data/lib/active_merchant/billing/gateways/epay.rb +3 -1
  10. data/lib/active_merchant/billing/gateways/itransact.rb +450 -0
  11. data/lib/active_merchant/billing/gateways/litle.rb +275 -0
  12. data/lib/active_merchant/billing/gateways/migs.rb +259 -0
  13. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +100 -0
  14. data/lib/active_merchant/billing/gateways/moneris.rb +4 -30
  15. data/lib/active_merchant/billing/gateways/moneris_us.rb +211 -0
  16. data/lib/active_merchant/billing/gateways/nab_transact.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/ogone.rb +104 -12
  18. data/lib/active_merchant/billing/gateways/orbital.rb +15 -6
  19. data/lib/active_merchant/billing/gateways/paybox_direct.rb +1 -4
  20. data/lib/active_merchant/billing/gateways/payflow.rb +8 -3
  21. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +4 -1
  22. data/lib/active_merchant/billing/gateways/payflow_express.rb +4 -2
  23. data/lib/active_merchant/billing/gateways/payment_express.rb +60 -13
  24. data/lib/active_merchant/billing/gateways/paypal.rb +3 -18
  25. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +333 -3
  26. data/lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb +245 -0
  27. data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +43 -0
  28. data/lib/active_merchant/billing/gateways/paypal_express.rb +14 -65
  29. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +8 -3
  30. data/lib/active_merchant/billing/gateways/realex.rb +5 -7
  31. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +3 -2
  32. data/lib/active_merchant/billing/gateways/stripe.rb +1 -9
  33. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +2 -2
  34. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -5
  35. data/lib/active_merchant/billing/gateways/viaklix.rb +7 -2
  36. data/lib/active_merchant/billing/gateways/vindicia.rb +359 -0
  37. data/lib/active_merchant/billing/integrations/dotpay.rb +22 -0
  38. data/lib/active_merchant/billing/integrations/dotpay/helper.rb +77 -0
  39. data/lib/active_merchant/billing/integrations/dotpay/notification.rb +86 -0
  40. data/lib/active_merchant/billing/integrations/dotpay/return.rb +11 -0
  41. data/lib/active_merchant/billing/integrations/epay.rb +21 -0
  42. data/lib/active_merchant/billing/integrations/epay/helper.rb +55 -0
  43. data/lib/active_merchant/billing/integrations/epay/notification.rb +110 -0
  44. data/lib/active_merchant/billing/integrations/paypal/notification.rb +2 -1
  45. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +2 -3
  46. data/lib/active_merchant/billing/integrations/robokassa.rb +49 -0
  47. data/lib/active_merchant/billing/integrations/robokassa/common.rb +19 -0
  48. data/lib/active_merchant/billing/integrations/robokassa/helper.rb +50 -0
  49. data/lib/active_merchant/billing/integrations/robokassa/notification.rb +55 -0
  50. data/lib/active_merchant/billing/integrations/robokassa/return.rb +17 -0
  51. data/lib/active_merchant/billing/integrations/two_checkout.rb +25 -3
  52. data/lib/active_merchant/billing/integrations/two_checkout/helper.rb +58 -26
  53. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +71 -46
  54. data/lib/active_merchant/billing/integrations/verkkomaksut.rb +20 -0
  55. data/lib/active_merchant/billing/integrations/verkkomaksut/helper.rb +87 -0
  56. data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +59 -0
  57. data/lib/active_merchant/version.rb +1 -1
  58. metadata +28 -5
@@ -0,0 +1,20 @@
1
+ require File.dirname(__FILE__) + '/verkkomaksut/helper.rb'
2
+ require File.dirname(__FILE__) + '/verkkomaksut/notification.rb'
3
+
4
+ module ActiveMerchant #:nodoc:
5
+ module Billing #:nodoc:
6
+ module Integrations #:nodoc:
7
+
8
+ # Usage, see the blog post here: http://blog.kiskolabs.com/post/22374612968/understanding-active-merchant-integrations and E1 API documentation here: http://docs.verkkomaksut.fi/
9
+ module Verkkomaksut
10
+
11
+ mattr_accessor :service_url
12
+ self.service_url = 'https://payment.verkkomaksut.fi/'
13
+
14
+ def self.notification(post)
15
+ Notification.new(post)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,87 @@
1
+ module ActiveMerchant #:nodoc:
2
+ module Billing #:nodoc:
3
+ module Integrations #:nodoc:
4
+ module Verkkomaksut
5
+ class Helper < ActiveMerchant::Billing::Integrations::Helper
6
+
7
+ # Fetches the md5secret and adds MERCHANT_ID and API TYPE to the form
8
+ def initialize(order, account, options = {})
9
+ md5secret options.delete(:credential2)
10
+ super
11
+ add_field("MERCHANT_ID", account)
12
+ add_field("TYPE", "E1")
13
+ end
14
+
15
+ def md5secret(value)
16
+ @md5secret = value
17
+ end
18
+
19
+ # Adds the AUTHCODE to the form
20
+ def form_fields
21
+ @fields.merge("AUTHCODE" => generate_md5string)
22
+ end
23
+
24
+ # Calculates the AUTHCODE
25
+ def generate_md5string
26
+ fields = [@md5secret, @fields["MERCHANT_ID"], @fields["ORDER_NUMBER"], @fields["REFERENCE_NUMBER"], @fields["ORDER_DESCRIPTION"], @fields["CURRENCY"], @fields["RETURN_ADDRESS"], @fields["CANCEL_ADDRESS"], @fields["PENDING_ADDRESS"],
27
+ @fields["NOTIFY_ADDRESS"], @fields["TYPE"], @fields["CULTURE"], @fields["PRESELECTED_METHOD"], @fields["MODE"], @fields["VISIBLE_METHODS"], @fields["GROUP"], @fields["CONTACT_TELNO"], @fields["CONTACT_CELLNO"],
28
+ @fields["CONTACT_EMAIL"], @fields["CONTACT_FIRSTNAME"], @fields["CONTACT_LASTNAME"], @fields["CONTACT_COMPANY"], @fields["CONTACT_ADDR_STREET"], @fields["CONTACT_ADDR_ZIP"], @fields["CONTACT_ADDR_CITY"], @fields["CONTACT_ADDR_COUNTRY"], @fields["INCLUDE_VAT"],
29
+ @fields["ITEMS"]]
30
+
31
+ (0..@fields["ITEMS"].to_i-1).each do |i|
32
+ fields += [@fields["ITEM_TITLE[#{i}]"], @fields["ITEM_NO[#{i}]"], @fields["ITEM_AMOUNT[#{i}]"], @fields["ITEM_PRICE[#{i}]"], @fields["ITEM_TAX[#{i}]"], @fields["ITEM_DISCOUNT[#{i}]"], @fields["ITEM_TYPE[#{i}]"]]
33
+ end
34
+
35
+ fields = fields.join("|")
36
+
37
+ return Digest::MD5.hexdigest(fields).upcase
38
+ end
39
+
40
+ # Mappings
41
+ mapping :merchant_id, "MERCHANT_ID"
42
+ mapping :order, "ORDER_NUMBER"
43
+ mapping :reference_number, "REFERENCE_NUMBER"
44
+ mapping :customer, :first_name => "CONTACT_FIRSTNAME",
45
+ :last_name => "CONTACT_LASTNAME",
46
+ :email => "CONTACT_EMAIL",
47
+ :phone => "CONTACT_CELLNO",
48
+ :tellno => "CONTACT_TELLNO",
49
+ :company => "CONTACT_COMPANY"
50
+
51
+
52
+ mapping :billing_address, :city => "CONTACT_ADDR_CITY",
53
+ :address1 => "CONTACT_ADDR_STREET",
54
+ :address2 => "",
55
+ :state => "",
56
+ :zip => "CONTACT_ADDR_ZIP",
57
+ :country => "CONTACT_ADDR_COUNTRY"
58
+
59
+ mapping :notify_url, "NOTIFY_ADDRESS"
60
+ mapping :currency, "CURRENCY"
61
+ mapping :return_url, "RETURN_ADDRESS"
62
+ mapping :cancel_return_url, "CANCEL_ADDRESS"
63
+ mapping :description, "ORDER_DESCRIPTION"
64
+ mapping :tax, ""
65
+ mapping :shipping, ""
66
+ mapping :include_vat, "INCLUDE_VAT"
67
+ mapping :pending_address, "PENDING_ADDRESS"
68
+ mapping :culture, "CULTURE"
69
+ mapping :items, "ITEMS"
70
+ mapping :preselected_method, "PRESELECTED_METHOD"
71
+ mapping :mode, "MODE"
72
+ mapping :visible_methods, "VISIBLE_METHODS"
73
+ mapping :group, "GROUP"
74
+
75
+ (0..499.to_i).each do |i|
76
+ mapping "item_no_#{i}".to_sym, "ITEM_NO[#{i}]"
77
+ mapping "item_amount_#{i}".to_sym, "ITEM_AMOUNT[#{i}]"
78
+ mapping "item_price_#{i}".to_sym, "ITEM_PRICE[#{i}]"
79
+ mapping "item_tax_#{i}".to_sym, "ITEM_TAX[#{i}]"
80
+ mapping "item_discount_#{i}".to_sym, "ITEM_DISCOUNT[#{i}]"
81
+ mapping "item_type_#{i}".to_sym, "ITEM_TYPE[#{i}]"
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,59 @@
1
+ require 'net/http'
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ module Integrations #:nodoc:
6
+ module Verkkomaksut
7
+ class Notification < ActiveMerchant::Billing::Integrations::Notification
8
+
9
+ # Is the payment complete or not. Verkkomaksut only has two statuses: random string or 0000000000 which means pending
10
+ def complete?
11
+ params['PAID'] != "0000000000"
12
+ end
13
+
14
+ # Order id
15
+ def order_id
16
+ params['ORDER_NUMBER']
17
+ end
18
+
19
+ # Payment method used
20
+ def method
21
+ params['METHOD']
22
+ end
23
+
24
+ # When was this payment received by the client.
25
+ def received_at
26
+ params['TIMESTAMP']
27
+ end
28
+
29
+ # Security key got from Verkkomaksut
30
+ def security_key
31
+ params['RETURN_AUTHCODE']
32
+ end
33
+
34
+ # Another way of asking the payment status
35
+ def status
36
+ if complete?
37
+ "PAID"
38
+ else
39
+ "PENDING"
40
+ end
41
+ end
42
+
43
+ # Acknowldges the payment. If the authcodes match, returns true.
44
+ def acknowledge(authcode)
45
+ return_authcode = [params["ORDER_NUMBER"], params["TIMESTAMP"], params["PAID"], params["METHOD"], authcode].join("|")
46
+ Digest::MD5.hexdigest(return_authcode).upcase == params["RETURN_AUTHCODE"]
47
+ end
48
+ private
49
+
50
+ def parse(post)
51
+ post.each do |key, value|
52
+ params[key] = value
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.20.4"
2
+ VERSION = "1.23.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tlconnor-activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 79
4
+ hash: 75
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 20
9
- - 4
10
- version: 1.20.4
8
+ - 23
9
+ - 0
10
+ version: 1.23.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Luetke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain:
17
17
  - gem-public_cert.pem
18
- date: 2012-03-07 00:00:00 +13:00
18
+ date: 2012-06-04 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -225,13 +225,18 @@ files:
225
225
  - lib/active_merchant/billing/gateways/inspire.rb
226
226
  - lib/active_merchant/billing/gateways/instapay.rb
227
227
  - lib/active_merchant/billing/gateways/iridium.rb
228
+ - lib/active_merchant/billing/gateways/itransact.rb
228
229
  - lib/active_merchant/billing/gateways/jetpay.rb
229
230
  - lib/active_merchant/billing/gateways/linkpoint.rb
231
+ - lib/active_merchant/billing/gateways/litle.rb
230
232
  - lib/active_merchant/billing/gateways/merchant_e_solutions.rb
231
233
  - lib/active_merchant/billing/gateways/merchant_ware.rb
234
+ - lib/active_merchant/billing/gateways/migs/migs_codes.rb
235
+ - lib/active_merchant/billing/gateways/migs.rb
232
236
  - lib/active_merchant/billing/gateways/modern_payments.rb
233
237
  - lib/active_merchant/billing/gateways/modern_payments_cim.rb
234
238
  - lib/active_merchant/billing/gateways/moneris.rb
239
+ - lib/active_merchant/billing/gateways/moneris_us.rb
235
240
  - lib/active_merchant/billing/gateways/nab_transact.rb
236
241
  - lib/active_merchant/billing/gateways/net_registry.rb
237
242
  - lib/active_merchant/billing/gateways/netaxept.rb
@@ -254,8 +259,10 @@ files:
254
259
  - lib/active_merchant/billing/gateways/payment_express.rb
255
260
  - lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb
256
261
  - lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb
262
+ - lib/active_merchant/billing/gateways/paypal/paypal_recurring_api.rb
257
263
  - lib/active_merchant/billing/gateways/paypal.rb
258
264
  - lib/active_merchant/billing/gateways/paypal_ca.rb
265
+ - lib/active_merchant/billing/gateways/paypal_digital_goods.rb
259
266
  - lib/active_merchant/billing/gateways/paypal_express.rb
260
267
  - lib/active_merchant/billing/gateways/paypal_express_common.rb
261
268
  - lib/active_merchant/billing/gateways/paystation.rb
@@ -288,6 +295,7 @@ files:
288
295
  - lib/active_merchant/billing/gateways/usa_epay_transaction.rb
289
296
  - lib/active_merchant/billing/gateways/verifi.rb
290
297
  - lib/active_merchant/billing/gateways/viaklix.rb
298
+ - lib/active_merchant/billing/gateways/vindicia.rb
291
299
  - lib/active_merchant/billing/gateways/wirecard.rb
292
300
  - lib/active_merchant/billing/gateways/worldpay.rb
293
301
  - lib/active_merchant/billing/gateways.rb
@@ -312,6 +320,10 @@ files:
312
320
  - lib/active_merchant/billing/integrations/directebanking/notification.rb
313
321
  - lib/active_merchant/billing/integrations/directebanking/return.rb
314
322
  - lib/active_merchant/billing/integrations/directebanking.rb
323
+ - lib/active_merchant/billing/integrations/dotpay/helper.rb
324
+ - lib/active_merchant/billing/integrations/dotpay/notification.rb
325
+ - lib/active_merchant/billing/integrations/dotpay/return.rb
326
+ - lib/active_merchant/billing/integrations/dotpay.rb
315
327
  - lib/active_merchant/billing/integrations/dwolla/helper.rb
316
328
  - lib/active_merchant/billing/integrations/dwolla/notification.rb
317
329
  - lib/active_merchant/billing/integrations/dwolla/return.rb
@@ -319,6 +331,9 @@ files:
319
331
  - lib/active_merchant/billing/integrations/e_payment_plans/helper.rb
320
332
  - lib/active_merchant/billing/integrations/e_payment_plans/notification.rb
321
333
  - lib/active_merchant/billing/integrations/e_payment_plans.rb
334
+ - lib/active_merchant/billing/integrations/epay/helper.rb
335
+ - lib/active_merchant/billing/integrations/epay/notification.rb
336
+ - lib/active_merchant/billing/integrations/epay.rb
322
337
  - lib/active_merchant/billing/integrations/gestpay/common.rb
323
338
  - lib/active_merchant/billing/integrations/gestpay/helper.rb
324
339
  - lib/active_merchant/billing/integrations/gestpay/notification.rb
@@ -348,6 +363,11 @@ files:
348
363
  - lib/active_merchant/billing/integrations/quickpay/notification.rb
349
364
  - lib/active_merchant/billing/integrations/quickpay.rb
350
365
  - lib/active_merchant/billing/integrations/return.rb
366
+ - lib/active_merchant/billing/integrations/robokassa/common.rb
367
+ - lib/active_merchant/billing/integrations/robokassa/helper.rb
368
+ - lib/active_merchant/billing/integrations/robokassa/notification.rb
369
+ - lib/active_merchant/billing/integrations/robokassa/return.rb
370
+ - lib/active_merchant/billing/integrations/robokassa.rb
351
371
  - lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb
352
372
  - lib/active_merchant/billing/integrations/sage_pay_form/helper.rb
353
373
  - lib/active_merchant/billing/integrations/sage_pay_form/notification.rb
@@ -362,6 +382,9 @@ files:
362
382
  - lib/active_merchant/billing/integrations/valitor/response_fields.rb
363
383
  - lib/active_merchant/billing/integrations/valitor/return.rb
364
384
  - lib/active_merchant/billing/integrations/valitor.rb
385
+ - lib/active_merchant/billing/integrations/verkkomaksut/helper.rb
386
+ - lib/active_merchant/billing/integrations/verkkomaksut/notification.rb
387
+ - lib/active_merchant/billing/integrations/verkkomaksut.rb
365
388
  - lib/active_merchant/billing/integrations/world_pay/helper.rb
366
389
  - lib/active_merchant/billing/integrations/world_pay/notification.rb
367
390
  - lib/active_merchant/billing/integrations/world_pay.rb