activemerchant 1.32.0 → 1.33.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 (52) hide show
  1. data/CHANGELOG +50 -0
  2. data/CONTRIBUTORS +8 -0
  3. data/README.md +6 -4
  4. data/lib/active_merchant/billing/check.rb +4 -3
  5. data/lib/active_merchant/billing/credit_card.rb +7 -3
  6. data/lib/active_merchant/billing/gateways/authorize_net.rb +27 -7
  7. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +8 -1
  8. data/lib/active_merchant/billing/gateways/blue_pay.rb +201 -185
  9. data/lib/active_merchant/billing/gateways/bogus.rb +1 -1
  10. data/lib/active_merchant/billing/gateways/card_stream_modern.rb +155 -0
  11. data/lib/active_merchant/billing/gateways/cc5.rb +0 -4
  12. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +94 -12
  13. data/lib/active_merchant/billing/gateways/garanti.rb +0 -4
  14. data/lib/active_merchant/billing/gateways/litle.rb +41 -11
  15. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +27 -6
  16. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
  17. data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
  18. data/lib/active_merchant/billing/gateways/netaxept.rb +65 -117
  19. data/lib/active_merchant/billing/gateways/orbital.rb +181 -48
  20. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -10
  21. data/lib/active_merchant/billing/gateways/paymill.rb +27 -13
  22. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +11 -6
  23. data/lib/active_merchant/billing/gateways/paypal_express.rb +25 -7
  24. data/lib/active_merchant/billing/gateways/pin.rb +5 -5
  25. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +16 -11
  26. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +21 -16
  28. data/lib/active_merchant/billing/gateways/sage.rb +10 -5
  29. data/lib/active_merchant/billing/gateways/sage_pay.rb +1 -0
  30. data/lib/active_merchant/billing/gateways/transnational.rb +239 -0
  31. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +9 -4
  32. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +1 -1
  33. data/lib/active_merchant/billing/integrations/direc_pay.rb +1 -1
  34. data/lib/active_merchant/billing/integrations/dwolla/common.rb +21 -0
  35. data/lib/active_merchant/billing/integrations/dwolla/helper.rb +15 -6
  36. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +11 -6
  37. data/lib/active_merchant/billing/integrations/dwolla/return.rb +12 -4
  38. data/lib/active_merchant/billing/integrations/dwolla.rb +5 -12
  39. data/lib/active_merchant/billing/integrations/notification.rb +13 -8
  40. data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +13 -1
  41. data/lib/active_merchant/billing/integrations/payu_in/helper.rb +74 -0
  42. data/lib/active_merchant/billing/integrations/payu_in/notification.rb +167 -0
  43. data/lib/active_merchant/billing/integrations/payu_in/return.rb +53 -0
  44. data/lib/active_merchant/billing/integrations/payu_in.rb +43 -0
  45. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +68 -5
  46. data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +23 -0
  47. data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +91 -0
  48. data/lib/active_merchant/billing/integrations/rbkmoney.rb +17 -0
  49. data/lib/active_merchant/version.rb +1 -1
  50. data.tar.gz.sig +0 -0
  51. metadata +72 -62
  52. metadata.gz.sig +0 -0
data/CHANGELOG CHANGED
@@ -1,5 +1,53 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.33.0 (May 30, 2013)
4
+
5
+ * Netaxept: Completely revamped to use the "M" service type [rbjordan3, ntalbott]
6
+ * Litle: Void authorizations via an auth reversal [jrust]
7
+ * Add RBK Money integration [england]
8
+ * Direcpay: Update test url [ashish-d]
9
+ * PayPal Express gateway: Add support for creating billing agreements [fabiokr]
10
+ * PayPal Express gateway: Add reference authorizations [fabiokr]
11
+ * Add Cardstream Modern gateway [ExxKA]
12
+ * Pin: Fix special headers [duff]
13
+ * PayPal Express gateway: Remember the billing agreement id as Response#authorization [duff]
14
+ * PayPal Express gateway: Allow an amount of 0 [duff]
15
+ * PayPal Express gateway: Reduce parameter requirements [duff]
16
+ * Quickpay integration: Update notification parser to handle API v6 [larspind]
17
+ * Sage gateway: Deprecate #credit call [duff]
18
+ * Update notification generator to better match current notification class [lulalala]
19
+ * Paymill gateway: Change .com -> .de [louiskearns]
20
+ * Quickpay integration: Fix v6 response parsing [larspind]
21
+ * First Data e4: Add TransArmor store/tokenization support [gabetax]
22
+ * MerchantWarrior: Format expiration month/year correctly [klebervirgilio]
23
+ * Add iconv for ActiveSupport 2.3 under Ruby 2.0 [sanemat]
24
+ * Add Transnational gateway [bvandenbos]
25
+ * Authorize.Net: Add Check as payment method [andrunix]
26
+ * Merchant e-Solutions: Add ref number and recurring support [carlaares]
27
+ * Bogus gateway: Add authorization to purchase response [hron]
28
+ * Bluepay gateway: Fix Check support; general cleanup [ntalbott]
29
+ * Dwolla: Fix security issues and enable guest checkout [capablemonkey, schonfeld]
30
+ * SagePay gateway: Per-transaction 3D-secure selection [ExxKA]
31
+ * Barclays ePDQ: Handle incorrectly encoded response [jordanwheeler, aprofeit]
32
+ * Orbital: Bug fixes; add CustomerEmail, Retry Logic, Managed Billing, and Destination Address [juicedM3
33
+ * Distinguish invalid vs empty issue_numbers on CreditCards [drasch]
34
+ * Float Gemfiles to latest Rails [sanemat]
35
+ * USA ePay Advanced: Fix Check support [RyanScottLewis]
36
+ * Authorize.Net: Match up Check fields better with eCheck.Net requirements [ntalbott]
37
+ * Bluepay: Updated to bp20post api [cagerton, melari]
38
+ * Net Registry: Deprecate credit method [jduff]
39
+ * Sage: Don't include T_customer_number unless it is numeric [melari]
40
+ * Auth.net: Don't include cust_id unless it is numeric [melari]
41
+ * Epay: Deprecate credit method [melari]
42
+ * New PayU.in Integration [PayU, melari]
43
+
44
+ == Version 1.32.1 (April 4, 2013)
45
+
46
+ * CC5 and Garanti: Remove $KCODE modifications [melari]
47
+ * Paymill: Add support for store [ntalbott]
48
+ * USA ePay: Fix misspelling of "Aduth" [joelvh, ntalbott]
49
+ * Orbital: Fix nil address values throwing exceptions during truncation [melari]
50
+
3
51
  == Version 1.32.0 (April 1, 2013)
4
52
 
5
53
  * Optimal: Submit shipping address with requests [jduff]
@@ -24,6 +72,8 @@
24
72
  * Paymill: Handle error storing card [duff]
25
73
  * SagePay integration: Add referrer field [melari]
26
74
  * Pin: Add extra headers [duff]
75
+ * Paymill: Add support for store [ntalbott]
76
+ * USA ePay Advanced: Fix typo in message credit card data options [joelvh]
27
77
 
28
78
  == Version 1.31.1 (February 25, 2013)
29
79
 
data/CONTRIBUTORS CHANGED
@@ -392,3 +392,11 @@ EVO Canada (February 2013)
392
392
  Finansbank WebPOS (March 2013)
393
393
 
394
394
  * scamurcuoglu
395
+
396
+ Cardstream Modern (March 2013)
397
+
398
+ * Vincens (ExxKA)
399
+
400
+ Transnational (May 2013)
401
+
402
+ * Ben VandenBos (bvandenbos)
data/README.md CHANGED
@@ -12,7 +12,7 @@ Ruby applications which deal with financial transactions. It is maintained by th
12
12
  [Shopify](http://www.shopify.com) and [Spreedly](https://spreedly.com) teams, with much help
13
13
  from an ever-growing set of contributors.
14
14
 
15
- See {file:GettingStarted.md} if you want to learn more about using Active Merchant in your
15
+ See [GettingStarted.md](GettingStarted.md) if you want to learn more about using Active Merchant in your
16
16
  applications.
17
17
 
18
18
  ## Installation
@@ -72,7 +72,7 @@ credit card details.
72
72
  end
73
73
  end
74
74
 
75
- For more in-depth documentation and tutorials, see {file:GettingStarted.md} and the
75
+ For more in-depth documentation and tutorials, see [GettingStarted.md](GettingStarted.md) and the
76
76
  [API documentation](http://rubydoc.info/github/Shopify/active_merchant/master/file/README.md).
77
77
 
78
78
  ## Supported Direct Payment Gateways
@@ -135,7 +135,7 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
135
135
  * [PayGate PayXML](http://paygate.co.za/) - US, ZA
136
136
  * [PayJunction](http://www.payjunction.com/) - US
137
137
  * [PaymentExpress](http://www.paymentexpress.com/) - AU, MY, NZ, SG, ZA, UK, US
138
- * [Paymill](https://www.paymill.com) - AT, BE, CH, CZ, DE, DK, EE, ES, FI, FR, GB, HU, IE, IS, IT, LI, LU, LV, NL, NO, PL, PT, SE, SI, TR
138
+ * [PAYMILL](https://www.paymill.com) - AD, AT, BE, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GR, HU, IE, IL, IS, IT, LI, LT, LU, LV, MT, NL, NO, PL, PT, SE, SI, SK, TR, VA
139
139
  * [PayPal Express Checkout](https://www.paypal.com/cgi-bin/webscr?cmd=xpt/merchant/ExpressCheckoutIntro-outside) - US, CA, SG, AU
140
140
  * [PayPal Payflow Pro](https://www.paypal.com/cgi-bin/webscr?cmd=_payflow-pro-overview-outside) - US, CA, SG, AU
141
141
  * [PayPal Website Payments Pro (UK)](https://www.paypal.com/uk/cgi-bin/webscr?cmd=_wp-pro-overview-outside) - UK
@@ -165,6 +165,7 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
165
165
  * [Spreedly Core](https://spreedlycore.com/) - AD, AE, AT, AU, BD, BE, BG, BN, CA, CH, CY, CZ, DE, DK, EE, EG, ES, FI, FR, GB, GI, GR, HK, HU, ID, IE, IL, IM, IN, IS, IT, JO, KW, LB, LI, LK, LT, LU, LV, MC, MT, MU, MV, MX, MY, NL, NO, NZ, OM, PH, PL, PT, QA, RO, SA, SE, SG, SI, SK, SM, TR, TT, UM, US, VA, VN, ZA
166
166
  * [Stripe](https://stripe.com/) - US
167
167
  * [TransFirst](http://www.transfirst.com/) - US
168
+ * [Transnational](http://www.tnbci.com/) - US
168
169
  * [TrustCommerce](http://www.trustcommerce.com/) - US
169
170
  * [USA ePay](http://www.usaepay.com/) - US
170
171
  * [Verifi](http://www.verifi.com/) - US
@@ -193,7 +194,8 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
193
194
  * [Paxum](https://www.paxum.com/)
194
195
  * [PayPal Website Payments Standard](https://www.paypal.com/cgi-bin/webscr?cmd#_wp-standard-overview-outside)
195
196
  * [Paysbuy](https://www.paysbuy.com/) - TH
196
- * [Robokassa](http://robokassa.ru/)
197
+ * [RBK Money](https://rbkmoney.ru/) - RU
198
+ * [Robokassa](http://robokassa.ru/) - RU
197
199
  * [SagePay Form](http://www.sagepay.com/products_services/sage_pay_go/integration/form)
198
200
  * [Suomen Maksuturva](https://www.maksuturva.fi/services/vendor_services/integration_guidelines.html)
199
201
  * [Valitor](http://www.valitor.is/) - IS
@@ -4,12 +4,13 @@ module ActiveMerchant #:nodoc:
4
4
  # of necessary attributes such as checkholder's name, routing and account numbers, but it is
5
5
  # not backed by any database.
6
6
  #
7
- # You may use Check in place of CreditCard with any gateway that supports it. Currently, only
8
- # +BraintreeGateway+ supports the Check object.
7
+ # You may use Check in place of CreditCard with any gateway that supports it.
9
8
  class Check
10
9
  include Validateable
11
10
 
12
- attr_accessor :first_name, :last_name, :routing_number, :account_number, :account_holder_type, :account_type, :number
11
+ attr_accessor :first_name, :last_name,
12
+ :bank_name, :routing_number, :account_number,
13
+ :account_holder_type, :account_type, :number
13
14
 
14
15
  # Used for Canadian bank accounts
15
16
  attr_accessor :institution_number, :transit_number
@@ -257,9 +257,13 @@ module ActiveMerchant #:nodoc:
257
257
  def validate_switch_or_solo_attributes #:nodoc:
258
258
  if %w[switch solo].include?(brand)
259
259
  unless valid_month?(@start_month) && valid_start_year?(@start_year) || valid_issue_number?(@issue_number)
260
- errors.add :start_month, "is invalid" unless valid_month?(@start_month)
261
- errors.add :start_year, "is invalid" unless valid_start_year?(@start_year)
262
- errors.add :issue_number, "cannot be empty" unless valid_issue_number?(@issue_number)
260
+ if @issue_number.blank?
261
+ errors.add :start_month, "is invalid" unless valid_month?(@start_month)
262
+ errors.add :start_year, "is invalid" unless valid_start_year?(@start_year)
263
+ errors.add :issue_number, "cannot be empty"
264
+ else
265
+ errors.add :issue_number, "is invalid" unless valid_issue_number?(@issue_number)
266
+ end
263
267
  end
264
268
  end
265
269
  end
@@ -83,13 +83,13 @@ module ActiveMerchant #:nodoc:
83
83
  # ==== Parameters
84
84
  #
85
85
  # * <tt>money</tt> -- The amount to be authorized as an Integer value in cents.
86
- # * <tt>creditcard</tt> -- The CreditCard details for the transaction.
86
+ # * <tt>paysource</tt> -- The CreditCard or Check details for the transaction.
87
87
  # * <tt>options</tt> -- A hash of optional parameters.
88
- def authorize(money, creditcard, options = {})
88
+ def authorize(money, paysource, options = {})
89
89
  post = {}
90
90
  add_currency_code(post, money, options)
91
91
  add_invoice(post, options)
92
- add_creditcard(post, creditcard)
92
+ add_payment_source(post, paysource, options)
93
93
  add_address(post, options)
94
94
  add_customer_data(post, options)
95
95
  add_duplicate_window(post)
@@ -102,13 +102,13 @@ module ActiveMerchant #:nodoc:
102
102
  # ==== Parameters
103
103
  #
104
104
  # * <tt>money</tt> -- The amount to be purchased as an Integer value in cents.
105
- # * <tt>creditcard</tt> -- The CreditCard details for the transaction.
105
+ # * <tt>paysource</tt> -- The CreditCard or Check details for the transaction.
106
106
  # * <tt>options</tt> -- A hash of optional parameters.
107
- def purchase(money, creditcard, options = {})
107
+ def purchase(money, paysource, options = {})
108
108
  post = {}
109
109
  add_currency_code(post, money, options)
110
110
  add_invoice(post, options)
111
- add_creditcard(post, creditcard)
111
+ add_payment_source(post, paysource, options)
112
112
  add_address(post, options)
113
113
  add_customer_data(post, options)
114
114
  add_duplicate_window(post)
@@ -349,6 +349,26 @@ module ActiveMerchant #:nodoc:
349
349
  post[:last_name] = creditcard.last_name
350
350
  end
351
351
 
352
+ def add_payment_source(params, source, options={})
353
+ if card_brand(source) == "check"
354
+ add_check(params, source, options)
355
+ else
356
+ add_creditcard(params, source)
357
+ end
358
+ end
359
+
360
+ def add_check(post, check, options)
361
+ post[:method] = "ECHECK"
362
+ post[:bank_name] = check.bank_name
363
+ post[:bank_aba_code] = check.routing_number
364
+ post[:bank_acct_num] = check.account_number
365
+ post[:bank_acct_type] = check.account_type
366
+ post[:echeck_type] = "WEB"
367
+ post[:bank_acct_name] = check.name
368
+ post[:bank_check_number] = check.number if check.number.present?
369
+ post[:recurring_billing] = (options[:recurring] ? "TRUE" : "FALSE")
370
+ end
371
+
352
372
  def add_customer_data(post, options)
353
373
  if options.has_key? :email
354
374
  post[:email] = options[:email]
@@ -356,7 +376,7 @@ module ActiveMerchant #:nodoc:
356
376
  end
357
377
 
358
378
  if options.has_key? :customer
359
- post[:cust_id] = options[:customer]
379
+ post[:cust_id] = options[:customer] if Float(options[:customer]) rescue nil
360
380
  end
361
381
 
362
382
  if options.has_key? :ip
@@ -134,7 +134,14 @@ module ActiveMerchant #:nodoc:
134
134
  end
135
135
 
136
136
  def parse
137
- doc = REXML::Document.new(@response)
137
+ require 'iconv' unless String.method_defined?(:encode)
138
+ if String.method_defined?(:encode)
139
+ doc = REXML::Document.new(@response.encode("UTF-8", "ISO-8859-1"))
140
+ else
141
+ ic = Iconv.new('UTF-8', 'ISO-8859-1')
142
+ doc = REXML::Document.new(ic.iconv(@response))
143
+ end
144
+
138
145
  auth_type = find(doc, "//Transaction/Type").to_s
139
146
 
140
147
  message = find(doc, "//Message/Text")