activemerchant 1.38.1 → 1.39.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 (77) hide show
  1. data/CHANGELOG +23 -0
  2. data/CONTRIBUTORS +8 -0
  3. data/README.md +65 -59
  4. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +6 -2
  5. data/lib/active_merchant/billing/gateways/be2bill.rb +131 -0
  6. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +1 -1
  7. data/lib/active_merchant/billing/gateways/blue_pay.rb +0 -3
  8. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +2 -2
  9. data/lib/active_merchant/billing/gateways/braintree_blue.rb +70 -67
  10. data/lib/active_merchant/billing/gateways/cyber_source.rb +2 -4
  11. data/lib/active_merchant/billing/gateways/eway_rapid.rb +75 -2
  12. data/lib/active_merchant/billing/gateways/moneris.rb +62 -10
  13. data/lib/active_merchant/billing/gateways/money_movers.rb +160 -0
  14. data/lib/active_merchant/billing/gateways/ogone.rb +21 -8
  15. data/lib/active_merchant/billing/gateways/orbital/avs_result.rb +6 -6
  16. data/lib/active_merchant/billing/gateways/payflow_uk.rb +2 -2
  17. data/lib/active_merchant/billing/gateways/paymill.rb +12 -2
  18. data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
  19. data/lib/active_merchant/billing/gateways/quickpay.rb +32 -2
  20. data/lib/active_merchant/billing/gateways/realex.rb +11 -7
  21. data/lib/active_merchant/billing/gateways/sage_pay.rb +1 -1
  22. data/lib/active_merchant/billing/gateways/secure_net.rb +7 -10
  23. data/lib/active_merchant/billing/gateways/spreedly_core.rb +9 -2
  24. data/lib/active_merchant/billing/gateways/stripe.rb +1 -1
  25. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +4 -2
  26. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/worldpay.rb +2 -2
  28. data/lib/active_merchant/billing/integrations/a1agregator/notification.rb +1 -1
  29. data/lib/active_merchant/billing/integrations/action_view_helper.rb +2 -1
  30. data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +41 -0
  31. data/lib/active_merchant/billing/integrations/bit_pay/notification.rb +56 -0
  32. data/lib/active_merchant/billing/integrations/bit_pay.rb +18 -0
  33. data/lib/active_merchant/billing/integrations/chronopay/notification.rb +1 -1
  34. data/lib/active_merchant/billing/integrations/citrus/helper.rb +40 -0
  35. data/lib/active_merchant/billing/integrations/citrus/notification.rb +133 -0
  36. data/lib/active_merchant/billing/integrations/citrus/return.rb +40 -0
  37. data/lib/active_merchant/billing/integrations/citrus.rb +51 -0
  38. data/lib/active_merchant/billing/integrations/direc_pay/notification.rb +1 -1
  39. data/lib/active_merchant/billing/integrations/directebanking/notification.rb +1 -1
  40. data/lib/active_merchant/billing/integrations/dotpay/notification.rb +1 -1
  41. data/lib/active_merchant/billing/integrations/dwolla/notification.rb +1 -1
  42. data/lib/active_merchant/billing/integrations/e_payment_plans/notification.rb +1 -1
  43. data/lib/active_merchant/billing/integrations/easy_pay/notification.rb +1 -1
  44. data/lib/active_merchant/billing/integrations/gestpay/notification.rb +1 -1
  45. data/lib/active_merchant/billing/integrations/helper.rb +1 -1
  46. data/lib/active_merchant/billing/integrations/liqpay/notification.rb +1 -1
  47. data/lib/active_merchant/billing/integrations/liqpay/return.rb +1 -1
  48. data/lib/active_merchant/billing/integrations/maksuturva/notification.rb +1 -1
  49. data/lib/active_merchant/billing/integrations/moneybookers/notification.rb +1 -1
  50. data/lib/active_merchant/billing/integrations/nochex/notification.rb +1 -1
  51. data/lib/active_merchant/billing/integrations/paxum/notification.rb +1 -1
  52. data/lib/active_merchant/billing/integrations/pay_fast/notification.rb +1 -1
  53. data/lib/active_merchant/billing/integrations/payflow_link/notification.rb +1 -1
  54. data/lib/active_merchant/billing/integrations/paypal/notification.rb +1 -1
  55. data/lib/active_merchant/billing/integrations/paysbuy/notification.rb +13 -2
  56. data/lib/active_merchant/billing/integrations/payu_in/notification.rb +1 -1
  57. data/lib/active_merchant/billing/integrations/payu_in_paisa/helper.rb +19 -0
  58. data/lib/active_merchant/billing/integrations/payu_in_paisa/notification.rb +23 -0
  59. data/lib/active_merchant/billing/integrations/payu_in_paisa/return.rb +16 -0
  60. data/lib/active_merchant/billing/integrations/payu_in_paisa.rb +30 -0
  61. data/lib/active_merchant/billing/integrations/platron/notification.rb +1 -1
  62. data/lib/active_merchant/billing/integrations/pxpay/notification.rb +1 -1
  63. data/lib/active_merchant/billing/integrations/quickpay/helper.rb +28 -6
  64. data/lib/active_merchant/billing/integrations/quickpay/notification.rb +1 -1
  65. data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +1 -1
  66. data/lib/active_merchant/billing/integrations/robokassa/notification.rb +1 -1
  67. data/lib/active_merchant/billing/integrations/two_checkout/notification.rb +1 -1
  68. data/lib/active_merchant/billing/integrations/valitor/response_fields.rb +1 -1
  69. data/lib/active_merchant/billing/integrations/verkkomaksut/notification.rb +1 -1
  70. data/lib/active_merchant/billing/integrations/web_pay/notification.rb +1 -1
  71. data/lib/active_merchant/billing/integrations/webmoney/notification.rb +1 -1
  72. data/lib/active_merchant/billing/integrations/world_pay/notification.rb +1 -1
  73. data/lib/active_merchant/version.rb +1 -1
  74. data/lib/support/gateway_support.rb +16 -10
  75. data.tar.gz.sig +0 -0
  76. metadata +23 -3
  77. metadata.gz.sig +2 -2
data/CHANGELOG CHANGED
@@ -1,5 +1,28 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ * Moneris: Add optional (off by default) verification_value support [duff]
4
+ * Citrus: New Integration [viatechs, melari]
5
+ * Payu Paisa: New Integration [melari]
6
+ * Spreedly: Pass country with other address fields [hoenth]
7
+ * SecureNet: Fix order of xml params [duff]
8
+ * Paymill: Add support for void [duff]
9
+ * Add MoneyMovers gateway [jeffutter]
10
+ * Ogone: Add a :store_amount option [rymai]
11
+ * Ogone: Require TLSv1 [ntalbott]
12
+ * Moneris: Add support for purchasecorrection [pgib]
13
+ * Spreedly: Add ability to retain on success [duff]
14
+ * Spreedly: Pass verification value [duff]
15
+ * Paymill: Add support for specifying the :customer [Sbastien]
16
+ * Realex: Correct AVS input format [ExxKA]
17
+ * USAEpay Transaction: Use sandbox when in test mode [radar]
18
+ * Braintree Blue: Do not use global config [rdj]
19
+ * eWay Rapid: Add response messages [BenZhang]
20
+ * Paysbuy: Add 'Pending' notification status [divineforest]
21
+ * Cybersource: Use standard :phone field [cade]
22
+ * Orbital: Fix/tweak AVS codes [boone]
23
+ * Quickpay: Add v7 support [larspind]
24
+ * Authorize.Net CIM: Add option to not mark transactions as test [alanandrade]
25
+
3
26
  == Version 1.38.1 (September 16, 2013)
4
27
 
5
28
  * Moneris: Remove verification_value support [melari]
data/CONTRIBUTORS CHANGED
@@ -412,3 +412,11 @@ MerchantWare V4 (July 2013)
412
412
  Platron integration (July 2013)
413
413
 
414
414
  * Alexey Kiryushin (alexwl)
415
+
416
+ MoneyMovers (September 2013)
417
+
418
+ * Jeffery Utter (jeffutter)
419
+
420
+ Be2Bill (September 2013)
421
+
422
+ * Michaël Hoste (MichaelHoste)
data/README.md CHANGED
@@ -81,102 +81,108 @@ For more in-depth documentation and tutorials, see [GettingStarted.md](GettingSt
81
81
 
82
82
  The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) contains a [table of features supported by each gateway](http://github.com/Shopify/active_merchant/wikis/gatewayfeaturematrix).
83
83
 
84
- * [Authorize.Net](http://www.authorize.net/) - US
85
84
  * [Authorize.Net CIM](http://www.authorize.net/) - US
85
+ * [Authorize.Net](http://www.authorize.net/) - US, CA, GB
86
86
  * [Balanced](https://www.balancedpayments.com/) - US
87
- * [Banwire](https://www.banwire.com/) - MX
88
- * [Barclays ePDQ MPI](http://www.barclaycard.co.uk/business/accepting-payments/epdq-mpi/) - UK
89
- * [Barclays ePDQ Extra Plus](http://www.barclaycard.co.uk/business/accepting-payments/epdq-ecomm/) - UK
90
- * [Beanstream.com](http://www.beanstream.com/) - CA
87
+ * [Banwire](http://www.banwire.com/) - MX
88
+ * [Barclays ePDQ Extra Plus](http://www.barclaycard.co.uk/business/accepting-payments/epdq-ecomm/) - GB
89
+ * [Barclays ePDQ MPI](http://www.barclaycard.co.uk/business/accepting-payments/epdq-mpi/) - GB
90
+ * [Be2Bill](http://www.be2bill.com/) - FR
91
+ * [Beanstream.com](http://www.beanstream.com/) - CA, US
91
92
  * [BluePay](http://www.bluepay.com/) - US
92
- * [Braintree](http://www.braintreepaymentsolutions.com) - US
93
- * [CardStream](http://www.cardstream.com/) - UK
94
- * [CertoDirect](http://www.certodirect.com/) - BE, BG, CZ, DK, DE, EE, IE, EL, ES, FR, IT, CY, LV, LT, LU, HU, MT, NL, AT, PL, PT, RO, SI, SK, FI, SE, UK
95
- * [CyberSource](http://www.cybersource.com) - US
96
- * [DataCash](http://www.datacash.com/) - UK
93
+ * [Braintree](http://www.braintreepaymentsolutions.com) - US, CA, AU, AD, AT, BE, BG, CY, CZ, DK, EE, FI, FR, GI, DE, GR, HU, IS, IM, IE, IT, LV, LI, LT, LU, MT, MC, NL, NO, PL, PT, RO, SM, SK, SI, ES, SE, CH, TR, GB
94
+ * [CardSave](http://www.cardsave.net/) - GB
95
+ * [CardStream](http://www.cardstream.com/) - GB
96
+ * [CertoDirect](http://www.certodirect.com/) - BE, BG, CZ, DK, DE, EE, IE, EL, ES, FR, IT, CY, LV, LT, LU, HU, MT, NL, AT, PL, PT, RO, SI, SK, FI, SE, GB
97
+ * [CyberSource](http://www.cybersource.com) - US, BR, CA, CN, DK, FI, FR, DE, JP, MX, NO, SE, GB, SG
98
+ * [DataCash](http://www.datacash.com/) - GB
97
99
  * [Efsnet](http://www.concordefsnet.com/) - US
98
- * [Elavon MyVirtualMerchant](http://www.elavon.com) - US, CA
99
- * [ePay](http://www.epay.dk/) - DK, SE, NO
100
+ * [Elavon MyVirtualMerchant](http://www.elavon.com/) - US, CA
101
+ * [ePay](http://epay.dk/) - DK, SE, NO
100
102
  * [EVO Canada](http://www.evocanada.com/) - CA
101
- * [eWAY](http://www.eway.com.au/) - AU
102
- * [eWay Rapid 3.0](http://www.eway.com.au/) - AU
103
+ * [eWAY](http://www.eway.com.au/) - AU, NZ, GB
104
+ * [eWAY Rapid 3.0](http://www.eway.com.au/) - AU
103
105
  * [E-xact](http://www.e-xact.com) - CA, US
104
- * [Fat Zebra](https://www.fatzebra.com.au) - AU
106
+ * [Fat Zebra](https://www.fatzebra.com.au/) - AU
105
107
  * [Federated Canada](http://www.federatedcanada.com/) - CA
106
108
  * [Finansbank WebPOS](https://www.fbwebpos.com/) - US, TR
109
+ * [First Pay](http://www.first-pay.com) - US
107
110
  * [FirstData Global Gateway e4](http://www.firstdata.com) - CA, US
108
- * [FirstPay](http://www.first-pay.com) - US
109
- * [Garanti Sanal POS](https://ccpos.garanti.com.tr/ccRaporlar/garanti/ccReports) - US, TR
111
+ * [Garanti Sanal POS](https://sanalposweb.garanti.com.tr) - US, TR
110
112
  * [HDFC](http://www.hdfcbank.com/sme/sme-details/merchant-services/guzh6m0i) - IN
111
- * [Inspire](http://www.inspiregateway.com) - US
113
+ * [IATSPayments](http://www.iatspayments.com/) - US, CA, GB
114
+ * [Inspire Commerce](http://www.inspiregateway.com) - US
112
115
  * [InstaPay](http://www.instapayllc.com) - US
113
- * [Iridium](http://www.iridiumcorp.co.uk/) - UK, ES
116
+ * [Iridium](http://www.iridiumcorp.co.uk/) - GB, ES
114
117
  * [iTransact](http://www.itransact.com/) - US
115
- * [JetPay](http://www.jetpay.com) - US
118
+ * [JetPay](http://www.jetpay.com/) - US
116
119
  * [LinkPoint](http://www.linkpoint.com/) - US
117
- * [Litle](http://www.litle.com/) - US
118
- * [Merchant e-Solutions](http://merchante-solutions.com/) - US
119
- * [MerchantWare](http://merchantwarehouse.com/merchantware) - US
120
- * [Merchant Warrior] (http://merchantwarrior.com) - AU
120
+ * [Litle & Co.](http://www.litle.com/) - US
121
+ * [Merchant e-Solutions](http://www.merchante-solutions.com/) - US
122
+ * [Merchant One Gateway](http://merchantone.com/) - US
123
+ * [MerchantWARE](http://merchantwarehouse.com/merchantware) - US
124
+ * [MerchantWarrior](http://www.merchantwarrior.com/) - AU
121
125
  * [Mercury](http://www.mercurypay.com) - US
126
+ * [Metrics Global](http://www.metricsglobal.com) - US
122
127
  * [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
123
128
  * [Modern Payments](http://www.modpay.com) - US
124
129
  * [Moneris](http://www.moneris.com/) - CA
125
- * [Moneris US](http://www.monerisusa.com/) - US
126
- * [NABTransact](http://www.nab.com.au/nabtransact/) - AU
127
- * [NELiX TransaX Gateway](http://www.nelixtransax.com) - US
128
- * [Netaxept](http://www.betalingsterminal.no/Netthandel-forside) - NO, DK, SE, FI
129
- * [NETbilling](http://www.netbilling.com) - US
130
- * [NetPay](http://www.netpay.com.mx) - MX
130
+ * [Moneris (US)](http://www.monerisusa.com/) - US
131
+ * [MoneyMovers](http://mmoa.us/) - US
132
+ * [NAB Transact](http://transact.nab.com.au) - AU
131
133
  * [NetRegistry](http://www.netregistry.com.au) - AU
134
+ * [BBS Netaxept](http://www.betalingsterminal.no/Netthandel-forside/) - NO, DK, SE, FI
135
+ * [NETbilling](http://www.netbilling.com) - US
136
+ * [NETPAY Gateway](http://www.netpay.com.mx) - MX
132
137
  * [NMI](http://nmi.com/) - US
133
- * [Ogone DirectLink](http://www.ogone.com) - BE, DE, FR, NL, AT, CH
134
- * [Optimal Payments](http://www.optimalpayments.com/) - CA, US, UK
135
- * [Orbital Paymentech](http://chasepaymentech.com/) - CA, US, UK, GB
136
- * [PayBox Direct](http://www.paybox.com) - FR
137
- * [PayFast](https://www.payfast.co.za/) - ZA
138
+ * [Ogone](http://www.ogone.com/) - BE, DE, FR, NL, AT, CH
139
+ * [Optimal Payments](http://www.optimalpayments.com/) - CA, US, GB
140
+ * [Orbital Paymentech](http://chasepaymentech.com/) - US, CA
138
141
  * [PayGate PayXML](http://paygate.co.za/) - US, ZA
139
142
  * [PayJunction](http://www.payjunction.com/) - US
140
- * [PaymentExpress](http://www.paymentexpress.com/) - AU, MY, NZ, SG, ZA, UK, US
141
- * [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
142
- * [PayPal Express Checkout](https://www.paypal.com/cgi-bin/webscr?cmd=xpt/merchant/ExpressCheckoutIntro-outside) - US, CA, SG, AU
143
- * [PayPal Payflow Pro](https://www.paypal.com/cgi-bin/webscr?cmd=_payflow-pro-overview-outside) - US, CA, SG, AU
144
- * [PayPal Website Payments Pro (UK)](https://www.paypal.com/uk/cgi-bin/webscr?cmd=_wp-pro-overview-outside) - UK
145
- * [PayPal Website Payments Pro (CA)](https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside) - CA
146
- * [PayPal Express Checkout](https://www.paypal.com/cgi-bin/webscr?cmd=xpt/merchant/ExpressCheckoutIntro-outside) - US
147
- * [PayPal Website Payments Pro (US)](https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside) - US
148
143
  * [PaySecure](http://www.commsecure.com.au/paysecure.shtml) - AU
149
- * [PayWay](https://www.payway.com.au) - AU
144
+ * [Paybox Direct](http://www.paybox.com/) - FR
145
+ * [PaymentExpress](http://www.paymentexpress.com/) - AU, CA, DE, ES, FR, GB, HK, IE, MY, NL, NZ, SG, US, ZA
146
+ * [PAYMILL](https://paymill.com) - AD, AT, BE, BG, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GB, GI, GR, HU, IE, IL, IS, IT, LI, LT, LU, LV, MT, NL, NO, PL, PT, RO, SE, SI, SK, TR, VA
147
+ * [PayPal Express Checkout](https://www.paypal.com/webapps/mpp/express-checkout) - US, CA, SG, AU
148
+ * [PayPal Express Checkout (UK)](https://www.paypal.com/uk/webapps/mpp/express-checkout) - GB
149
+ * [PayPal Payflow Pro](https://www.paypal.com/webapps/mpp/payflow-payment-gateway) - US, CA, SG, AU
150
+ * [PayPal Payments Pro (US)](https://www.paypal.com/us/webapps/mpp/paypal-payments-pro) - US
151
+ * [PayPal Payments Pro (UK)](https://www.paypal.com/uk/webapps/mpp/pro) - GB
152
+ * [PayPal Website Payments Pro (CA)](https://www.paypal.com/cgi-bin/webscr?cmd=_wp-pro-overview-outside) - CA
153
+ * [PayPal Express Checkout for Digital Goods](https://www.x.com/community/ppx/xspaces/digital_goods) - AU, CA, CN, FI, GB, ID, IN, IT, MY, NO, NZ, PH, PL, SE, SG, TH, VN
154
+ * [Paystation](http://paystation.co.nz) - NZ
155
+ * [Pay Way](http://www.payway.com.au) - AU
150
156
  * [Pin](http://www.pin.net.au/) - AU
151
157
  * [Plug'n Pay](http://www.plugnpay.com/) - US
152
158
  * [Psigate](http://www.psigate.com/) - CA
153
- * [PSL Payment Solutions](http://www.paymentsolutionsltd.com/) - UK
154
- * [Quantum](http://www.quantumgateway.com) - US
159
+ * [PSL Payment Solutions](http://www.paymentsolutionsltd.com/) - GB
155
160
  * [QuickBooks Merchant Services](http://payments.intuit.com/) - US
161
+ * [Quantum Gateway](http://www.quantumgateway.com) - US
156
162
  * [Quickpay](http://quickpay.dk/) - DK, SE
157
- * [Rabobank Nederland](http://www.rabobank.nl/) - NL
158
- * [Realex](http://www.realexpayments.com/) - IE, UK
159
- * [Redsys](http://www.redsys.es) - ES
160
- * [SagePay](http://www.sagepay.com) - UK
163
+ * [Realex](http://www.realexpayments.com/) - IE, GB, FR, BE, NL, LU, IT
164
+ * [Redsys](http://www.redsys.es/) - ES
165
+ * [SagePay](http://www.sagepay.com) - GB, IE
161
166
  * [Sage Payment Solutions](http://www.sagepayments.com) - US, CA
162
- * [Sallie Mae](http://www.salliemae.com) - US
163
- * [SecureNet](http://www.securenet.com) - US
164
- * [SecurePay](http://securepay.com.au) - AU
165
- * [SecurePay](http://www.securepay.com/) - US
167
+ * [Sallie Mae](http://www.salliemae.com/) - US
168
+ * [Samurai](https://samurai.feefighters.com) - US
169
+ * [SecureNet](http://www.securenet.com/) - US
170
+ * [SecurePay](http://www.securepay.com/) - US, CA, GB, AU
166
171
  * [SecurePayTech](http://www.securepaytech.com/) - NZ
167
172
  * [SkipJack](http://www.skipjack.com/) - US, CA
168
- * [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
169
- * [Stripe](https://stripe.com/) - US, CA, GB
173
+ * [Spreedly](https://spreedly.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
174
+ * [Stripe](https://stripe.com/) - US, CA, GB, AU, IE, FR, NL, BE, DE, ES
170
175
  * [TransFirst](http://www.transfirst.com/) - US
176
+ * [NELiX TransaX](https://www.nelixtransax.com/) - US
171
177
  * [Transnational](http://www.tnbci.com/) - US
172
178
  * [TrustCommerce](http://www.trustcommerce.com/) - US
173
179
  * [USA ePay](http://www.usaepay.com/) - US
174
180
  * [Verifi](http://www.verifi.com/) - US
175
181
  * [ViaKLIX](http://viaklix.com) - US
176
- * [Vindica](http://www.vindicia.com/) - US, CA, UK, AU, MX, BR, DE, KR, CN, HK
182
+ * [Vindicia](http://www.vindicia.com/) - US, CA, GB, AU, MX, BR, DE, KR, CN, HK
177
183
  * [WebPay](https://webpay.jp/) - JP
178
- * [Wirecard](http://www.wirecard.com) - DE
179
- * [WorldPay](http://www.worldpay.com) - AU, HK, UK, US
184
+ * [Wirecard](http://www.wirecard.com) - AD, CY, GI, IM, MT, RO, CH, AT, DK, GR, IT, MC, SM, TR, BE, EE, HU, LV, NL, SK, GB, BG, FI, IS, LI, NO, SI, VA, FR, IL, LT, PL, ES, CZ, DE, IE, LU, PT, SE
185
+ * [WorldPay](http://www.worldpay.com/) - HK, US, GB, AU, AD, BE, CH, CY, CZ, DE, DK, ES, FI, FR, GI, GR, HU, IE, IL, IT, LI, LU, MC, MT, NL, NO, NZ, PL, PT, SE, SG, SI, SM, TR, UM, VA
180
186
 
181
187
  ## Supported Offsite Payment Gateways
182
188
 
@@ -94,10 +94,14 @@ module ActiveMerchant #:nodoc:
94
94
  # * <tt>:password</tt> -- The Authorize.Net Transaction Key. (REQUIRED)
95
95
  # * <tt>:test</tt> -- +true+ or +false+. If true, perform transactions against the test server.
96
96
  # Otherwise, perform transactions against the production server.
97
+ # * <tt>:test_requests</tt> -- +true+ or +false+. If true, perform transactions without the
98
+ # test flag. This is useful when you need to generate card declines, AVS or CVV erros.
99
+ # Will hold the same value as :test by default.
97
100
  # * <tt>:delimiter</tt> -- The delimiter used in the direct response. Default is ',' (comma).
98
101
  def initialize(options = {})
99
102
  requires!(options, :login, :password)
100
103
  super
104
+ @options[:test_requests] = test? if @options[:test_requests].nil?
101
105
  end
102
106
 
103
107
  # Creates a new customer profile along with any customer payment profiles and customer shipping addresses
@@ -605,7 +609,7 @@ module ActiveMerchant #:nodoc:
605
609
 
606
610
  def build_create_customer_profile_transaction_request(xml, options)
607
611
  options[:extra_options] ||= {}
608
- options[:extra_options].merge!('x_test_request' => 'TRUE') if @options[:test]
612
+ options[:extra_options].merge!('x_test_request' => 'TRUE') if @options[:test_requests]
609
613
 
610
614
  add_transaction(xml, options[:transaction])
611
615
  tag_unless_blank(xml, 'extraOptions', format_extra_options(options[:extra_options]))
@@ -842,7 +846,7 @@ module ActiveMerchant #:nodoc:
842
846
  response_params = parse(action, xml)
843
847
 
844
848
  message = response_params['messages']['message']['text']
845
- test_mode = test? || message =~ /Test Mode/
849
+ test_mode = @options[:test_requests] || message =~ /Test Mode/
846
850
  success = response_params['messages']['result_code'] == 'Ok'
847
851
  response_params['direct_response'] = parse_direct_response(response_params['direct_response']) if response_params['direct_response']
848
852
  transaction_id = response_params['direct_response']['transaction_id'] if response_params['direct_response']
@@ -0,0 +1,131 @@
1
+ require "digest/sha2"
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ class Be2billGateway < Gateway
6
+ self.test_url = 'https://secure-test.be2bill.com/front/service/rest/process.php'
7
+ self.live_url = 'https://secure-magenta1.be2bill.com/front/service/rest/process.php'
8
+
9
+ self.display_name = 'Be2Bill'
10
+ self.homepage_url = 'http://www.be2bill.com/'
11
+ self.supported_countries = ['FR']
12
+ self.supported_cardtypes = [:visa, :master, :american_express]
13
+ self.default_currency = 'EUR'
14
+ self.money_format = :cents
15
+
16
+ # These options are mandatory on be2bill (cf. tests) :
17
+ #
18
+ # options = { :order_id => order.id,
19
+ # :customer_id => user.id,
20
+ # :description => "Some description",
21
+ # :referrer => request.env['HTTP_REFERER'],
22
+ # :user_agent => request.env['HTTP_USER_AGENT'],
23
+ # :ip => request.remote_ip,
24
+ # :email => user.email }
25
+
26
+ def initialize(options = {})
27
+ requires!(options, :login, :password)
28
+ super
29
+ end
30
+
31
+ def authorize(money, creditcard, options = {})
32
+ post = {}
33
+ add_invoice(post, options)
34
+ add_creditcard(post, creditcard)
35
+ add_customer_data(post, options)
36
+
37
+ commit('authorization', money, post)
38
+ end
39
+
40
+ def purchase(money, creditcard, options = {})
41
+ post = {}
42
+ add_invoice(post, options)
43
+ add_creditcard(post, creditcard)
44
+ add_customer_data(post, options)
45
+
46
+ commit('payment', money, post)
47
+ end
48
+
49
+ def capture(money, authorization, options = {})
50
+ post = {}
51
+ add_invoice(post, options)
52
+ post[:TRANSACTIONID] = authorization
53
+
54
+ commit('capture', money, post)
55
+ end
56
+
57
+ private
58
+
59
+ def add_customer_data(post, options)
60
+ post[:CLIENTREFERRER] = options[:referrer]
61
+ post[:CLIENTUSERAGENT] = options[:user_agent]
62
+ post[:CLIENTIP] = options[:ip]
63
+ post[:CLIENTEMAIL] = options[:email]
64
+ post[:CLIENTIDENT] = options[:customer_id]
65
+ end
66
+
67
+ def add_invoice(post, options)
68
+ post[:ORDERID] = options[:order_id]
69
+ post[:DESCRIPTION] = options[:description]
70
+ end
71
+
72
+ def add_creditcard(post, creditcard)
73
+ post[:CARDFULLNAME] = creditcard ? creditcard.name : ''
74
+ post[:CARDCODE] = creditcard ? creditcard.number : ''
75
+ post[:CARDVALIDITYDATE] = creditcard ? "%02d-%02s" % [creditcard.month, creditcard.year.to_s[-2..-1]] : ''
76
+ post[:CARDCVV] = creditcard ? creditcard.verification_value : ''
77
+ end
78
+
79
+ def parse(response)
80
+ ActiveSupport::JSON.decode(response)
81
+ end
82
+
83
+ def commit(action, money, parameters)
84
+ parameters[:IDENTIFIER] = @options[:login]
85
+ parameters[:AMOUNT] = amount(money)
86
+ parameters[:VERSION] = '2.0'
87
+
88
+ url = (test? ? self.test_url : self.live_url)
89
+ response = parse(ssl_post(url, post_data(action, parameters)))
90
+
91
+ Response.new(
92
+ successful?(response),
93
+ message_from(response),
94
+ response,
95
+ :authorization => response['TRANSACTIONID'],
96
+ :test => test?
97
+ )
98
+ end
99
+
100
+ def successful?(response)
101
+ %w(0000 0001).include?(response['EXECCODE'])
102
+ end
103
+
104
+ def message_from(response)
105
+ if successful?(response)
106
+ "Approved : #{response['MESSAGE']}"
107
+ else
108
+ "Declined (#{response['EXECCODE']} - #{response['MESSAGE']}"
109
+ end
110
+ end
111
+
112
+ def post_data(action, parameters = {})
113
+ {
114
+ :method => action,
115
+ :params => parameters.merge(HASH: signature(parameters, action))
116
+ }.to_query
117
+ end
118
+
119
+ def signature(parameters, action)
120
+ parameters[:OPERATIONTYPE] = action unless parameters[:OPERATIONTYPE]
121
+
122
+ signature = @options[:password]
123
+ parameters.sort.each do |key, value|
124
+ signature += ("#{key.upcase}=#{value}" + @options[:password])
125
+ end
126
+
127
+ Digest::SHA256.hexdigest(signature)
128
+ end
129
+ end
130
+ end
131
+ end
@@ -63,7 +63,7 @@ module ActiveMerchant #:nodoc:
63
63
  base.default_currency = 'CAD'
64
64
 
65
65
  # The countries the gateway supports merchants from as 2 digit ISO country codes
66
- base.supported_countries = ['CA']
66
+ base.supported_countries = ['CA', 'US']
67
67
 
68
68
  # The card types supported by the payment gateway
69
69
  base.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
@@ -14,8 +14,6 @@ module ActiveMerchant #:nodoc:
14
14
  AVS_ERRORS = %w( A E N R W Z )
15
15
  AVS_REASON_CODES = %w(27 45)
16
16
 
17
- FRAUD_REVIEW_STATUSES = %w( E 0 )
18
-
19
17
  FIELD_MAP = {
20
18
  'TRANS_ID' => :transaction_id,
21
19
  'STATUS' => :response_code,
@@ -344,7 +342,6 @@ module ActiveMerchant #:nodoc:
344
342
  Response.new(success, message, parsed,
345
343
  :test => test?,
346
344
  :authorization => (parsed[:rebid] && parsed[:rebid] != '' ? parsed[:rebid] : parsed[:transaction_id]),
347
- :fraud_review => FRAUD_REVIEW_STATUSES.include?(parsed[:response_code]),
348
345
  :avs_result => { :code => parsed[:avs_result_code] },
349
346
  :cvv_result => parsed[:card_code]
350
347
  )
@@ -1,9 +1,9 @@
1
1
  module BraintreeCommon
2
2
  def self.included(base)
3
- base.supported_countries = ['US']
3
+ base.supported_countries = %w(US CA AU AD AT BE BG CY CZ DK EE FI FR GI DE GR HU IS IM IE IT LV LI LT LU MT MC NL NO PL PT RO SM SK SI ES SE CH TR GB)
4
4
  base.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
5
5
  base.homepage_url = 'http://www.braintreepaymentsolutions.com'
6
6
  base.display_name = 'Braintree'
7
7
  base.default_currency = 'USD'
8
8
  end
9
- end
9
+ end
@@ -23,33 +23,18 @@ module ActiveMerchant #:nodoc:
23
23
  # Setting an ActiveMerchant +wiredump_device+ will automatically
24
24
  # configure the Braintree logger (via the Braintree gem's
25
25
  # configuration) when the BraintreeBlueGateway is instantiated.
26
- # Additionally, the log level will be set to +DEBUG+. Therefore,
27
- # all you have to do is set the +wiredump_device+ and you'll
28
- # get your debug output from your HTTP interactions with the
29
- # remote gateway. (Don't enable this in production.)
26
+ # Additionally, the log level will be set to +DEBUG+. Therefore,
27
+ # all you have to do is set the +wiredump_device+ and you'll get
28
+ # your debug output from your HTTP interactions with the remote
29
+ # gateway. (Don't enable this in production.) The ActiveMerchant
30
+ # implementation doesn't mess with the Braintree::Configuration
31
+ # globals at all, so there won't be any side effects outside
32
+ # Active Merchant.
30
33
  #
31
- # For example:
34
+ # If no +wiredump_device+ is set, the logger in
35
+ # +Braintree::Configuration.logger+ will be cloned and the log
36
+ # level set to +WARN+.
32
37
  #
33
- # ActiveMerchant::Billing::BraintreeBlueGateway.wiredump_device = Logger.new(STDOUT)
34
- # # => #<Logger:0x107d385f8 ...>
35
- #
36
- # Braintree::Configuration.logger
37
- # # => (some other logger, created by default by the gem)
38
- #
39
- # Braintree::Configuration.logger.level
40
- # # => 1 (INFO)
41
- #
42
- # ActiveMerchant::Billing::BraintreeBlueGateway.new(:merchant_id => 'x', :public_key => 'x', :private_key => 'x')
43
- #
44
- # Braintree::Configuration.logger
45
- # # => #<Logger:0x107d385f8 ...>
46
- #
47
- # Braintree::Configuration.logger.level
48
- # # => 0 (DEBUG)
49
- #
50
- # Alternatively, you can avoid setting the +wiredump_device+
51
- # and set +Braintree::Configuration.logger+ and/or
52
- # +Braintree::Configuration.logger.level+ directly.
53
38
  class BraintreeBlueGateway < Gateway
54
39
  include BraintreeCommon
55
40
 
@@ -61,18 +46,24 @@ module ActiveMerchant #:nodoc:
61
46
 
62
47
  super
63
48
 
64
- Braintree::Configuration.merchant_id = options[:merchant_id]
65
- Braintree::Configuration.public_key = options[:public_key]
66
- Braintree::Configuration.private_key = options[:private_key]
67
- Braintree::Configuration.environment = (options[:environment] || (test? ? :sandbox : :production)).to_sym
68
- Braintree::Configuration.custom_user_agent = "ActiveMerchant #{ActiveMerchant::VERSION}"
69
-
70
49
  if wiredump_device
71
- Braintree::Configuration.logger = ((Logger === wiredump_device) ? wiredump_device : Logger.new(wiredump_device))
72
- Braintree::Configuration.logger.level = Logger::DEBUG
50
+ logger = ((Logger === wiredump_device) ? wiredump_device : Logger.new(wiredump_device))
51
+ logger.level = Logger::DEBUG
73
52
  else
74
- Braintree::Configuration.logger.level = Logger::WARN
53
+ logger = Braintree::Configuration.logger.clone
54
+ logger.level = Logger::WARN
75
55
  end
56
+
57
+ @configuration = Braintree::Configuration.new(
58
+ :merchant_id => options[:merchant_id],
59
+ :public_key => options[:public_key],
60
+ :private_key => options[:private_key],
61
+ :environment => (options[:environment] || (test? ? :sandbox : :production)).to_sym,
62
+ :custom_user_agent => "ActiveMerchant #{ActiveMerchant::VERSION}",
63
+ :logger => logger,
64
+ )
65
+
66
+ @braintree_gateway = Braintree::Gateway.new( @configuration )
76
67
  end
77
68
 
78
69
  def authorize(money, credit_card_or_vault_id, options = {})
@@ -81,7 +72,7 @@ module ActiveMerchant #:nodoc:
81
72
 
82
73
  def capture(money, authorization, options = {})
83
74
  commit do
84
- result = Braintree::Transaction.submit_for_settlement(authorization, amount(money).to_s)
75
+ result = @braintree_gateway.transaction.submit_for_settlement(authorization, amount(money).to_s)
85
76
  Response.new(result.success?, message_from_result(result))
86
77
  end
87
78
  end
@@ -101,7 +92,7 @@ module ActiveMerchant #:nodoc:
101
92
  money = amount(money).to_s if money
102
93
 
103
94
  commit do
104
- result = Braintree::Transaction.refund(transaction_id, money)
95
+ result = @braintree_gateway.transaction.refund(transaction_id, money)
105
96
  Response.new(result.success?, message_from_result(result),
106
97
  {:braintree_transaction => (transaction_hash(result.transaction) if result.success?)},
107
98
  {:authorization => (result.transaction.id if result.success?)}
@@ -111,7 +102,7 @@ module ActiveMerchant #:nodoc:
111
102
 
112
103
  def void(authorization, options = {})
113
104
  commit do
114
- result = Braintree::Transaction.void(authorization)
105
+ result = @braintree_gateway.transaction.void(authorization)
115
106
  Response.new(result.success?, message_from_result(result),
116
107
  {:braintree_transaction => (transaction_hash(result.transaction) if result.success?)},
117
108
  {:authorization => (result.transaction.id if result.success?)}
@@ -132,7 +123,7 @@ module ActiveMerchant #:nodoc:
132
123
  :expiration_year => creditcard.year.to_s
133
124
  }
134
125
  }
135
- result = Braintree::Customer.create(merge_credit_card_options(parameters, options))
126
+ result = @braintree_gateway.customer.create(merge_credit_card_options(parameters, options))
136
127
  Response.new(result.success?, message_from_result(result),
137
128
  {
138
129
  :braintree_customer => (customer_hash(result.customer) if result.success?),
@@ -146,7 +137,7 @@ module ActiveMerchant #:nodoc:
146
137
  def update(vault_id, creditcard, options = {})
147
138
  braintree_credit_card = nil
148
139
  commit do
149
- braintree_credit_card = Braintree::Customer.find(vault_id).credit_cards.detect { |cc| cc.default? }
140
+ braintree_credit_card = @braintree_gateway.customer.find(vault_id).credit_cards.detect { |cc| cc.default? }
150
141
  return Response.new(false, 'Braintree::NotFoundError') if braintree_credit_card.nil?
151
142
 
152
143
  options.merge!(:update_existing_token => braintree_credit_card.token)
@@ -159,14 +150,14 @@ module ActiveMerchant #:nodoc:
159
150
  }
160
151
  }, options)[:credit_card]
161
152
 
162
- result = Braintree::Customer.update(vault_id,
153
+ result = @braintree_gateway.customer.update(vault_id,
163
154
  :first_name => creditcard.first_name,
164
155
  :last_name => creditcard.last_name,
165
156
  :email => options[:email],
166
157
  :credit_card => credit_card_params
167
158
  )
168
159
  Response.new(result.success?, message_from_result(result),
169
- :braintree_customer => (customer_hash(Braintree::Customer.find(vault_id)) if result.success?),
160
+ :braintree_customer => (customer_hash(@braintree_gateway.customer.find(vault_id)) if result.success?),
170
161
  :customer_vault_id => (result.customer.id if result.success?)
171
162
  )
172
163
  end
@@ -174,7 +165,7 @@ module ActiveMerchant #:nodoc:
174
165
 
175
166
  def unstore(customer_vault_id, options = {})
176
167
  commit do
177
- Braintree::Customer.delete(customer_vault_id)
168
+ @braintree_gateway.customer.delete(customer_vault_id)
178
169
  Response.new(true, "OK")
179
170
  end
180
171
  end
@@ -232,33 +223,46 @@ module ActiveMerchant #:nodoc:
232
223
  end
233
224
  end
234
225
 
226
+ def response_params(result)
227
+ params = {}
228
+ if result.success?
229
+ params[:braintree_transaction] = transaction_hash(result.transaction)
230
+ params[:customer_vault_id] = result.transaction.customer_details.id
231
+ end
232
+ params
233
+ end
234
+
235
+ def response_options(result)
236
+ options = {}
237
+ if result.success?
238
+ options[:authorization] = result.transaction.id
239
+ end
240
+ if result.transaction
241
+ options[:avs_result] = {
242
+ :code => nil, :message => nil,
243
+ :street_match => result.transaction.avs_street_address_response_code,
244
+ :postal_match => result.transaction.avs_postal_code_response_code
245
+ }
246
+ options[:cvv_result] = result.transaction.cvv_response_code
247
+ end
248
+ options
249
+ end
250
+
251
+ def message_from_transaction_result(result)
252
+ if result.transaction && result.transaction.status == "gateway_rejected"
253
+ "Transaction declined - gateway rejected"
254
+ elsif result.transaction
255
+ "#{result.transaction.processor_response_code} #{result.transaction.processor_response_text}"
256
+ else
257
+ message_from_result(result)
258
+ end
259
+ end
260
+
235
261
  def create_transaction(transaction_type, money, credit_card_or_vault_id, options)
236
262
  transaction_params = create_transaction_parameters(money, credit_card_or_vault_id, options)
237
-
238
263
  commit do
239
- result = Braintree::Transaction.send(transaction_type, transaction_params)
240
- response_params, response_options, avs_result, cvv_result = {}, {}, {}, {}
241
- if result.success?
242
- response_params[:braintree_transaction] = transaction_hash(result.transaction)
243
- response_params[:customer_vault_id] = result.transaction.customer_details.id
244
- response_options[:authorization] = result.transaction.id
245
- end
246
- if result.transaction
247
- response_options[:avs_result] = {
248
- :code => nil, :message => nil,
249
- :street_match => result.transaction.avs_street_address_response_code,
250
- :postal_match => result.transaction.avs_postal_code_response_code
251
- }
252
- response_options[:cvv_result] = result.transaction.cvv_response_code
253
- if result.transaction.status == "gateway_rejected"
254
- message = "Transaction declined - gateway rejected"
255
- else
256
- message = "#{result.transaction.processor_response_code} #{result.transaction.processor_response_text}"
257
- end
258
- else
259
- message = message_from_result(result)
260
- end
261
- response = Response.new(result.success?, message, response_params, response_options)
264
+ result = @braintree_gateway.transaction.send(transaction_type, transaction_params)
265
+ response = Response.new(result.success?, message_from_transaction_result(result), response_params(result), response_options(result))
262
266
  response.cvv_result['message'] = ''
263
267
  response
264
268
  end
@@ -398,4 +402,3 @@ module ActiveMerchant #:nodoc:
398
402
  end
399
403
  end
400
404
  end
401
-