activemerchant 1.29.1 → 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 (92) hide show
  1. data/CHANGELOG +137 -0
  2. data/CONTRIBUTORS +43 -0
  3. data/README.md +59 -51
  4. data/lib/active_merchant/billing/check.rb +15 -14
  5. data/lib/active_merchant/billing/credit_card.rb +9 -5
  6. data/lib/active_merchant/billing/credit_card_formatting.rb +8 -8
  7. data/lib/active_merchant/billing/gateway.rb +2 -2
  8. data/lib/active_merchant/billing/gateways/authorize_net.rb +36 -8
  9. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +17 -5
  10. data/lib/active_merchant/billing/gateways/balanced.rb +9 -3
  11. data/lib/active_merchant/billing/gateways/banwire.rb +15 -1
  12. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +8 -1
  13. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +7 -2
  14. data/lib/active_merchant/billing/gateways/beanstream.rb +26 -24
  15. data/lib/active_merchant/billing/gateways/blue_pay.rb +201 -185
  16. data/lib/active_merchant/billing/gateways/bogus.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/braintree_blue.rb +6 -2
  18. data/lib/active_merchant/billing/gateways/card_stream_modern.rb +155 -0
  19. data/lib/active_merchant/billing/gateways/cc5.rb +156 -0
  20. data/lib/active_merchant/billing/gateways/cyber_source.rb +55 -22
  21. data/lib/active_merchant/billing/gateways/data_cash.rb +3 -3
  22. data/lib/active_merchant/billing/gateways/evo_ca.rb +308 -0
  23. data/lib/active_merchant/billing/gateways/eway.rb +114 -171
  24. data/lib/active_merchant/billing/gateways/eway_managed.rb +52 -22
  25. data/lib/active_merchant/billing/gateways/finansbank.rb +22 -0
  26. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +314 -0
  27. data/lib/active_merchant/billing/gateways/garanti.rb +0 -4
  28. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +13 -2
  29. data/lib/active_merchant/billing/gateways/iridium.rb +8 -2
  30. data/lib/active_merchant/billing/gateways/litle.rb +354 -105
  31. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +27 -6
  32. data/lib/active_merchant/billing/gateways/merchant_ware.rb +44 -9
  33. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +190 -0
  34. data/lib/active_merchant/billing/gateways/moneris.rb +3 -5
  35. data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/nab_transact.rb +20 -3
  37. data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
  38. data/lib/active_merchant/billing/gateways/netaxept.rb +65 -117
  39. data/lib/active_merchant/billing/gateways/netbilling.rb +1 -0
  40. data/lib/active_merchant/billing/gateways/netpay.rb +223 -0
  41. data/lib/active_merchant/billing/gateways/ogone.rb +7 -5
  42. data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -18
  43. data/lib/active_merchant/billing/gateways/orbital.rb +190 -53
  44. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +14 -11
  45. data/lib/active_merchant/billing/gateways/payment_express.rb +62 -1
  46. data/lib/active_merchant/billing/gateways/paymill.rb +179 -0
  47. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +12 -7
  48. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +14 -9
  49. data/lib/active_merchant/billing/gateways/paypal_express.rb +42 -18
  50. data/lib/active_merchant/billing/gateways/pin.rb +165 -0
  51. data/lib/active_merchant/billing/gateways/qbms.rb +3 -2
  52. data/lib/active_merchant/billing/gateways/quickpay.rb +66 -28
  53. data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +16 -11
  54. data/lib/active_merchant/billing/gateways/sage/sage_core.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +21 -16
  56. data/lib/active_merchant/billing/gateways/sage.rb +10 -5
  57. data/lib/active_merchant/billing/gateways/sage_pay.rb +7 -0
  58. data/lib/active_merchant/billing/gateways/smart_ps.rb +1 -1
  59. data/lib/active_merchant/billing/gateways/spreedly_core.rb +233 -0
  60. data/lib/active_merchant/billing/gateways/stripe.rb +25 -11
  61. data/lib/active_merchant/billing/gateways/transnational.rb +239 -0
  62. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +9 -4
  63. data/lib/active_merchant/billing/gateways/webpay.rb +8 -0
  64. data/lib/active_merchant/billing/gateways/wirecard.rb +15 -9
  65. data/lib/active_merchant/billing/gateways/worldpay.rb +60 -24
  66. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +1 -1
  67. data/lib/active_merchant/billing/integrations/direc_pay.rb +1 -1
  68. data/lib/active_merchant/billing/integrations/dwolla/common.rb +21 -0
  69. data/lib/active_merchant/billing/integrations/dwolla/helper.rb +15 -6
  70. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +11 -6
  71. data/lib/active_merchant/billing/integrations/dwolla/return.rb +12 -4
  72. data/lib/active_merchant/billing/integrations/dwolla.rb +5 -12
  73. data/lib/active_merchant/billing/integrations/notification.rb +13 -8
  74. data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +19 -3
  75. data/lib/active_merchant/billing/integrations/paypal/notification.rb +39 -31
  76. data/lib/active_merchant/billing/integrations/payu_in/helper.rb +74 -0
  77. data/lib/active_merchant/billing/integrations/payu_in/notification.rb +167 -0
  78. data/lib/active_merchant/billing/integrations/payu_in/return.rb +53 -0
  79. data/lib/active_merchant/billing/integrations/payu_in.rb +43 -0
  80. data/lib/active_merchant/billing/integrations/pxpay/helper.rb +1 -0
  81. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +13 -10
  82. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +78 -15
  83. data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +23 -0
  84. data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +91 -0
  85. data/lib/active_merchant/billing/integrations/rbkmoney.rb +17 -0
  86. data/lib/active_merchant/billing/integrations/robokassa/common.rb +1 -1
  87. data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +7 -3
  88. data/lib/active_merchant/billing/integrations/world_pay.rb +15 -8
  89. data/lib/active_merchant/version.rb +1 -1
  90. data.tar.gz.sig +0 -0
  91. metadata +124 -50
  92. metadata.gz.sig +0 -0
data/CHANGELOG CHANGED
@@ -1,5 +1,142 @@
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
+
51
+ == Version 1.32.0 (April 1, 2013)
52
+
53
+ * Optimal: Submit shipping address with requests [jduff]
54
+ * Iridium: Enable reference transactions for authorize [ntalbott]
55
+ * Stripe: Add authorize and capture methods [melari]
56
+ * Pin: Add a default description if none is specified to fix failures [melari]
57
+ * Litle: Add support for passing optional fields in token based transactions [forest]
58
+ * Add Finansbank gateway [scamurcuoglu]
59
+ * Paymill: Use .com instead of .de for save card url [besi]
60
+ * Worldpay integration: Use more robust endpoint urls [nashbridges]
61
+ * Braintree Blue: Return CC token in transaction hash [cyu]
62
+ * Robokassa: Fix signature for empty amount [ukolovda]
63
+ * Worldpay gateway: Fix error messages for some failures [duff]
64
+ * Worldpay gateway: Allow settled payments to be refunded [dougal]
65
+ * Spreedly: Update urls and terminology [duff]
66
+ * Make card brand error more user friendly [oggy]
67
+ * DataCash: Update test Mastercard number [jamesshipton]
68
+ * DataCash: Update test response fixtures [jamesshipton]
69
+ * Pin: Add Pin.js card token support [nagash]
70
+ * PayPal Express gateway: Fix error when no address information is in response [pierre]
71
+ * Ogone: Use BYPSP for ALIASOPERATION [ntalbott]
72
+ * Paymill: Handle error storing card [duff]
73
+ * SagePay integration: Add referrer field [melari]
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]
77
+
78
+ == Version 1.31.1 (February 25, 2013)
79
+
80
+ * Cybersource: Bug fixes [natejgreene, jduff]
81
+
82
+ == Version 1.31.0 (February 20, 2013)
83
+
84
+ * Worldpay: XML encoding is required to be ISO-8859-1 [dougal]
85
+ * Worldpay: Add card code for more supported card types [dougal]
86
+ * Ogone: Add action option [pwoestelandt]
87
+ * PayPal Express gateway: Add support for BuyerEmailOptInEnable [chrisrbnelson]
88
+ * Add Paymill gateway [duff]
89
+ * Add EVO Canada gateway [alexdunae]
90
+ * Fixed credit card and check interface, used correct method for checking payment type [jduff]
91
+
92
+ == Version 1.30.0 (February 13, 2013)
93
+
94
+ * Add FirstData Global Gateway e4 [frobcode]
95
+ * PaymentExpress: Add support for optional fields: ClientType and TxnData [moklett]
96
+ * PaymentExpress: Limit MerchantReference/description to 64 chars [moklett]
97
+ * Wirecard: description must be no more than 32 characters [moklett]
98
+ * Litle: Add support for passing a token to the authorize and purchase methods [forest]
99
+ * PayPal Common: Allow searching for transactions by ProfileID [aq1018]
100
+ * Add Spreedly Core gateway [duff]
101
+ * eWay Gateway: Return proper value for authorization [duff]
102
+ * eWay Gateway: Add support for refunds [duff]
103
+ * Quickpay: Add support for protocols 5 & 6 [twarberg]
104
+ * Banwire gateway: Handle JSON::ParserError [duff]
105
+ * Balanced gateway: Fix unspecified marketplace [duff]
106
+ * QBMS gateway: Allow partial addresses [duff]
107
+ * Authorize.Net CIM: Allow omitting card expiration date [shanebonham]
108
+ * Authorize.Net CIM: Add support for extraOptions to createCustomerProfileTransaction [tpiekos]
109
+ * Add NETPAY gateway [samlown]
110
+ * Balanced gateway: Add amount to the refund method signature [ntalbott]
111
+ * Orbital gateway: Fix void method signature [aprofeit, ntalbott]
112
+ * Eway Managed: Add 'query_customer' API as #retrieve [cdaloisio]
113
+ * NetPay: Fix the signature for void [duff]
114
+ * Cybersource: Add check support [bowmande]
115
+ * Moneris: Use a capture of $0 for void [ntalbott]
116
+ * PayPal Express integration: Fix received_at time zone [ntalbott]
117
+ * NAB Transact: Add refund capability [nagash]
118
+ * Stripe: Add support for application_fee [duff]
119
+ * SagePay: Add support for GiftAidPayment [duff]
120
+ * Wirecard: Add support for partial captures [richardblair]
121
+ * Add Pin gateway [madpilot]
122
+ * Balanced: Added support for on_behalf_of_uri to capture [cwise]
123
+ * Litle: Add support for passing an order_source [forest]
124
+ * Add Merchant Warrior gateway [pronix, Fodoj, ntalbott]
125
+ * Use v4 of the MerchantWare API for voiding transactions [melari]
126
+ * Add support for Authorize.net in CA and GB [melari]
127
+ * Send customer's IP to Beanstream for fraud review [melari]
128
+
129
+ == Version 1.29.3 (December 7, 2012)
130
+
131
+ * Braintree Blue: Better wiredump_device support [ntalbott]
132
+ * Braintree: Store sets vault id as authorization [ntalbott]
133
+ * WorldPay: Fix currencies without fractions like JPY and HUF by rounding down amount [Soleone]
134
+
135
+ == Version 1.29.2 (December 7, 2012)
136
+
137
+ * Moneris: fix issue with the default options not being merged [jduff]
138
+ * Sage Pay: Make 0000 default post code for everyone if missing [BlakeMesdag]
139
+
3
140
  == Version 1.29.1 (December 5, 2012)
4
141
 
5
142
  * Add eWay Rapid 3.0 gateway [ntalbott]
data/CONTRIBUTORS CHANGED
@@ -346,6 +346,10 @@ Balanced gateway (July 2012)
346
346
 
347
347
  * Marshall Jones (mjallday)
348
348
 
349
+ PayFast integration (October 2012)
350
+
351
+ * Vasiliy Ermolovich (nashby)
352
+
349
353
  A1Agregator (November 2012)
350
354
 
351
355
  * Roman Ivanilov (england)
@@ -357,3 +361,42 @@ Liqpay integration (November 2012)
357
361
  eWay Rapid 3.0 gateway (December 2012)
358
362
 
359
363
  * Nathaniel Talbott (ntalbott)
364
+
365
+ FirstData Global Gateway e4 (December 2012)
366
+
367
+ * Chris Sheppard (frobcode)
368
+
369
+ Spreedly Core gateway (December 2012)
370
+
371
+ * Duff OMelia (duff)
372
+
373
+ Pin gateway (February 2013)
374
+
375
+ * Myles Eftos (madpilot)
376
+
377
+ Merchant Warrior (February 2013)
378
+
379
+ * Ben Bruscella (benbruscella)
380
+ * Дмитрий Василец (pronix)
381
+ * Kirill Shirinkin (Fodoj)
382
+ * Nathaniel Talbott (ntalbott)
383
+
384
+ Paymill (February 2013)
385
+
386
+ * Duff O'Melia (duff)
387
+
388
+ EVO Canada (February 2013)
389
+
390
+ * Alex Dunae (alexdunae)
391
+
392
+ Finansbank WebPOS (March 2013)
393
+
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
@@ -4,13 +4,15 @@ Active Merchant is an extraction from the e-commerce system [Shopify](http://www
4
4
  Shopify's requirements for a simple and unified API to access dozens of different payment
5
5
  gateways with very different internal APIs was the chief principle in designing the library.
6
6
 
7
- Active Merchant has been in production use since June 2006 and is now used in most modern
8
- Ruby applications which deal with financial transactions.
9
-
10
7
  It was developed for usage in Ruby on Rails web applications and integrates seamlessly
11
- as a plugin but it also works excellently as a stand alone library.
8
+ as a Rails plugin, but it also works excellently as a stand alone Ruby library.
9
+
10
+ Active Merchant has been in production use since June 2006 and is now used in most modern
11
+ Ruby applications which deal with financial transactions. It is maintained by the
12
+ [Shopify](http://www.shopify.com) and [Spreedly](https://spreedly.com) teams, with much help
13
+ from an ever-growing set of contributors.
12
14
 
13
- 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
14
16
  applications.
15
17
 
16
18
  ## Installation
@@ -21,63 +23,56 @@ You can check out the latest source from git:
21
23
 
22
24
  git clone git://github.com/Shopify/active_merchant.git
23
25
 
24
- ### As a Rails plugin
25
-
26
- ActiveMerchant includes an init.rb file. This means that Rails will automatically load ActiveMerchant on startup. Run
27
- the following command from the root directory of your Rails project to install ActiveMerchant as a Rails plugin:
28
-
29
- script/plugin install git://github.com/Shopify/active_merchant.git
30
-
31
26
  ### From RubyGems
32
27
 
33
- Installation from RubyGems
28
+ Installation from RubyGems:
34
29
 
35
30
  gem install activemerchant
36
31
 
37
- Alternatively, add the following to your Gemfile
32
+ Or, if you're using Bundler, just add the following to your Gemfile:
38
33
 
39
- gem 'activemerchant', :require => 'active_merchant'
34
+ gem 'activemerchant'
40
35
 
41
36
  ## Usage
42
37
 
43
38
  This simple example demonstrates how a purchase can be made using a person's
44
39
  credit card details.
45
40
 
46
- require 'rubygems'
47
- require 'active_merchant'
48
-
49
- # Use the TrustCommerce test servers
50
- ActiveMerchant::Billing::Base.mode = :test
51
-
52
- gateway = ActiveMerchant::Billing::TrustCommerceGateway.new(
53
- :login => 'TestMerchant',
54
- :password => 'password')
55
-
56
- # ActiveMerchant accepts all amounts as Integer values in cents
57
- amount = 1000 # $10.00
58
-
59
- # The card verification value is also known as CVV2, CVC2, or CID
60
- credit_card = ActiveMerchant::Billing::CreditCard.new(
61
- :first_name => 'Bob',
62
- :last_name => 'Bobsen',
63
- :number => '4242424242424242',
64
- :month => '8',
65
- :year => '2012',
66
- :verification_value => '123')
67
-
68
- # Validating the card automatically detects the card type
69
- if credit_card.valid?
70
- # Capture $10 from the credit card
71
- response = gateway.purchase(amount, credit_card)
72
-
73
- if response.success?
74
- puts "Successfully charged $#{sprintf("%.2f", amount / 100)} to the credit card #{credit_card.display_number}"
75
- else
76
- raise StandardError, response.message
77
- end
78
- end
79
-
80
- For more in-depth documentation and tutorials, see {file:GettingStarted.md} and the
41
+ require 'rubygems'
42
+ require 'active_merchant'
43
+
44
+ # Use the TrustCommerce test servers
45
+ ActiveMerchant::Billing::Base.mode = :test
46
+
47
+ gateway = ActiveMerchant::Billing::TrustCommerceGateway.new(
48
+ :login => 'TestMerchant',
49
+ :password => 'password')
50
+
51
+ # ActiveMerchant accepts all amounts as Integer values in cents
52
+ amount = 1000 # $10.00
53
+
54
+ # The card verification value is also known as CVV2, CVC2, or CID
55
+ credit_card = ActiveMerchant::Billing::CreditCard.new(
56
+ :first_name => 'Bob',
57
+ :last_name => 'Bobsen',
58
+ :number => '4242424242424242',
59
+ :month => '8',
60
+ :year => Time.now.year+1,
61
+ :verification_value => '000')
62
+
63
+ # Validating the card automatically detects the card type
64
+ if credit_card.valid?
65
+ # Capture $10 from the credit card
66
+ response = gateway.purchase(amount, credit_card)
67
+
68
+ if response.success?
69
+ puts "Successfully charged $#{sprintf("%.2f", amount / 100)} to the credit card #{credit_card.display_number}"
70
+ else
71
+ raise StandardError, response.message
72
+ end
73
+ end
74
+
75
+ For more in-depth documentation and tutorials, see [GettingStarted.md](GettingStarted.md) and the
81
76
  [API documentation](http://rubydoc.info/github/Shopify/active_merchant/master/file/README.md).
82
77
 
83
78
  ## Supported Direct Payment Gateways
@@ -99,11 +94,14 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
99
94
  * [Efsnet](http://www.concordefsnet.com/) - US
100
95
  * [Elavon MyVirtualMerchant](http://www.elavon.com) - US, CA
101
96
  * [ePay](http://www.epay.dk/) - DK, SE, NO
97
+ * [EVO Canada](http://www.evocanada.com/) - CA
102
98
  * [eWAY](http://www.eway.com.au/) - AU
103
99
  * [eWay Rapid 3.0](http://www.eway.com.au/) - AU
104
100
  * [E-xact](http://www.e-xact.com) - CA, US
105
101
  * [Fat Zebra](https://www.fatzebra.com.au) - AU
106
102
  * [Federated Canada](http://www.federatedcanada.com/) - CA
103
+ * [Finansbank WebPOS](https://www.fbwebpos.com/) - US, TR
104
+ * [FirstData Global Gateway e4](http://www.firstdata.com) - CA, US
107
105
  * [FirstPay](http://www.first-pay.com) - US
108
106
  * [Garanti Sanal POS](https://ccpos.garanti.com.tr/ccRaporlar/garanti/ccReports) - US, TR
109
107
  * [HDFC](http://www.hdfcbank.com/sme/sme-details/merchant-services/guzh6m0i) - IN
@@ -116,6 +114,7 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
116
114
  * [Litle](http://www.litle.com/) - US
117
115
  * [Merchant e-Solutions](http://merchante-solutions.com/) - US
118
116
  * [MerchantWare](http://merchantwarehouse.com/merchantware) - US
117
+ * [Merchant Warrior] (http://merchantwarrior.com) - AU
119
118
  * [Mercury](http://www.mercurypay.com) - US
120
119
  * [MasterCard Internet Gateway Service (MiGS)](http://mastercard.com/mastercardsps) - AU, AE, BD, BN, EG, HK, ID, IN, JO, KW, LB, LK, MU, MV, MY, NZ, OM, PH, QA, SA, SG, TT, VN
121
120
  * [Modern Payments](http://www.modpay.com) - US
@@ -125,15 +124,18 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
125
124
  * [NELiX TransaX Gateway](http://www.nelixtransax.com) - US
126
125
  * [Netaxept](http://www.betalingsterminal.no/Netthandel-forside) - NO, DK, SE, FI
127
126
  * [NETbilling](http://www.netbilling.com) - US
127
+ * [NetPay](http://www.netpay.com.mx) - MX
128
128
  * [NetRegistry](http://www.netregistry.com.au) - AU
129
129
  * [NMI](http://nmi.com/) - US
130
130
  * [Ogone DirectLink](http://www.ogone.com) - BE, DE, FR, NL, AT, CH
131
131
  * [Optimal Payments](http://www.optimalpayments.com/) - CA, US, UK
132
132
  * [Orbital Paymentech](http://chasepaymentech.com/) - CA, US, UK, GB
133
133
  * [PayBox Direct](http://www.paybox.com) - FR
134
+ * [PayFast](https://www.payfast.co.za/) - ZA
134
135
  * [PayGate PayXML](http://paygate.co.za/) - US, ZA
135
136
  * [PayJunction](http://www.payjunction.com/) - US
136
137
  * [PaymentExpress](http://www.paymentexpress.com/) - AU, MY, NZ, SG, ZA, UK, US
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
137
139
  * [PayPal Express Checkout](https://www.paypal.com/cgi-bin/webscr?cmd=xpt/merchant/ExpressCheckoutIntro-outside) - US, CA, SG, AU
138
140
  * [PayPal Payflow Pro](https://www.paypal.com/cgi-bin/webscr?cmd=_payflow-pro-overview-outside) - US, CA, SG, AU
139
141
  * [PayPal Website Payments Pro (UK)](https://www.paypal.com/uk/cgi-bin/webscr?cmd=_wp-pro-overview-outside) - UK
@@ -142,6 +144,7 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
142
144
  * [PayPal Website Payments Pro (US)](https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside) - US
143
145
  * [PaySecure](http://www.commsecure.com.au/paysecure.shtml) - AU
144
146
  * [PayWay](https://www.payway.com.au) - AU
147
+ * [Pin](http://www.pin.net.au/) - AU
145
148
  * [Plug'n Pay](http://www.plugnpay.com/) - US
146
149
  * [Psigate](http://www.psigate.com/) - CA
147
150
  * [PSL Payment Solutions](http://www.paymentsolutionsltd.com/) - UK
@@ -159,8 +162,10 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
159
162
  * [SecurePay](http://www.securepay.com/) - US
160
163
  * [SecurePayTech](http://www.securepaytech.com/) - NZ
161
164
  * [SkipJack](http://www.skipjack.com/) - US, CA
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
162
166
  * [Stripe](https://stripe.com/) - US
163
167
  * [TransFirst](http://www.transfirst.com/) - US
168
+ * [Transnational](http://www.tnbci.com/) - US
164
169
  * [TrustCommerce](http://www.trustcommerce.com/) - US
165
170
  * [USA ePay](http://www.usaepay.com/) - US
166
171
  * [Verifi](http://www.verifi.com/) - US
@@ -189,7 +194,8 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
189
194
  * [Paxum](https://www.paxum.com/)
190
195
  * [PayPal Website Payments Standard](https://www.paypal.com/cgi-bin/webscr?cmd#_wp-standard-overview-outside)
191
196
  * [Paysbuy](https://www.paysbuy.com/) - TH
192
- * [Robokassa](http://robokassa.ru/)
197
+ * [RBK Money](https://rbkmoney.ru/) - RU
198
+ * [Robokassa](http://robokassa.ru/) - RU
193
199
  * [SagePay Form](http://www.sagepay.com/products_services/sage_pay_go/integration/form)
194
200
  * [Suomen Maksuturva](https://www.maksuturva.fi/services/vendor_services/integration_guidelines.html)
195
201
  * [Valitor](http://www.valitor.is/) - IS
@@ -211,3 +217,5 @@ Please don't touch the CHANGELOG in your pull requests, we'll add the appropriat
211
217
  at release time.
212
218
 
213
219
  [![Build Status](https://secure.travis-ci.org/Shopify/active_merchant.png)](http://travis-ci.org/Shopify/active_merchant)
220
+
221
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/Shopify/active_merchant)
@@ -3,21 +3,22 @@ module ActiveMerchant #:nodoc:
3
3
  # The Check object is a plain old Ruby object, similar to CreditCard. It supports validation
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
- #
7
- # You may use Check in place of CreditCard with any gateway that supports it. Currently, only
8
- # +BraintreeGateway+ supports the Check object.
6
+ #
7
+ # You may use Check in place of CreditCard with any gateway that supports it.
9
8
  class Check
10
9
  include Validateable
11
-
12
- attr_accessor :first_name, :last_name, :routing_number, :account_number, :account_holder_type, :account_type, :number
13
-
10
+
11
+ attr_accessor :first_name, :last_name,
12
+ :bank_name, :routing_number, :account_number,
13
+ :account_holder_type, :account_type, :number
14
+
14
15
  # Used for Canadian bank accounts
15
16
  attr_accessor :institution_number, :transit_number
16
-
17
+
17
18
  def name
18
19
  @name ||= "#{@first_name} #{@last_name}".strip
19
20
  end
20
-
21
+
21
22
  def name=(value)
22
23
  return if value.blank?
23
24
 
@@ -26,25 +27,25 @@ module ActiveMerchant #:nodoc:
26
27
  @last_name = segments.pop
27
28
  @first_name = segments.join(' ')
28
29
  end
29
-
30
+
30
31
  def validate
31
32
  [:name, :routing_number, :account_number].each do |attr|
32
33
  errors.add(attr, "cannot be empty") if self.send(attr).blank?
33
34
  end
34
-
35
+
35
36
  errors.add(:routing_number, "is invalid") unless valid_routing_number?
36
-
37
+
37
38
  errors.add(:account_holder_type, "must be personal or business") if
38
39
  !account_holder_type.blank? && !%w[business personal].include?(account_holder_type.to_s)
39
-
40
+
40
41
  errors.add(:account_type, "must be checking or savings") if
41
42
  !account_type.blank? && !%w[checking savings].include?(account_type.to_s)
42
43
  end
43
-
44
+
44
45
  def type
45
46
  'check'
46
47
  end
47
-
48
+
48
49
  # Routing numbers may be validated by calculating a checksum and dividing it by 10. The
49
50
  # formula is:
50
51
  # (3(d1 + d4 + d7) + 7(d2 + d5 + d8) + 1(d3 + d6 + d9))mod 10 = 0
@@ -181,7 +181,7 @@ module ActiveMerchant #:nodoc:
181
181
  def display_number
182
182
  self.class.mask(number)
183
183
  end
184
-
184
+
185
185
  def first_digits
186
186
  self.class.first_digits(number)
187
187
  end
@@ -229,7 +229,7 @@ module ActiveMerchant #:nodoc:
229
229
  end
230
230
 
231
231
  unless errors.on(:number) || errors.on(:brand)
232
- errors.add :brand, "is not the correct card brand" unless CreditCard.matching_brand?(number, brand)
232
+ errors.add :brand, "does not match the card number" unless CreditCard.matching_brand?(number, brand)
233
233
  end
234
234
  end
235
235
 
@@ -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
@@ -1,21 +1,21 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  module CreditCardFormatting
4
-
5
- # This method is used to format numerical information pertaining to credit cards.
6
- #
4
+
5
+ # This method is used to format numerical information pertaining to credit cards.
6
+ #
7
7
  # format(2005, :two_digits) # => "05"
8
8
  # format(05, :four_digits) # => "0005"
9
9
  def format(number, option)
10
10
  return '' if number.blank?
11
-
11
+
12
12
  case option
13
- when :two_digits ; sprintf("%.2i", number)[-2..-1]
14
- when :four_digits ; sprintf("%.4i", number)[-4..-1]
13
+ when :two_digits ; sprintf("%.2i", number.to_i)[-2..-1]
14
+ when :four_digits ; sprintf("%.4i", number.to_i)[-4..-1]
15
15
  else number
16
16
  end
17
17
  end
18
-
18
+
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -62,7 +62,7 @@ module ActiveMerchant #:nodoc:
62
62
  include Utils
63
63
 
64
64
  DEBIT_CARDS = [ :switch, :solo ]
65
- CURRENCIES_WITHOUT_FRACTIONS = [ 'JPY' ]
65
+ CURRENCIES_WITHOUT_FRACTIONS = [ 'JPY', 'HUF', 'TWD' ]
66
66
  CREDIT_DEPRECATION_MESSAGE = "Support for using credit to refund existing transactions is deprecated and will be removed from a future release of ActiveMerchant. Please use the refund method instead."
67
67
 
68
68
  cattr_reader :implementations
@@ -130,7 +130,7 @@ module ActiveMerchant #:nodoc:
130
130
 
131
131
  # Are we running in test mode?
132
132
  def test?
133
- (@options[:test] || Base.test?)
133
+ (@options.has_key?(:test) ? @options[:test] : Base.test?)
134
134
  end
135
135
 
136
136
  private # :nodoc: all
@@ -41,7 +41,9 @@ module ActiveMerchant #:nodoc:
41
41
  RESPONSE_CODE, RESPONSE_REASON_CODE, RESPONSE_REASON_TEXT = 0, 2, 3
42
42
  AVS_RESULT_CODE, TRANSACTION_ID, CARD_CODE_RESPONSE_CODE = 5, 6, 38
43
43
 
44
- self.supported_countries = ['US']
44
+ self.default_currency = 'USD'
45
+
46
+ self.supported_countries = ['US', 'CA', 'GB']
45
47
  self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
46
48
  self.homepage_url = 'http://www.authorize.net/'
47
49
  self.display_name = 'Authorize.Net'
@@ -81,12 +83,13 @@ module ActiveMerchant #:nodoc:
81
83
  # ==== Parameters
82
84
  #
83
85
  # * <tt>money</tt> -- The amount to be authorized as an Integer value in cents.
84
- # * <tt>creditcard</tt> -- The CreditCard details for the transaction.
86
+ # * <tt>paysource</tt> -- The CreditCard or Check details for the transaction.
85
87
  # * <tt>options</tt> -- A hash of optional parameters.
86
- def authorize(money, creditcard, options = {})
88
+ def authorize(money, paysource, options = {})
87
89
  post = {}
90
+ add_currency_code(post, money, options)
88
91
  add_invoice(post, options)
89
- add_creditcard(post, creditcard)
92
+ add_payment_source(post, paysource, options)
90
93
  add_address(post, options)
91
94
  add_customer_data(post, options)
92
95
  add_duplicate_window(post)
@@ -99,12 +102,13 @@ module ActiveMerchant #:nodoc:
99
102
  # ==== Parameters
100
103
  #
101
104
  # * <tt>money</tt> -- The amount to be purchased as an Integer value in cents.
102
- # * <tt>creditcard</tt> -- The CreditCard details for the transaction.
105
+ # * <tt>paysource</tt> -- The CreditCard or Check details for the transaction.
103
106
  # * <tt>options</tt> -- A hash of optional parameters.
104
- def purchase(money, creditcard, options = {})
107
+ def purchase(money, paysource, options = {})
105
108
  post = {}
109
+ add_currency_code(post, money, options)
106
110
  add_invoice(post, options)
107
- add_creditcard(post, creditcard)
111
+ add_payment_source(post, paysource, options)
108
112
  add_address(post, options)
109
113
  add_customer_data(post, options)
110
114
  add_duplicate_window(post)
@@ -328,6 +332,10 @@ module ActiveMerchant #:nodoc:
328
332
  request
329
333
  end
330
334
 
335
+ def add_currency_code(post, money, options)
336
+ post[:currency_code] = options[:currency] || currency(money)
337
+ end
338
+
331
339
  def add_invoice(post, options)
332
340
  post[:invoice_num] = options[:order_id]
333
341
  post[:description] = options[:description]
@@ -341,6 +349,26 @@ module ActiveMerchant #:nodoc:
341
349
  post[:last_name] = creditcard.last_name
342
350
  end
343
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
+
344
372
  def add_customer_data(post, options)
345
373
  if options.has_key? :email
346
374
  post[:email] = options[:email]
@@ -348,7 +376,7 @@ module ActiveMerchant #:nodoc:
348
376
  end
349
377
 
350
378
  if options.has_key? :customer
351
- post[:cust_id] = options[:customer]
379
+ post[:cust_id] = options[:customer] if Float(options[:customer]) rescue nil
352
380
  end
353
381
 
354
382
  if options.has_key? :ip