bitfluent-activemerchant 1.5.1.1 → 1.15.1

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 (121) hide show
  1. data/CHANGELOG +168 -0
  2. data/CONTRIBUTORS +96 -1
  3. data/README.rdoc +33 -5
  4. data/lib/active_merchant.rb +12 -0
  5. data/lib/active_merchant/billing/credit_card.rb +59 -46
  6. data/lib/active_merchant/billing/credit_card_methods.rb +3 -3
  7. data/lib/active_merchant/billing/gateway.rb +16 -9
  8. data/lib/active_merchant/billing/gateways/authorize_net.rb +19 -9
  9. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +134 -12
  10. data/lib/active_merchant/billing/gateways/barclays_epdq.rb +309 -0
  11. data/lib/active_merchant/billing/gateways/beanstream.rb +39 -2
  12. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +64 -26
  13. data/lib/active_merchant/billing/gateways/blue_pay.rb +11 -0
  14. data/lib/active_merchant/billing/gateways/bogus.rb +33 -3
  15. data/lib/active_merchant/billing/gateways/braintree.rb +11 -11
  16. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +9 -0
  17. data/lib/active_merchant/billing/gateways/braintree_blue.rb +293 -0
  18. data/lib/active_merchant/billing/gateways/braintree_orange.rb +17 -0
  19. data/lib/active_merchant/billing/gateways/cyber_source.rb +5 -1
  20. data/lib/active_merchant/billing/gateways/data_cash.rb +6 -2
  21. data/lib/active_merchant/billing/gateways/efsnet.rb +8 -2
  22. data/lib/active_merchant/billing/gateways/epay.rb +268 -0
  23. data/lib/active_merchant/billing/gateways/eway_managed.rb +231 -0
  24. data/lib/active_merchant/billing/gateways/federated_canada.rb +168 -0
  25. data/lib/active_merchant/billing/gateways/first_pay.rb +8 -3
  26. data/lib/active_merchant/billing/gateways/garanti.rb +132 -92
  27. data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +250 -0
  28. data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +13 -0
  29. data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +29 -0
  30. data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +55 -0
  31. data/lib/active_merchant/billing/gateways/inspire.rb +221 -0
  32. data/lib/active_merchant/billing/gateways/iridium.rb +258 -0
  33. data/lib/active_merchant/billing/gateways/jetpay.rb +12 -6
  34. data/lib/active_merchant/billing/gateways/linkpoint.rb +6 -1
  35. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +10 -8
  36. data/lib/active_merchant/billing/gateways/merchant_ware.rb +7 -1
  37. data/lib/active_merchant/billing/gateways/moneris.rb +6 -2
  38. data/lib/active_merchant/billing/gateways/netaxept.rb +239 -0
  39. data/lib/active_merchant/billing/gateways/nmi.rb +13 -0
  40. data/lib/active_merchant/billing/gateways/ogone.rb +16 -3
  41. data/lib/active_merchant/billing/gateways/orbital.rb +317 -0
  42. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +46 -0
  43. data/lib/active_merchant/billing/gateways/pay_junction.rb +9 -9
  44. data/lib/active_merchant/billing/gateways/paybox_direct.rb +207 -0
  45. data/lib/active_merchant/billing/gateways/payflow.rb +26 -9
  46. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +11 -11
  47. data/lib/active_merchant/billing/gateways/payflow_express.rb +122 -38
  48. data/lib/active_merchant/billing/gateways/payment_express.rb +7 -2
  49. data/lib/active_merchant/billing/gateways/paypal.rb +5 -5
  50. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +33 -8
  51. data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +26 -15
  52. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  53. data/lib/active_merchant/billing/gateways/paypal_express.rb +55 -13
  54. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +8 -3
  55. data/lib/active_merchant/billing/gateways/plugnpay.rb +9 -3
  56. data/lib/active_merchant/billing/gateways/psigate.rb +5 -0
  57. data/lib/active_merchant/billing/gateways/qbms.rb +295 -0
  58. data/lib/active_merchant/billing/gateways/quantum.rb +282 -0
  59. data/lib/active_merchant/billing/gateways/quickpay.rb +7 -2
  60. data/lib/active_merchant/billing/gateways/realex.rb +187 -76
  61. data/lib/active_merchant/billing/gateways/sage_pay.rb +16 -5
  62. data/lib/active_merchant/billing/gateways/secure_net.rb +330 -0
  63. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +39 -3
  64. data/lib/active_merchant/billing/gateways/smart_ps.rb +9 -3
  65. data/lib/active_merchant/billing/gateways/trust_commerce.rb +7 -2
  66. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/verifi.rb +6 -1
  68. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
  69. data/lib/active_merchant/billing/gateways/worldpay.rb +280 -0
  70. data/lib/active_merchant/billing/integrations.rb +0 -12
  71. data/lib/active_merchant/billing/integrations/action_view_helper.rb +13 -24
  72. data/lib/active_merchant/billing/integrations/bogus.rb +2 -2
  73. data/lib/active_merchant/billing/integrations/chronopay.rb +2 -2
  74. data/lib/active_merchant/billing/integrations/direc_pay.rb +41 -0
  75. data/lib/active_merchant/billing/integrations/direc_pay/helper.rb +200 -0
  76. data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +76 -0
  77. data/lib/active_merchant/billing/integrations/direc_pay/return.rb +32 -0
  78. data/lib/active_merchant/billing/integrations/direc_pay/status.rb +37 -0
  79. data/lib/active_merchant/billing/integrations/directebanking.rb +47 -0
  80. data/lib/active_merchant/billing/integrations/directebanking/helper.rb +90 -0
  81. data/lib/active_merchant/billing/integrations/directebanking/notification.rb +120 -0
  82. data/lib/active_merchant/billing/integrations/directebanking/return.rb +11 -0
  83. data/lib/active_merchant/billing/integrations/gestpay.rb +2 -2
  84. data/lib/active_merchant/billing/integrations/helper.rb +14 -11
  85. data/lib/active_merchant/billing/integrations/hi_trust.rb +2 -2
  86. data/lib/active_merchant/billing/integrations/ipay88.rb +4 -4
  87. data/lib/active_merchant/billing/integrations/moneybookers.rb +26 -0
  88. data/lib/active_merchant/billing/integrations/moneybookers/helper.rb +59 -0
  89. data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +129 -0
  90. data/lib/active_merchant/billing/integrations/nochex.rb +2 -2
  91. data/lib/active_merchant/billing/integrations/notification.rb +1 -1
  92. data/lib/active_merchant/billing/integrations/paypal.rb +2 -2
  93. data/lib/active_merchant/billing/integrations/quickpay.rb +6 -2
  94. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +1 -1
  95. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +2 -2
  96. data/lib/active_merchant/billing/integrations/return.rb +10 -3
  97. data/lib/active_merchant/billing/integrations/sage_pay_form.rb +37 -0
  98. data/lib/active_merchant/billing/integrations/sage_pay_form/encryption.rb +33 -0
  99. data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +111 -0
  100. data/lib/active_merchant/billing/integrations/sage_pay_form/notification.rb +210 -0
  101. data/lib/active_merchant/billing/integrations/sage_pay_form/return.rb +31 -0
  102. data/lib/active_merchant/billing/integrations/two_checkout.rb +2 -2
  103. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +5 -5
  104. data/lib/active_merchant/billing/integrations/valitor.rb +33 -0
  105. data/lib/active_merchant/billing/integrations/valitor/helper.rb +86 -0
  106. data/lib/active_merchant/billing/integrations/valitor/notification.rb +13 -0
  107. data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +88 -0
  108. data/lib/active_merchant/billing/integrations/valitor/return.rb +13 -0
  109. data/lib/active_merchant/billing/integrations/world_pay.rb +27 -0
  110. data/lib/active_merchant/billing/integrations/world_pay/helper.rb +100 -0
  111. data/lib/active_merchant/billing/integrations/world_pay/notification.rb +160 -0
  112. data/lib/active_merchant/common.rb +1 -1
  113. data/lib/active_merchant/common/connection.rb +13 -8
  114. data/lib/active_merchant/common/country.rb +15 -6
  115. data/lib/active_merchant/common/post_data.rb +1 -1
  116. data/lib/active_merchant/common/posts_data.rb +21 -5
  117. data/lib/active_merchant/common/utils.rb +4 -0
  118. data/lib/active_merchant/common/validateable.rb +20 -15
  119. data/lib/active_merchant/version.rb +3 -0
  120. data/lib/support/gateway_support.rb +1 -1
  121. metadata +65 -27
data/CHANGELOG CHANGED
@@ -1,5 +1,173 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.15.0 (May 12, 2011)
4
+ * DirecPay: Fix address to not include address2 twice in some cases [Soleone]
5
+ * DirecPay: Send company if available [Soleone]
6
+ * Realex: Fix hash signature [ntalbott/Soleone]
7
+ * SecurePay AU: Update remote tests [ntalbott]
8
+ * SecurePay AU: Fix method arity for #capture, #refund, #credit and #void [Soleone]
9
+ * Barclays ePDQ: Make response parsing more robust [Soleone]
10
+ * Payflow Express: Add line item support [wolframarnold]
11
+ * Payflow Express: Add comment field support [wolframarnold]
12
+ * Payflow: Add more optional fields [wolframarnold]
13
+ * Beanstream/Paypal: Fix CREDIT_DEPRECATION_MESSAGE errors [Jonathan Rudenberg]
14
+ * BraintreeBlue: Return a hash instead of a transaction object [braintreeps]
15
+ * BraintreeBlue: Return proper AVS/CVV values [braintreeps]
16
+ * Bogus: Add #recurring [trwomey]
17
+ * Make Validateable compatible with ActiveModel [CodeMonkeySteve]
18
+ * Add DirectEBanking offsite gateway [Gerwin Brunner/Soleone]
19
+ * ActiveSupport 3.1 beta support [cgriego]
20
+
21
+ == Version 1.14.0 (Apr 29, 2011)
22
+
23
+ * SagePayForm: Implement #cancelled? for Return. [wisq]
24
+ * Add #cancelled? to Integrations::Return [wisq]
25
+ * Bogus gateway: Add refund support and better tests [wisq]
26
+ * Beanstream: Add support for storing cards [duffomelia]
27
+ * eWay: Add support for storing cards [duffomelia]
28
+ * Add validation mode to update profile request [Ken Miller]
29
+ * Authorize.net CIM: Add oldLiveMode [ntalbott]
30
+ * Authorize.net CIM: Add extra transaction types [Ken Miller]
31
+ * JetPay: gateway tweaks [ntalbott]
32
+ * Deprecate a bunch more #credit methods [ntalbott]
33
+ * RealEx: Add authorize/capture/credit/void [ntalbott]
34
+ * SecurePay AU: Add authorize/capture/credit/void [ntalbott]
35
+ * PayPal Express: Make response parsing more robust [ntalbott]
36
+ * Test deprecation warnings; add deprecation line numbers [ntabott]
37
+ * Add Orbital direct gateway [ntalbott]
38
+ * Add WorldPay direct gateway [ntalbott]
39
+
40
+ == Version 1.13.0 (Apr 19, 2011)
41
+
42
+ * Add a Gemfile for optional bundler support [ssoroka]
43
+ * Stop using has_rdoc= when rubygems version is 1.7.0 or greater, since it's deprecated [ssoroka]
44
+ * Add tax field to braintree [wisq]
45
+ * Quickpay: Also add Sweden as supported country [Soleone]
46
+ * Adding refund method for gateways that are using the credit method for referenced based refunds, added deprecation worning to the credit method [John Duff]
47
+ * Return the Braintree transaction id in the response for void and refund transaction calls [John Duff]
48
+ * PayPal Express: Extract phone number from address if no contact phone was sent [Soleone]
49
+ * Unify all offsite gateways that verify the signature of Returns or Notifications by always using the #acknowledge method and calling the secret :credential2 [Soleone]
50
+ * Valitor: Change name of credential for Return and Notification from :password to :credential2 in symmetry with the other Integrations [Soleone]
51
+ * Moneybookers: Add support for tracking token [Soleone]
52
+ * Moneybookers: Require credential when creating Notifications instead of adding an argument to #acknowledge [Soleone]
53
+ * Moneybookers: Fix Notification to return correct status [Soleone]
54
+ * Support default Return class for all Integrations that don't use returns [Soleone]
55
+ * Add support for passing additional options when creating a Notification to all Integrations [Soleone]
56
+ * Update BraintreeBlue#refund to have consistent method signature [Jonathan Rudenberg]
57
+ * Add rails/init.rb for gem campatability in Rails [Rūdolfs Ošiņš]
58
+ * Fix Paypal Express response parser [Jonathan Rudenberg]
59
+ * Braintree/Transax: Add tax field [wisq]
60
+
61
+ == Version 1.12.1 (Mar 21, 2011)
62
+
63
+ * Ogone: Make sure response.params is a real Hash [Soleone]
64
+ * WorldPay: Fix service_url in production mode [Soleone]
65
+
66
+ == Version 1.12.0 (Mar 1, 2011)
67
+
68
+ * DirecPay: Send phone number as mobile phone by default [Soleone]
69
+ * Support sending line items for PayPal Express transactions [Jonathan Rudenberg]
70
+ * Update PayPal Express XML format to latest version [Jonathan Rudenberg]
71
+ * Fix custom image header for PayPal Express [mwagg]
72
+ * Add InvoiceID and OrderDescription to PayPal Express Authorize and Capture [cody]
73
+ * Add Moneybookers integration [Alex Diakov]
74
+ * Add QBMS (Quickbooks Merchant Services) gateway [ntalbott]
75
+ * Add NMI gateway [ntalbott]
76
+ * Make fully compatible with Rails 2 & 3, and Ruby 1.8 & 1.9 [ntalbott]
77
+ * Authorize.Net: Only return AVS message for AVS-related reason codes. [ntalbott]
78
+ * Add Federated Canada gateway [ntalbott]
79
+ * Garanti: Fix text normalization for nil values [Selem Delul]
80
+ * Valitor: Always send amount without any decimal places [Soleone]
81
+ * Add WorldPay integration [Soleone]
82
+
83
+ == Version 1.11.0 (Feb 11, 2011)
84
+
85
+ * Bump dependency for activesupport from 2.3.2 to 2.3.8 [Soleone]
86
+ * Garanti: Normalize text in xml fields for non-standard characters [Selem Delul]
87
+ * Garanti: Make sure order number does not contain illegal characters [Soleone]
88
+ * Fix ActionView tests for ActiveSupport 3.0.4 [Soleone]
89
+ * DirecPay: Make address information editable by default [Soleone]
90
+ * Fix ePDQ credit to expect and handle full authorization [Nathaniel Talbott]
91
+ * Add Barclays ePDQ Gateway [Nathaniel Talbott]
92
+ * Add default fixture for Garanti and don't use fixture for Garanti [cody]
93
+ * Add cms param for ePay [ePay]
94
+ * Add Valitor Integration [Nathaniel Talbott]
95
+
96
+ == Version 1.10.0 (Jan 20, 2011)
97
+
98
+ * PayPal Express: Support returning payer phone number [Soleone]
99
+ * Fix ePay to correctly send order number [Soleone]
100
+ * Add BluePay Gateway [Nathaniel Talbott]
101
+ * Add Quantum Gateway [Joshua Lippiner]
102
+ * Add iDEAL/Rabobank gateway [Jonathan Rudenberg]
103
+ * SagePayForm: Added send_email_confirmation (default false) to enable confirmation emails [wisq]
104
+
105
+ == Version 1.9.4 (Jan 5, 2011)
106
+
107
+ * Update Garanti gateway to integrate with new API [Selem Delul]
108
+
109
+ == Version 1.9.3 (December 17, 2010)
110
+
111
+ * Fix BBS Netaxept to change transaction type from C (for MOTO: mail order telephone order) to M (for credit card orders) [Soleone]
112
+ * Fix Iridium and ePay to work with any object that responds to credit card methods not only ActiveMerchant::CreditCard objects
113
+
114
+ == Version 1.9.2 (December 9, 2010)
115
+
116
+ * Add support for PayPal mobile payments [wisq]
117
+ * Add ePay gateway [ePay, Jonathan Rudenberg]
118
+ * Allow access to the raw HTTP response [Jonathan Rudenberg]
119
+
120
+ == Version 1.9.1 (November 24, 2010)
121
+
122
+ * PayPal Express and PayPal Pro: Send JPY currency correctly without decimals [Soleone]
123
+ * Netaxept: Make sure password (token) is URL escaped and update remote tests for updated server behavior [Soleone]
124
+ * DirecPay: Add support for additional options in Return class and add convenience method to get transaction status update [Soleone]
125
+ * Add new alias credit_card.brand for credit_card.type and handle the brand correctly in Netaxept [Soleone]
126
+ * Iridium: Do not depend on ExpiryDate class for credit_card [Soleone]
127
+ * PayFlow: Use same timeout of 60 seconds in HTTP header and XML for all requests [Soleone]
128
+ * PayPal Website Payments Pro CA no longer supports American Express cards [Soleone]
129
+ * Updated BIN ranges for Discover to match recent documents [kaunartist]
130
+
131
+ == Version 1.9.0 (October 14, 2010)
132
+
133
+ * Add support for DirecPay gateway [Soleone]
134
+ * Add SagePay Form integration gateway [wisq]
135
+ * Allow Return class to include a Notification for gateways that treat the direct response as a notification [wisq]
136
+ * Add support for PayboxDirect gateway [Donald Piret]
137
+ * Add support for SecureNet gateway [Kal]
138
+ * Add support for the Inspire gateway [ryan r. smith]
139
+
140
+ == Version 1.8.0 (September 24, 2010)
141
+
142
+ * PayPal Express: Add support for billing agreements [Nathaniel Talbott]
143
+ * Allow comparing countries [Nathaniel Talbott]
144
+ * Iridium: Fix country handling [Nathaniel Talbott]
145
+ * Iridium: Fix missing billing address [Nathaniel Talbott]
146
+ * Iridium: Do not pass CV2 if not present [Nathaniel Talbott]
147
+ * Add Iridium support [Phil Smy]
148
+ * Add Netaxept support [Nathaniel Talbott]
149
+ * PaymentExpress: Use Card Holder Help Text for the response message [Nathaniel Talbott]
150
+ * Sort the country name list [Duff OMelia]
151
+
152
+ == Version 1.7.3 (September 14, 2010)
153
+
154
+ * Fix SagePay special handling for Japanese YEN currency to not send fractional amounts [Soleone]
155
+
156
+ == Version 1.7.2 (August 27, 2010)
157
+
158
+ * Update Braintree integration to play nicely with the braintree 2.5.0 gem [Soleone]
159
+ * Fix SagePay to not send fractional amounts for Japanese YEN currency [Soleone]
160
+
161
+ == Version 1.7.1 (July 28, 2010)
162
+
163
+ * Pull in only the necessary components of Active Support. Enables use of ActiveMerchant with Rails 3 [railsjedi]
164
+
165
+ == Version 1.7.0 (July 9, 2010)
166
+
167
+ * Add support for new Braintree Blue Gateway (using the braintree gem) [Braintree]
168
+
169
+ == Version 1.6.0 (July 6, 2010)
170
+
3
171
  * Add a task rake gateways:hosts to get a list of all outbound hosts and ports [cody]
4
172
  * Fix test failure in chronopay helper in Ruby 1.9.1 [cody]
5
173
  * Fix timezone issue in credit card test. [cody]
data/CONTRIBUTORS CHANGED
@@ -26,6 +26,7 @@ Linkpoint Gateway
26
26
  eWay Gateway
27
27
 
28
28
  * Originally contributed by Lucas Carlson (mailto:lucas@rufy.com)
29
+ * Managed Payments support by Jason Stirk with improvements by Keith Pitt
29
30
 
30
31
  CardStream Gateway
31
32
 
@@ -83,6 +84,7 @@ PaypalNVGateway (Apr 12, 2008)
83
84
  Beanstream (May 13, 2008)
84
85
 
85
86
  * Created by xiaobozz ( xiaobozzz at gmail dot com )
87
+ * Secure Profiles support by Forrest Zeisler (http://github.com/forrest)
86
88
 
87
89
  Sage (June, 2008)
88
90
 
@@ -109,6 +111,10 @@ Instapay Gateway (May 3, 2009)
109
111
 
110
112
  * Thomas Rideout
111
113
 
114
+ Iridium Gateway (June 13, 2009)
115
+
116
+ * Phil Smy
117
+
112
118
  MerchantWARE (July 7, 2009)
113
119
 
114
120
  * Cody Fauser
@@ -133,6 +139,95 @@ SallieMae (October 2, 2009)
133
139
 
134
140
  * iamjwc
135
141
 
142
+ Netaxept (February 08, 2010)
143
+
144
+ * Nathaniel Talbott
145
+
136
146
  Garanti (May 05, 2010)
137
147
 
138
- * Selem Delul (moon@mac.home)
148
+ * Selem Delul (moon@mac.home)
149
+
150
+ Braintree Blue Gateway (May 19th, 2010)
151
+
152
+ * Braintree (code@getbraintree.com)
153
+
154
+ Inspire Gateway (September 27, 2010)
155
+
156
+ * ryan r. smith
157
+
158
+ SecureNet Gateway (September 27, 2010)
159
+
160
+ * Kal
161
+
162
+ PayboxDirect Gateway (September 27, 2010)
163
+
164
+ * Donald Piret <donald@donaldpiret.com>
165
+
166
+ SagePay Form Offsite Gateway (October 14, 2010)
167
+
168
+ * Adrian Irving-Beer
169
+
170
+ DirecPay Gateway (October 14, 2010)
171
+
172
+ * Soleone
173
+
174
+ ePay Gateway (November 23, 2010)
175
+
176
+ * Original code by ePay (epay.dk)
177
+ * Refactored by Jonathan Rudenberg
178
+
179
+ iDEAL/Rabobank Gateway (January 10, 2011)
180
+
181
+ * Original code by Soemirno Kartosoewito
182
+ * Refactored by Cody Fauser
183
+ * Refactored and updated by Jonathan Rudenberg
184
+
185
+ Quantum Gateway
186
+
187
+ * Joshua Lippiner
188
+ * Refactored by Nathaniel Talbott
189
+
190
+ BluePay Gateway
191
+
192
+ * Mel Sleight
193
+ * Refactored by Nathaniel Talbott
194
+
195
+ Valitor Integration (January 2011)
196
+
197
+ * Nathaniel Talbott
198
+ * Sponsored by Sævar Öfjörð Magnússon
199
+
200
+ Barclays ePDQ
201
+
202
+ * Original code by Rob W (rfwatson)
203
+ * Refactored by Nathaniel Talbott
204
+
205
+ Federated Canada
206
+
207
+ * Bob Larrick (deathbob)
208
+
209
+ NMI
210
+
211
+ * Nathaniel Talbott (ntalbott)
212
+
213
+ QBMS
214
+
215
+ * Will Glozer (wg)
216
+
217
+ WorldPay Integration (Feb 17, 2011)
218
+
219
+ * Original code by Unknown from this patch: https://jadedpixel.lighthouseapp.com/projects/11599/tickets/3-patch-integration-support-for-worldpay-uk
220
+ * Refactored by Soleone
221
+
222
+ WorldPay Gateway
223
+
224
+ * Original code by Amit kumar (ask4amit@gmail.com)
225
+ * Refactored by Nathaniel Talbott (ntalbott)
226
+
227
+ Orbital Paymentech Gateway (July, 2009)
228
+
229
+ * Sam Vincent - http://ecommerce.versapay.com
230
+
231
+ DIRECTebanking - Payment Network AG (May, 2011)
232
+
233
+ * Gerwin Brunner (Vilango)
data/README.rdoc CHANGED
@@ -13,21 +13,38 @@ The {ActiveMerchant Wiki}[http://github.com/Shopify/active_merchant/wikis] conta
13
13
 
14
14
  * {Authorize.Net CIM}[http://www.authorize.net/] - US
15
15
  * {Authorize.Net}[http://www.authorize.net/] - US
16
+ * {Barclays ePDQ}[http://www.barclaycard.co.uk/business/accepting-payments/epdq-mpi/] - UK
16
17
  * {Beanstream.com}[http://www.beanstream.com/] - CA
18
+ * {BluePay}[http://www.bluepay.com/] - US
17
19
  * {Braintree}[http://www.braintreepaymentsolutions.com] - US
18
20
  * {CardStream}[http://www.cardstream.com/] - GB
19
21
  * {CyberSource}[http://www.cybersource.com] - US
20
22
  * {DataCash}[http://www.datacash.com/] - GB
21
23
  * {Efsnet}[http://www.concordefsnet.com/] - US
24
+ * {Elavon MyVirtualMerchant}[http://www.elavon.com] - US, CA
25
+ * {ePay}[http://www.epay.dk/] - DK
22
26
  * {eWAY}[http://www.eway.com.au/] - AU
23
27
  * {E-xact}[http://www.e-xact.com] - CA, US
28
+ * {Federated Canada}[http://www.federatedcanada.com/] - CA
29
+ * {FirstPay}[http://www.first-pay.com] - US
30
+ * {Garanti Sanal POS}[https://ccpos.garanti.com.tr/ccRaporlar/garanti/ccReports] - US, TR
31
+ * {Inspire}[http://www.inspiregateway.com] - US
32
+ * {InstaPay}[http://www.instapayllc.com] - US
33
+ * {Iridium}[http://www.iridiumcorp.co.uk/] - UK, ES
34
+ * {JetPay}[http://www.jetpay.com] - US
24
35
  * {LinkPoint}[http://www.linkpoint.com/] - US
25
36
  * {Merchant e-Solutions}[http://merchante-solutions.com/] - US
37
+ * {MerchantWare}[http://merchantwarehouse.com/merchantware] - US
26
38
  * {Modern Payments}[http://www.modpay.com] - US
27
39
  * {Moneris}[http://www.moneris.com/] - CA
40
+ * {Netaxept}[http://www.betalingsterminal.no/Netthandel-forside] - NO, DK, SE, FI
28
41
  * {NetRegistry}[http://www.netregistry.com.au] - AU
29
42
  * {NELiX TransaX Gateway}[http://www.nelixtransax.com] - US
30
43
  * {NETbilling}[http://www.netbilling.com] - US
44
+ * {NMI}[http://nmi.com/] - US
45
+ * {Ogone DirectLink}[http://www.ogone.com] - BE, DE, FR, NL, AT, CH
46
+ * {Orbital Paymentech}[http://chasepaymentech.com/] - CA, US
47
+ * {PayBox Direct}[http://www.paybox.com] - FR
31
48
  * {PayJunction}[http://www.payjunction.com/] - US
32
49
  * {PaySecure}[http://www.commsecure.com.au/paysecure.shtml] - AU
33
50
  * {PayPal Express Checkout}[https://www.paypal.com/cgi-bin/webscr?cmd=xpt/merchant/ExpressCheckoutIntro-outside] - US, CA, SG, AU
@@ -41,10 +58,14 @@ The {ActiveMerchant Wiki}[http://github.com/Shopify/active_merchant/wikis] conta
41
58
  * {Protx}[http://www.protx.com] - GB
42
59
  * {Psigate}[http://www.psigate.com/] - CA
43
60
  * {PSL Payment Solutions}[http://www.paymentsolutionsltd.com/] - GB
44
- * {Quickpay}[http://quickpay.dk/] - DK
61
+ * {Quantum}[http://www.quantumgateway.com] - US
62
+ * {QuickBooks Merchant Services}[http://payments.intuit.com/] - US
63
+ * {Quickpay}[http://quickpay.dk/] - DK, SE
64
+ * {Rabobank Nederland}[http://www.rabobank.nl/] - NL
45
65
  * {Realex}[http://www.realexpayments.com/] - IE, GB
46
66
  * {Sage Payment Solutions}[http://www.sagepayments.com] - US, CA
47
67
  * {Sallie Mae}[http://www.salliemae.com] - US
68
+ * {SecureNet}[http://www.securenet.com] - US
48
69
  * {SecurePay}[http://securepay.com.au] - AU
49
70
  * {SecurePay}[http://www.securepay.com/] - US
50
71
  * {SecurePayTech}[http://www.securepaytech.com/] - NZ
@@ -55,15 +76,22 @@ The {ActiveMerchant Wiki}[http://github.com/Shopify/active_merchant/wikis] conta
55
76
  * {Verifi}[http://www.verifi.com/] - US
56
77
  * {ViaKLIX}[http://viaklix.com] - US
57
78
  * {Wirecard}[http://www.wirecard.com] - DE
79
+ * {WorldPay}[http://www.worldpay.com] - AU, HK, GB, US
58
80
 
59
81
  == Supported Offsite Payment Gateways
60
82
 
61
- * {PayPal Website Payments Standard}[https://www.paypal.com/cgi-bin/webscr?cmd=_wp-standard-overview-outside]
62
- * Chronopay[http://www.chronopay.com]
63
- * Nochex[http://www.nochex.com]
64
- * {Banca Sella GestPay}[https://www.sella.it/banca/ecommerce/gestpay/gestpay.jsp]
65
83
  * {2 Checkout}[http://www.2checkout.com]
84
+ * {Banca Sella GestPay}[https://www.sella.it/banca/ecommerce/gestpay/gestpay.jsp]
85
+ * {Chronopay}[http://www.chronopay.com]
86
+ * {Direct-eBanking / sofortueberweisung.de by Payment-Networks AG}[https://www.payment-network.com/deb_com_en/merchantarea/home] - DE, AT, CH, BE, UK, NL
87
+ * {DirecPay}[http://www.timesofmoney.com/direcpay/jsp/home.jsp]
66
88
  * {HiTRUST}[http://www.hitrust.com.hk/]
89
+ * {Moneybookers}[http://www.moneybookers.com]
90
+ * {Nochex}[http://www.nochex.com]
91
+ * {PayPal Website Payments Standard}[https://www.paypal.com/cgi-bin/webscr?cmd=_wp-standard-overview-outside]
92
+ * {SagePay Form}[http://www.sagepay.com/products_services/sage_pay_go/integration/form]
93
+ * {Valitor}[http://www.valitor.is/] - IS
94
+ * {WorldPay}[http://www.worldpay.com]
67
95
 
68
96
  == Download
69
97
 
@@ -24,12 +24,24 @@
24
24
  $:.unshift File.dirname(__FILE__)
25
25
 
26
26
  require 'active_support'
27
+ require 'active_support/core_ext/string/inflections'
28
+ require 'active_support/core_ext/hash/indifferent_access'
29
+ require 'active_support/core_ext/hash/conversions'
30
+ require 'active_support/core_ext/class/attribute'
31
+ require 'active_support/core_ext/class/attribute_accessors'
32
+ require 'active_support/core_ext/class/delegating_attributes'
33
+ require 'active_support/core_ext/module/attribute_accessors'
34
+ require 'active_support/core_ext/kernel/requires'
35
+ require 'active_support/base64'
36
+ require 'active_support/secure_random'
37
+
27
38
  require 'builder'
28
39
  require 'cgi'
29
40
  require 'rexml/document'
30
41
 
31
42
  require 'active_merchant/common'
32
43
  require 'active_merchant/billing'
44
+ require 'active_merchant/version'
33
45
 
34
46
  module ActiveMerchant #:nodoc:
35
47
  module Billing #:nodoc:
@@ -7,52 +7,54 @@ module ActiveMerchant #:nodoc:
7
7
  # == Description
8
8
  # This credit card object can be used as a stand alone object. It acts just like an ActiveRecord object
9
9
  # but doesn't support the .save method as its not backed by a database.
10
- #
11
- # For testing purposes, use the 'bogus' credit card type. This card skips the vast majority of
12
- # validations. This allows you to focus on your core concerns until you're ready to be more concerned
10
+ #
11
+ # For testing purposes, use the 'bogus' credit card type. This card skips the vast majority of
12
+ # validations. This allows you to focus on your core concerns until you're ready to be more concerned
13
13
  # with the details of particular creditcards or your gateway.
14
- #
14
+ #
15
15
  # == Testing With CreditCard
16
- # Often when testing we don't care about the particulars of a given card type. When using the 'test'
17
- # mode in your Gateway, there are six different valid card numbers: 1, 2, 3, 'success', 'fail',
16
+ # Often when testing we don't care about the particulars of a given card type. When using the 'test'
17
+ # mode in your Gateway, there are six different valid card numbers: 1, 2, 3, 'success', 'fail',
18
18
  # and 'error'.
19
- #
19
+ #
20
20
  #--
21
21
  # For details, see CreditCardMethods#valid_number?
22
22
  #++
23
- #
23
+ #
24
24
  # == Example Usage
25
25
  # cc = CreditCard.new(
26
- # :first_name => 'Steve',
27
- # :last_name => 'Smith',
28
- # :month => '9',
29
- # :year => '2010',
30
- # :type => 'visa',
26
+ # :first_name => 'Steve',
27
+ # :last_name => 'Smith',
28
+ # :month => '9',
29
+ # :year => '2010',
30
+ # :type => 'visa',
31
31
  # :number => '4242424242424242'
32
32
  # )
33
- #
33
+ #
34
34
  # cc.valid? # => true
35
35
  # cc.display_number # => XXXX-XXXX-XXXX-4242
36
36
  #
37
37
  class CreditCard
38
38
  include CreditCardMethods
39
39
  include Validateable
40
-
40
+
41
41
  ## Attributes
42
-
42
+
43
43
  cattr_accessor :require_verification_value
44
44
  self.require_verification_value = true
45
-
45
+
46
46
  # Essential attributes for a valid, non-bogus creditcards
47
47
  attr_accessor :number, :month, :year, :type, :first_name, :last_name
48
-
48
+
49
49
  # Required for Switch / Solo cards
50
50
  attr_accessor :start_month, :start_year, :issue_number
51
51
 
52
- # Optional verification_value (CVV, CVV2 etc). Gateways will try their best to
52
+ # Optional verification_value (CVV, CVV2 etc). Gateways will try their best to
53
53
  # run validation on the passed in value if it is supplied
54
54
  attr_accessor :verification_value
55
55
 
56
+ alias_method :brand, :type
57
+
56
58
  # Provides proxy access to an expiry date object
57
59
  def expiry_date
58
60
  ExpiryDate.new(@month, @year)
@@ -61,23 +63,23 @@ module ActiveMerchant #:nodoc:
61
63
  def expired?
62
64
  expiry_date.expired?
63
65
  end
64
-
66
+
65
67
  def name?
66
- first_name? && last_name?
68
+ first_name? || last_name?
67
69
  end
68
-
70
+
69
71
  def first_name?
70
- !@first_name.blank?
72
+ @first_name.present?
71
73
  end
72
-
74
+
73
75
  def last_name?
74
- !@last_name.blank?
76
+ @last_name.present?
75
77
  end
76
-
78
+
77
79
  def name
78
- "#{@first_name} #{@last_name}"
80
+ [@first_name, @last_name].compact.join(' ')
79
81
  end
80
-
82
+
81
83
  def verification_value?
82
84
  !@verification_value.blank?
83
85
  end
@@ -86,11 +88,11 @@ module ActiveMerchant #:nodoc:
86
88
  def display_number
87
89
  self.class.mask(number)
88
90
  end
89
-
91
+
90
92
  def last_digits
91
93
  self.class.last_digits(number)
92
94
  end
93
-
95
+
94
96
  def validate
95
97
  validate_essential_attributes
96
98
 
@@ -102,14 +104,14 @@ module ActiveMerchant #:nodoc:
102
104
  validate_verification_value
103
105
  validate_switch_or_solo_attributes
104
106
  end
105
-
107
+
106
108
  def self.requires_verification_value?
107
109
  require_verification_value
108
110
  end
109
-
111
+
110
112
  private
111
-
112
- def before_validate #:nodoc:
113
+
114
+ def before_validate #:nodoc:
113
115
  self.month = month.to_i
114
116
  self.year = year.to_i
115
117
  self.start_month = start_month.to_i unless start_month.nil?
@@ -118,27 +120,38 @@ module ActiveMerchant #:nodoc:
118
120
  self.type.downcase! if type.respond_to?(:downcase)
119
121
  self.type = self.class.type?(number) if type.blank?
120
122
  end
121
-
123
+
122
124
  def validate_card_number #:nodoc:
123
- errors.add :number, "is not a valid credit card number" unless CreditCard.valid_number?(number)
125
+ if number.blank?
126
+ errors.add :number, "is required"
127
+ elsif !CreditCard.valid_number?(number)
128
+ errors.add :number, "is not a valid credit card number"
129
+ end
130
+
124
131
  unless errors.on(:number) || errors.on(:type)
125
132
  errors.add :type, "is not the correct card type" unless CreditCard.matching_type?(number, type)
126
133
  end
127
134
  end
128
-
135
+
129
136
  def validate_card_type #:nodoc:
130
- errors.add :type, "is required" if type.blank?
131
- errors.add :type, "is invalid" unless CreditCard.card_companies.keys.include?(type)
137
+ errors.add :type, "is required" if type.blank? && number.present?
138
+ errors.add :type, "is invalid" unless type.blank? || CreditCard.card_companies.keys.include?(type)
132
139
  end
133
-
140
+
134
141
  def validate_essential_attributes #:nodoc:
135
142
  errors.add :first_name, "cannot be empty" if @first_name.blank?
136
143
  errors.add :last_name, "cannot be empty" if @last_name.blank?
137
- errors.add :month, "is not a valid month" unless valid_month?(@month)
138
- errors.add :year, "expired" if expired?
139
- errors.add :year, "is not a valid year" unless valid_expiry_year?(@year)
144
+
145
+ if @month.to_i.zero? || @year.to_i.zero?
146
+ errors.add :month, "is required" if @month.to_i.zero?
147
+ errors.add :year, "is required" if @year.to_i.zero?
148
+ else
149
+ errors.add :month, "is not a valid month" unless valid_month?(@month)
150
+ errors.add :year, "expired" if expired?
151
+ errors.add :year, "is not a valid year" unless valid_expiry_year?(@year)
152
+ end
140
153
  end
141
-
154
+
142
155
  def validate_switch_or_solo_attributes #:nodoc:
143
156
  if %w[switch solo].include?(type)
144
157
  unless valid_month?(@start_month) && valid_start_year?(@start_year) || valid_issue_number?(@issue_number)
@@ -148,10 +161,10 @@ module ActiveMerchant #:nodoc:
148
161
  end
149
162
  end
150
163
  end
151
-
164
+
152
165
  def validate_verification_value #:nodoc:
153
166
  if CreditCard.requires_verification_value?
154
- errors.add :verification_value, "is required" unless verification_value?
167
+ errors.add :verification_value, "is required" unless verification_value?
155
168
  end
156
169
  end
157
170
  end