activemerchant 1.29.1 → 1.34.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.
- data/CHANGELOG +143 -0
- data/CONTRIBUTORS +43 -0
- data/README.md +59 -51
- data/lib/active_merchant/billing/check.rb +15 -14
- data/lib/active_merchant/billing/credit_card.rb +14 -5
- data/lib/active_merchant/billing/credit_card_formatting.rb +8 -8
- data/lib/active_merchant/billing/gateway.rb +2 -2
- data/lib/active_merchant/billing/gateways/authorize_net.rb +36 -8
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +17 -5
- data/lib/active_merchant/billing/gateways/balanced.rb +9 -3
- data/lib/active_merchant/billing/gateways/banwire.rb +15 -1
- data/lib/active_merchant/billing/gateways/barclays_epdq.rb +8 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +7 -2
- data/lib/active_merchant/billing/gateways/beanstream.rb +26 -24
- data/lib/active_merchant/billing/gateways/blue_pay.rb +201 -187
- data/lib/active_merchant/billing/gateways/bogus.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +7 -3
- data/lib/active_merchant/billing/gateways/card_stream_modern.rb +155 -0
- data/lib/active_merchant/billing/gateways/cc5.rb +156 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +55 -22
- data/lib/active_merchant/billing/gateways/data_cash.rb +3 -3
- data/lib/active_merchant/billing/gateways/evo_ca.rb +308 -0
- data/lib/active_merchant/billing/gateways/eway.rb +114 -171
- data/lib/active_merchant/billing/gateways/eway_managed.rb +52 -22
- data/lib/active_merchant/billing/gateways/finansbank.rb +22 -0
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +314 -0
- data/lib/active_merchant/billing/gateways/garanti.rb +0 -4
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +13 -2
- data/lib/active_merchant/billing/gateways/iridium.rb +8 -2
- data/lib/active_merchant/billing/gateways/litle.rb +354 -105
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +28 -7
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +44 -9
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +190 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +4 -6
- data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +20 -3
- data/lib/active_merchant/billing/gateways/net_registry.rb +8 -3
- data/lib/active_merchant/billing/gateways/netaxept.rb +65 -117
- data/lib/active_merchant/billing/gateways/netbilling.rb +1 -0
- data/lib/active_merchant/billing/gateways/netpay.rb +223 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +7 -5
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +43 -18
- data/lib/active_merchant/billing/gateways/orbital.rb +190 -53
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +12 -10
- data/lib/active_merchant/billing/gateways/payment_express.rb +62 -1
- data/lib/active_merchant/billing/gateways/paymill.rb +179 -0
- data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +12 -7
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +14 -9
- data/lib/active_merchant/billing/gateways/paypal_express.rb +59 -18
- data/lib/active_merchant/billing/gateways/pin.rb +165 -0
- data/lib/active_merchant/billing/gateways/qbms.rb +3 -2
- data/lib/active_merchant/billing/gateways/quickpay.rb +66 -28
- data/lib/active_merchant/billing/gateways/sage/sage_bankcard.rb +16 -11
- data/lib/active_merchant/billing/gateways/sage/sage_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/sage/sage_virtual_check.rb +21 -16
- data/lib/active_merchant/billing/gateways/sage.rb +10 -5
- data/lib/active_merchant/billing/gateways/sage_pay.rb +7 -0
- data/lib/active_merchant/billing/gateways/smart_ps.rb +1 -1
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +233 -0
- data/lib/active_merchant/billing/gateways/stripe.rb +49 -21
- data/lib/active_merchant/billing/gateways/transnational.rb +239 -0
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +9 -4
- data/lib/active_merchant/billing/gateways/webpay.rb +8 -0
- data/lib/active_merchant/billing/gateways/wirecard.rb +15 -9
- data/lib/active_merchant/billing/gateways/worldpay.rb +60 -24
- data/lib/active_merchant/billing/integrations/direc_pay/status.rb +1 -1
- data/lib/active_merchant/billing/integrations/direc_pay.rb +1 -1
- data/lib/active_merchant/billing/integrations/dwolla/common.rb +23 -0
- data/lib/active_merchant/billing/integrations/dwolla/helper.rb +18 -6
- data/lib/active_merchant/billing/integrations/dwolla/notification.rb +16 -7
- data/lib/active_merchant/billing/integrations/dwolla/return.rb +16 -5
- data/lib/active_merchant/billing/integrations/dwolla.rb +5 -12
- data/lib/active_merchant/billing/integrations/notification.rb +13 -8
- data/lib/active_merchant/billing/integrations/payflow_link/helper.rb +19 -3
- data/lib/active_merchant/billing/integrations/paypal/notification.rb +39 -31
- data/lib/active_merchant/billing/integrations/payu_in/helper.rb +74 -0
- data/lib/active_merchant/billing/integrations/payu_in/notification.rb +167 -0
- data/lib/active_merchant/billing/integrations/payu_in/return.rb +53 -0
- data/lib/active_merchant/billing/integrations/payu_in.rb +43 -0
- data/lib/active_merchant/billing/integrations/pxpay/helper.rb +1 -0
- data/lib/active_merchant/billing/integrations/quickpay/helper.rb +13 -10
- data/lib/active_merchant/billing/integrations/quickpay/notification.rb +78 -15
- data/lib/active_merchant/billing/integrations/rbkmoney/helper.rb +23 -0
- data/lib/active_merchant/billing/integrations/rbkmoney/notification.rb +91 -0
- data/lib/active_merchant/billing/integrations/rbkmoney.rb +17 -0
- data/lib/active_merchant/billing/integrations/robokassa/common.rb +1 -1
- data/lib/active_merchant/billing/integrations/sage_pay_form/helper.rb +7 -3
- data/lib/active_merchant/billing/integrations/world_pay.rb +15 -8
- data/lib/active_merchant/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +124 -50
- metadata.gz.sig +0 -0
data/CHANGELOG
CHANGED
|
@@ -1,5 +1,148 @@
|
|
|
1
1
|
= ActiveMerchant CHANGELOG
|
|
2
2
|
|
|
3
|
+
* PayPal Express gateway: Add unstore support [duff]
|
|
4
|
+
* Stripe: Send application_fee with capture requests [melari]
|
|
5
|
+
* Make #unstore method signature consistent across gateways [duff]
|
|
6
|
+
* Dwolla: Major bug fixes. [capablemonkey, melari]
|
|
7
|
+
* Stripe: Add support for including track data [melari]
|
|
8
|
+
|
|
9
|
+
== Version 1.33.0 (May 30, 2013)
|
|
10
|
+
|
|
11
|
+
* Netaxept: Completely revamped to use the "M" service type [rbjordan3, ntalbott]
|
|
12
|
+
* Litle: Void authorizations via an auth reversal [jrust]
|
|
13
|
+
* Add RBK Money integration [england]
|
|
14
|
+
* Direcpay: Update test url [ashish-d]
|
|
15
|
+
* PayPal Express gateway: Add support for creating billing agreements [fabiokr]
|
|
16
|
+
* PayPal Express gateway: Add reference authorizations [fabiokr]
|
|
17
|
+
* Add Cardstream Modern gateway [ExxKA]
|
|
18
|
+
* Pin: Fix special headers [duff]
|
|
19
|
+
* PayPal Express gateway: Remember the billing agreement id as Response#authorization [duff]
|
|
20
|
+
* PayPal Express gateway: Allow an amount of 0 [duff]
|
|
21
|
+
* PayPal Express gateway: Reduce parameter requirements [duff]
|
|
22
|
+
* Quickpay integration: Update notification parser to handle API v6 [larspind]
|
|
23
|
+
* Sage gateway: Deprecate #credit call [duff]
|
|
24
|
+
* Update notification generator to better match current notification class [lulalala]
|
|
25
|
+
* Paymill gateway: Change .com -> .de [louiskearns]
|
|
26
|
+
* Quickpay integration: Fix v6 response parsing [larspind]
|
|
27
|
+
* First Data e4: Add TransArmor store/tokenization support [gabetax]
|
|
28
|
+
* MerchantWarrior: Format expiration month/year correctly [klebervirgilio]
|
|
29
|
+
* Add iconv for ActiveSupport 2.3 under Ruby 2.0 [sanemat]
|
|
30
|
+
* Add Transnational gateway [bvandenbos]
|
|
31
|
+
* Authorize.Net: Add Check as payment method [andrunix]
|
|
32
|
+
* Merchant e-Solutions: Add ref number and recurring support [carlaares]
|
|
33
|
+
* Bogus gateway: Add authorization to purchase response [hron]
|
|
34
|
+
* Bluepay gateway: Fix Check support; general cleanup [ntalbott]
|
|
35
|
+
* Dwolla: Fix security issues and enable guest checkout [capablemonkey, schonfeld]
|
|
36
|
+
* SagePay gateway: Per-transaction 3D-secure selection [ExxKA]
|
|
37
|
+
* Barclays ePDQ: Handle incorrectly encoded response [jordanwheeler, aprofeit]
|
|
38
|
+
* Orbital: Bug fixes; add CustomerEmail, Retry Logic, Managed Billing, and Destination Address [juicedM3
|
|
39
|
+
* Distinguish invalid vs empty issue_numbers on CreditCards [drasch]
|
|
40
|
+
* Float Gemfiles to latest Rails [sanemat]
|
|
41
|
+
* USA ePay Advanced: Fix Check support [RyanScottLewis]
|
|
42
|
+
* Authorize.Net: Match up Check fields better with eCheck.Net requirements [ntalbott]
|
|
43
|
+
* Bluepay: Updated to bp20post api [cagerton, melari]
|
|
44
|
+
* Net Registry: Deprecate credit method [jduff]
|
|
45
|
+
* Sage: Don't include T_customer_number unless it is numeric [melari]
|
|
46
|
+
* Auth.net: Don't include cust_id unless it is numeric [melari]
|
|
47
|
+
* Epay: Deprecate credit method [melari]
|
|
48
|
+
* New PayU.in Integration [PayU, melari]
|
|
49
|
+
|
|
50
|
+
== Version 1.32.1 (April 4, 2013)
|
|
51
|
+
|
|
52
|
+
* CC5 and Garanti: Remove $KCODE modifications [melari]
|
|
53
|
+
* Paymill: Add support for store [ntalbott]
|
|
54
|
+
* USA ePay: Fix misspelling of "Aduth" [joelvh, ntalbott]
|
|
55
|
+
* Orbital: Fix nil address values throwing exceptions during truncation [melari]
|
|
56
|
+
|
|
57
|
+
== Version 1.32.0 (April 1, 2013)
|
|
58
|
+
|
|
59
|
+
* Optimal: Submit shipping address with requests [jduff]
|
|
60
|
+
* Iridium: Enable reference transactions for authorize [ntalbott]
|
|
61
|
+
* Stripe: Add authorize and capture methods [melari]
|
|
62
|
+
* Pin: Add a default description if none is specified to fix failures [melari]
|
|
63
|
+
* Litle: Add support for passing optional fields in token based transactions [forest]
|
|
64
|
+
* Add Finansbank gateway [scamurcuoglu]
|
|
65
|
+
* Paymill: Use .com instead of .de for save card url [besi]
|
|
66
|
+
* Worldpay integration: Use more robust endpoint urls [nashbridges]
|
|
67
|
+
* Braintree Blue: Return CC token in transaction hash [cyu]
|
|
68
|
+
* Robokassa: Fix signature for empty amount [ukolovda]
|
|
69
|
+
* Worldpay gateway: Fix error messages for some failures [duff]
|
|
70
|
+
* Worldpay gateway: Allow settled payments to be refunded [dougal]
|
|
71
|
+
* Spreedly: Update urls and terminology [duff]
|
|
72
|
+
* Make card brand error more user friendly [oggy]
|
|
73
|
+
* DataCash: Update test Mastercard number [jamesshipton]
|
|
74
|
+
* DataCash: Update test response fixtures [jamesshipton]
|
|
75
|
+
* Pin: Add Pin.js card token support [nagash]
|
|
76
|
+
* PayPal Express gateway: Fix error when no address information is in response [pierre]
|
|
77
|
+
* Ogone: Use BYPSP for ALIASOPERATION [ntalbott]
|
|
78
|
+
* Paymill: Handle error storing card [duff]
|
|
79
|
+
* SagePay integration: Add referrer field [melari]
|
|
80
|
+
* Pin: Add extra headers [duff]
|
|
81
|
+
* Paymill: Add support for store [ntalbott]
|
|
82
|
+
* USA ePay Advanced: Fix typo in message credit card data options [joelvh]
|
|
83
|
+
|
|
84
|
+
== Version 1.31.1 (February 25, 2013)
|
|
85
|
+
|
|
86
|
+
* Cybersource: Bug fixes [natejgreene, jduff]
|
|
87
|
+
|
|
88
|
+
== Version 1.31.0 (February 20, 2013)
|
|
89
|
+
|
|
90
|
+
* Worldpay: XML encoding is required to be ISO-8859-1 [dougal]
|
|
91
|
+
* Worldpay: Add card code for more supported card types [dougal]
|
|
92
|
+
* Ogone: Add action option [pwoestelandt]
|
|
93
|
+
* PayPal Express gateway: Add support for BuyerEmailOptInEnable [chrisrbnelson]
|
|
94
|
+
* Add Paymill gateway [duff]
|
|
95
|
+
* Add EVO Canada gateway [alexdunae]
|
|
96
|
+
* Fixed credit card and check interface, used correct method for checking payment type [jduff]
|
|
97
|
+
|
|
98
|
+
== Version 1.30.0 (February 13, 2013)
|
|
99
|
+
|
|
100
|
+
* Add FirstData Global Gateway e4 [frobcode]
|
|
101
|
+
* PaymentExpress: Add support for optional fields: ClientType and TxnData [moklett]
|
|
102
|
+
* PaymentExpress: Limit MerchantReference/description to 64 chars [moklett]
|
|
103
|
+
* Wirecard: description must be no more than 32 characters [moklett]
|
|
104
|
+
* Litle: Add support for passing a token to the authorize and purchase methods [forest]
|
|
105
|
+
* PayPal Common: Allow searching for transactions by ProfileID [aq1018]
|
|
106
|
+
* Add Spreedly Core gateway [duff]
|
|
107
|
+
* eWay Gateway: Return proper value for authorization [duff]
|
|
108
|
+
* eWay Gateway: Add support for refunds [duff]
|
|
109
|
+
* Quickpay: Add support for protocols 5 & 6 [twarberg]
|
|
110
|
+
* Banwire gateway: Handle JSON::ParserError [duff]
|
|
111
|
+
* Balanced gateway: Fix unspecified marketplace [duff]
|
|
112
|
+
* QBMS gateway: Allow partial addresses [duff]
|
|
113
|
+
* Authorize.Net CIM: Allow omitting card expiration date [shanebonham]
|
|
114
|
+
* Authorize.Net CIM: Add support for extraOptions to createCustomerProfileTransaction [tpiekos]
|
|
115
|
+
* Add NETPAY gateway [samlown]
|
|
116
|
+
* Balanced gateway: Add amount to the refund method signature [ntalbott]
|
|
117
|
+
* Orbital gateway: Fix void method signature [aprofeit, ntalbott]
|
|
118
|
+
* Eway Managed: Add 'query_customer' API as #retrieve [cdaloisio]
|
|
119
|
+
* NetPay: Fix the signature for void [duff]
|
|
120
|
+
* Cybersource: Add check support [bowmande]
|
|
121
|
+
* Moneris: Use a capture of $0 for void [ntalbott]
|
|
122
|
+
* PayPal Express integration: Fix received_at time zone [ntalbott]
|
|
123
|
+
* NAB Transact: Add refund capability [nagash]
|
|
124
|
+
* Stripe: Add support for application_fee [duff]
|
|
125
|
+
* SagePay: Add support for GiftAidPayment [duff]
|
|
126
|
+
* Wirecard: Add support for partial captures [richardblair]
|
|
127
|
+
* Add Pin gateway [madpilot]
|
|
128
|
+
* Balanced: Added support for on_behalf_of_uri to capture [cwise]
|
|
129
|
+
* Litle: Add support for passing an order_source [forest]
|
|
130
|
+
* Add Merchant Warrior gateway [pronix, Fodoj, ntalbott]
|
|
131
|
+
* Use v4 of the MerchantWare API for voiding transactions [melari]
|
|
132
|
+
* Add support for Authorize.net in CA and GB [melari]
|
|
133
|
+
* Send customer's IP to Beanstream for fraud review [melari]
|
|
134
|
+
|
|
135
|
+
== Version 1.29.3 (December 7, 2012)
|
|
136
|
+
|
|
137
|
+
* Braintree Blue: Better wiredump_device support [ntalbott]
|
|
138
|
+
* Braintree: Store sets vault id as authorization [ntalbott]
|
|
139
|
+
* WorldPay: Fix currencies without fractions like JPY and HUF by rounding down amount [Soleone]
|
|
140
|
+
|
|
141
|
+
== Version 1.29.2 (December 7, 2012)
|
|
142
|
+
|
|
143
|
+
* Moneris: fix issue with the default options not being merged [jduff]
|
|
144
|
+
* Sage Pay: Make 0000 default post code for everyone if missing [BlakeMesdag]
|
|
145
|
+
|
|
3
146
|
== Version 1.29.1 (December 5, 2012)
|
|
4
147
|
|
|
5
148
|
* 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
|
|
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
|
-
|
|
32
|
+
Or, if you're using Bundler, just add the following to your Gemfile:
|
|
38
33
|
|
|
39
|
-
gem 'activemerchant'
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
For more in-depth documentation and tutorials, see
|
|
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
|
-
* [
|
|
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
|
[](http://travis-ci.org/Shopify/active_merchant)
|
|
220
|
+
|
|
221
|
+
[](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.
|
|
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,
|
|
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
|
|
@@ -112,6 +112,11 @@ module ActiveMerchant #:nodoc:
|
|
|
112
112
|
# @return [String] the verification value
|
|
113
113
|
attr_accessor :verification_value
|
|
114
114
|
|
|
115
|
+
# Returns or sets the track data for the card
|
|
116
|
+
#
|
|
117
|
+
# @return [String]
|
|
118
|
+
attr_accessor :track_data
|
|
119
|
+
|
|
115
120
|
def type
|
|
116
121
|
self.class.deprecated "CreditCard#type is deprecated and will be removed from a future release of ActiveMerchant. Please use CreditCard#brand instead."
|
|
117
122
|
brand
|
|
@@ -181,7 +186,7 @@ module ActiveMerchant #:nodoc:
|
|
|
181
186
|
def display_number
|
|
182
187
|
self.class.mask(number)
|
|
183
188
|
end
|
|
184
|
-
|
|
189
|
+
|
|
185
190
|
def first_digits
|
|
186
191
|
self.class.first_digits(number)
|
|
187
192
|
end
|
|
@@ -229,7 +234,7 @@ module ActiveMerchant #:nodoc:
|
|
|
229
234
|
end
|
|
230
235
|
|
|
231
236
|
unless errors.on(:number) || errors.on(:brand)
|
|
232
|
-
errors.add :brand, "
|
|
237
|
+
errors.add :brand, "does not match the card number" unless CreditCard.matching_brand?(number, brand)
|
|
233
238
|
end
|
|
234
239
|
end
|
|
235
240
|
|
|
@@ -257,9 +262,13 @@ module ActiveMerchant #:nodoc:
|
|
|
257
262
|
def validate_switch_or_solo_attributes #:nodoc:
|
|
258
263
|
if %w[switch solo].include?(brand)
|
|
259
264
|
unless valid_month?(@start_month) && valid_start_year?(@start_year) || valid_issue_number?(@issue_number)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
265
|
+
if @issue_number.blank?
|
|
266
|
+
errors.add :start_month, "is invalid" unless valid_month?(@start_month)
|
|
267
|
+
errors.add :start_year, "is invalid" unless valid_start_year?(@start_year)
|
|
268
|
+
errors.add :issue_number, "cannot be empty"
|
|
269
|
+
else
|
|
270
|
+
errors.add :issue_number, "is invalid" unless valid_issue_number?(@issue_number)
|
|
271
|
+
end
|
|
263
272
|
end
|
|
264
273
|
end
|
|
265
274
|
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]
|
|
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.
|
|
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>
|
|
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,
|
|
88
|
+
def authorize(money, paysource, options = {})
|
|
87
89
|
post = {}
|
|
90
|
+
add_currency_code(post, money, options)
|
|
88
91
|
add_invoice(post, options)
|
|
89
|
-
|
|
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>
|
|
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,
|
|
107
|
+
def purchase(money, paysource, options = {})
|
|
105
108
|
post = {}
|
|
109
|
+
add_currency_code(post, money, options)
|
|
106
110
|
add_invoice(post, options)
|
|
107
|
-
|
|
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
|