activemerchant 1.24.0 → 1.25.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,5 +1,25 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.25.0 (July 3, 2012)
4
+
5
+ * eWAY gateway: Add support for Diners Club cards [Soleone]
6
+ * Orbital gateway: Never send country code for orders outside of US, CA and GB [Soleone]
7
+ * Add EasyPay integration [nashby]
8
+ * Updating LitleOnline requirement to 8.13.2 to take advantage of better validation and get bugfix for Username [GregDrake]
9
+ * USAepay gateway: Add description support [ntalbott]
10
+ * Add Paypal Payments Advanced integration [csaunders]
11
+ * Authorize.Net gateway: Improve #refund docs [neerajdotname]
12
+ * Wirecard gateway: Fix for missing address hash [ntalbott]
13
+ * Clean up requires of RubyGems and JSON gems. Rename remote Litle test to match naming conventions [codyfauser]
14
+ * Cybersource gateway: Fix updating address only [fabiokr]
15
+ * Cybersource gateway: Move email requirement [fabiokr]
16
+ * Add the Metrics Global gateway [DanKnox]
17
+ * Braintree Blue gateway: Support wiredump_device [moklett]
18
+ * Add Fat Zebra gateway [amasses]
19
+ * Braintree Blue gateway: Always pass CVV on update [shayfrendt]
20
+ * eWAY gateway: Update docs. Require address [juggler]
21
+ * Cybersource gateway: Add support for subscriptions [fabiokr]
22
+
3
23
  == Version 1.24.0 (June 8, 2012)
4
24
 
5
25
  * PayPal gateway: Support for incomplete captures [mbulat]
@@ -9,6 +29,17 @@
9
29
  * Paybox Direct: treat all response codes besides '00000' as failures
10
30
  [Soleone]
11
31
  * Deprecate CreditCard#type method in favor of CreditCard#brand [jduff]
32
+ * Cybersource gateway: Add subscriptions support [fabiokr, jaredmoody]
33
+ * eWay gateway: Improved docs, and more accurate required parameters [juggler]
34
+ * Braintree Blue gateway: Always pass CVV on card update [shayfrendt]
35
+ * Add Fat Zebra gateway [amasses]
36
+ * Braintree Blue gateway: Add support for wiredump_device [moklett]
37
+ * Add Metrics Global gateway [DanKnox]
38
+ * Cybersource gateway: Do not require email address for subscription operations [fabiokr]
39
+ * Cybersource gateway: Fix passing only an address when updating a subscription [fabiokr]
40
+ * Wirecard gateway: Fix for missing address; general cleanup [ntalbott]
41
+ * Authorize.Net gateway: Document ability to just pass the last four to #refund [neerajdotname]
42
+ * Add EasyPay integration [nashby]
12
43
 
13
44
  == Version 1.23.0 (May 23, 2012)
14
45
 
data/CONTRIBUTORS CHANGED
@@ -305,3 +305,15 @@ ePay integration (April 2012)
305
305
  Litle gateway (May 2012)
306
306
 
307
307
  * Gregory Drake (GregDrake)
308
+
309
+ Fat Zebra gateway (June 2012)
310
+
311
+ * Matthew Savage (amasses)
312
+
313
+ Metrics Global gateway (June 2012)
314
+
315
+ * Dan Knox (DanKnox)
316
+
317
+ EasyPay integration (July 2012)
318
+
319
+ * Vasiliy Ermolovich (nashby)
data/README.md CHANGED
@@ -99,6 +99,7 @@ The [ActiveMerchant Wiki](http://github.com/Shopify/active_merchant/wikis) conta
99
99
  * [ePay](http://www.epay.dk/) - DK, SE, NO
100
100
  * [eWAY](http://www.eway.com.au/) - AU
101
101
  * [E-xact](http://www.e-xact.com) - CA, US
102
+ * [Fat Zebra](https://www.fatzebra.com.au) - AU
102
103
  * [Federated Canada](http://www.federatedcanada.com/) - CA
103
104
  * [FirstPay](http://www.first-pay.com) - US
104
105
  * [Garanti Sanal POS](https://ccpos.garanti.com.tr/ccRaporlar/garanti/ccReports) - US, TR
@@ -5,12 +5,12 @@ module ActiveMerchant #:nodoc:
5
5
  #
6
6
  # ActiveMerchant::Billing::Base.gateway_mode = :test
7
7
  mattr_accessor :gateway_mode
8
-
8
+
9
9
  # Set ActiveMerchant integrations in test mode.
10
10
  #
11
11
  # ActiveMerchant::Billing::Base.integration_mode = :test
12
12
  mattr_accessor :integration_mode
13
-
13
+
14
14
  # Set both the mode of both the gateways and integrations
15
15
  # at once
16
16
  mattr_reader :mode
@@ -22,36 +22,35 @@ module ActiveMerchant #:nodoc:
22
22
  end
23
23
 
24
24
  self.mode = :production
25
-
25
+
26
26
  # Return the matching gateway for the provider
27
27
  # * <tt>bogus</tt>: BogusGateway - Does nothing (for testing)
28
28
  # * <tt>moneris</tt>: MonerisGateway
29
29
  # * <tt>authorize_net</tt>: AuthorizeNetGateway
30
30
  # * <tt>trust_commerce</tt>: TrustCommerceGateway
31
- #
31
+ #
32
32
  # ActiveMerchant::Billing::Base.gateway('moneris').new
33
33
  def self.gateway(name)
34
34
  Billing.const_get("#{name.to_s.downcase}_gateway".camelize)
35
35
  end
36
-
37
36
 
38
37
  # Return the matching integration module
39
38
  # You can then get the notification from the module
40
- # * <tt>bogus</tt>: Bogus - Does nothing (for testing)
39
+ # * <tt>bogus</tt>: Bogus - Does nothing (for testing)
41
40
  # * <tt>chronopay</tt>: Chronopay - Does nothing (for testing)
42
41
  # * <tt>paypal</tt>: Chronopay - Does nothing (for testing)
43
- #
42
+ #
44
43
  # chronopay = ActiveMerchant::Billing::Base.integration('chronopay')
45
44
  # notification = chronopay.notification(raw_post)
46
45
  #
47
46
  def self.integration(name)
48
47
  Billing::Integrations.const_get("#{name.to_s.downcase}".camelize)
49
48
  end
50
-
49
+
51
50
  # A check to see if we're in test mode
52
51
  def self.test?
53
52
  self.gateway_mode == :test
54
53
  end
55
- end
54
+ end
56
55
  end
57
56
  end
@@ -4,12 +4,12 @@ require 'active_merchant/billing/response'
4
4
 
5
5
  module ActiveMerchant #:nodoc:
6
6
  module Billing #:nodoc:
7
- #
7
+ #
8
8
  # == Description
9
- # The Gateway class is the base class for all ActiveMerchant gateway implementations.
10
- #
9
+ # The Gateway class is the base class for all ActiveMerchant gateway implementations.
10
+ #
11
11
  # The standard list of gateway functions that most concrete gateway subclasses implement is:
12
- #
12
+ #
13
13
  # * <tt>purchase(money, creditcard, options = {})</tt>
14
14
  # * <tt>authorize(money, creditcard, options = {})</tt>
15
15
  # * <tt>capture(money, authorization, options = {})</tt>
@@ -24,7 +24,7 @@ module ActiveMerchant #:nodoc:
24
24
  #
25
25
  # * <tt>store(creditcard, options = {})</tt>
26
26
  # * <tt>unstore(identification, options = {})</tt>
27
- #
27
+ #
28
28
  # === Gateway Options
29
29
  # The options hash consists of the following options:
30
30
  #
@@ -38,9 +38,9 @@ module ActiveMerchant #:nodoc:
38
38
  # * <tt>:currency</tt> - The currency of the transaction. Only important when you are using a currency that is not the default with a gateway that supports multiple currencies.
39
39
  # * <tt>:billing_address</tt> - A hash containing the billing address of the customer.
40
40
  # * <tt>:shipping_address</tt> - A hash containing the shipping address of the customer.
41
- #
41
+ #
42
42
  # The <tt>:billing_address</tt>, and <tt>:shipping_address</tt> hashes can have the following keys:
43
- #
43
+ #
44
44
  # * <tt>:name</tt> - The full name of the customer.
45
45
  # * <tt>:company</tt> - The company name of the customer.
46
46
  # * <tt>:address1</tt> - The primary street address of the customer.
@@ -60,78 +60,78 @@ module ActiveMerchant #:nodoc:
60
60
  include RequiresParameters
61
61
  include CreditCardFormatting
62
62
  include Utils
63
-
63
+
64
64
  DEBIT_CARDS = [ :switch, :solo ]
65
65
  CURRENCIES_WITHOUT_FRACTIONS = [ 'JPY' ]
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
69
69
  @@implementations = []
70
-
70
+
71
71
  def self.inherited(subclass)
72
72
  super
73
73
  @@implementations << subclass
74
74
  end
75
-
75
+
76
76
  # The format of the amounts used by the gateway
77
77
  # :dollars => '12.50'
78
78
  # :cents => '1250'
79
79
  class_attribute :money_format
80
80
  self.money_format = :dollars
81
-
81
+
82
82
  # The default currency for the transactions if no currency is provided
83
83
  class_attribute :default_currency
84
-
84
+
85
85
  # The countries of merchants the gateway supports
86
86
  class_attribute :supported_countries
87
87
  self.supported_countries = []
88
-
88
+
89
89
  # The supported card types for the gateway
90
90
  class_attribute :supported_cardtypes
91
91
  self.supported_cardtypes = []
92
-
92
+
93
93
  class_attribute :homepage_url
94
94
  class_attribute :display_name
95
-
95
+
96
96
  # The application making the calls to the gateway
97
97
  # Useful for things like the PayPal build notation (BN) id fields
98
98
  superclass_delegating_accessor :application_id
99
99
  self.application_id = 'ActiveMerchant'
100
-
100
+
101
101
  attr_reader :options
102
-
102
+
103
103
  # Use this method to check if your gateway of interest supports a credit card of some type
104
104
  def self.supports?(card_type)
105
105
  supported_cardtypes.include?(card_type.to_sym)
106
106
  end
107
-
107
+
108
108
  def self.card_brand(source)
109
109
  result = source.respond_to?(:brand) ? source.brand : source.type
110
110
  result.to_s.downcase
111
111
  end
112
-
112
+
113
113
  def card_brand(source)
114
114
  self.class.card_brand(source)
115
115
  end
116
-
116
+
117
117
  # Initialize a new gateway.
118
- #
119
- # See the documentation for the gateway you will be using to make sure there are no other
118
+ #
119
+ # See the documentation for the gateway you will be using to make sure there are no other
120
120
  # required options.
121
121
  def initialize(options = {})
122
122
  end
123
-
123
+
124
124
  # Are we running in test mode?
125
125
  def test?
126
126
  Base.gateway_mode == :test
127
127
  end
128
-
128
+
129
129
  private # :nodoc: all
130
130
 
131
- def name
131
+ def name
132
132
  self.class.name.scan(/\:\:(\w+)Gateway/).flatten.first
133
133
  end
134
-
134
+
135
135
  def amount(money)
136
136
  return nil if money.nil?
137
137
  cents = if money.respond_to?(:cents)
@@ -141,8 +141,8 @@ module ActiveMerchant #:nodoc:
141
141
  money
142
142
  end
143
143
 
144
- if money.is_a?(String)
145
- raise ArgumentError, 'money amount must be a positive Integer in cents.'
144
+ if money.is_a?(String)
145
+ raise ArgumentError, 'money amount must be a positive Integer in cents.'
146
146
  end
147
147
 
148
148
  if self.money_format == :cents
@@ -156,11 +156,11 @@ module ActiveMerchant #:nodoc:
156
156
  amount = amount(money)
157
157
  CURRENCIES_WITHOUT_FRACTIONS.include?(currency.to_s) ? amount.split('.').first : amount
158
158
  end
159
-
159
+
160
160
  def currency(money)
161
161
  money.respond_to?(:currency) ? money.currency : self.default_currency
162
162
  end
163
-
163
+
164
164
  def requires_start_date_or_issue_number?(credit_card)
165
165
  return false if card_brand(credit_card).blank?
166
166
  DEBIT_CARDS.include?(card_brand(credit_card).to_sym)
@@ -2,11 +2,11 @@ module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  # For more information on the Authorize.Net Gateway please visit their {Integration Center}[http://developer.authorize.net/]
4
4
  #
5
- # The login and password are not the username and password you use to
6
- # login to the Authorize.Net Merchant Interface. Instead, you will
7
- # use the API Login ID as the login and Transaction Key as the
5
+ # The login and password are not the username and password you use to
6
+ # login to the Authorize.Net Merchant Interface. Instead, you will
7
+ # use the API Login ID as the login and Transaction Key as the
8
8
  # password.
9
- #
9
+ #
10
10
  # ==== How to Get Your API Login ID and Transaction Key
11
11
  #
12
12
  # 1. Log into the Merchant Interface
@@ -14,13 +14,13 @@ module ActiveMerchant #:nodoc:
14
14
  # 3. Click on API Login ID and Transaction Key in the Security section
15
15
  # 4. Type in the answer to the secret question configured on setup
16
16
  # 5. Click Submit
17
- #
17
+ #
18
18
  # ==== Automated Recurring Billing (ARB)
19
- #
19
+ #
20
20
  # Automated Recurring Billing (ARB) is an optional service for submitting and managing recurring, or subscription-based, transactions.
21
- #
21
+ #
22
22
  # To use recurring, update_recurring, cancel_recurring and status_recurring ARB must be enabled for your account.
23
- #
23
+ #
24
24
  # Information about ARB is available on the {Authorize.Net website}[http://www.authorize.net/solutions/merchantsolutions/merchantservices/automatedrecurringbilling/].
25
25
  # Information about the ARB API is available at the {Authorize.Net Integration Center}[http://developer.authorize.net/]
26
26
  class AuthorizeNetGateway < Gateway
@@ -33,7 +33,7 @@ module ActiveMerchant #:nodoc:
33
33
 
34
34
  self.arb_test_url = 'https://apitest.authorize.net/xml/v1/request.api'
35
35
  self.arb_live_url = 'https://api.authorize.net/xml/v1/request.api'
36
-
36
+
37
37
  class_attribute :duplicate_window
38
38
 
39
39
  APPROVED, DECLINED, ERROR, FRAUD_REVIEW = 1, 2, 3, 4
@@ -68,7 +68,7 @@ module ActiveMerchant #:nodoc:
68
68
  #
69
69
  # * <tt>:login</tt> -- The Authorize.Net API Login ID (REQUIRED)
70
70
  # * <tt>:password</tt> -- The Authorize.Net Transaction Key. (REQUIRED)
71
- # * <tt>:test</tt> -- +true+ or +false+. If true, perform transactions against the test server.
71
+ # * <tt>:test</tt> -- +true+ or +false+. If true, perform transactions against the test server.
72
72
  # Otherwise, perform transactions against the production server.
73
73
  def initialize(options = {})
74
74
  requires!(options, :login, :password)
@@ -150,6 +150,7 @@ module ActiveMerchant #:nodoc:
150
150
  # ==== Options
151
151
  #
152
152
  # * <tt>:card_number</tt> -- The credit card number the refund is being issued to. (REQUIRED)
153
+ # You can either pass the last four digits of the card number or the full card number.
153
154
  # * <tt>:first_name</tt> -- The first name of the account being refunded.
154
155
  # * <tt>:last_name</tt> -- The last name of the account being refunded.
155
156
  # * <tt>:zip</tt> -- The postal code of the account being refunded.
@@ -257,7 +258,7 @@ module ActiveMerchant #:nodoc:
257
258
  end
258
259
 
259
260
  private
260
-
261
+
261
262
  def commit(action, money, parameters)
262
263
  parameters[:amount] = amount(money) unless action == 'VOID'
263
264
 
@@ -278,8 +279,8 @@ module ActiveMerchant #:nodoc:
278
279
  # (TESTMODE) Successful Sale
279
280
  test_mode = test? || message =~ /TESTMODE/
280
281
 
281
- Response.new(success?(response), message, response,
282
- :test => test_mode,
282
+ Response.new(success?(response), message, response,
283
+ :test => test_mode,
283
284
  :authorization => response[:transaction_id],
284
285
  :fraud_review => fraud_review?(response),
285
286
  :avs_result => { :code => response[:avs_result_code] },
@@ -300,7 +301,7 @@ module ActiveMerchant #:nodoc:
300
301
 
301
302
  results = {
302
303
  :response_code => fields[RESPONSE_CODE].to_i,
303
- :response_reason_code => fields[RESPONSE_REASON_CODE],
304
+ :response_reason_code => fields[RESPONSE_REASON_CODE],
304
305
  :response_reason_text => fields[RESPONSE_REASON_TEXT],
305
306
  :avs_result_code => fields[AVS_RESULT_CODE],
306
307
  :transaction_id => fields[TRANSACTION_ID],
@@ -353,7 +354,7 @@ module ActiveMerchant #:nodoc:
353
354
  post[:customer_ip] = options[:ip]
354
355
  end
355
356
  end
356
-
357
+
357
358
  # x_duplicate_window won't be sent by default, because sending it changes the response.
358
359
  # "If this field is present in the request with or without a value, an enhanced duplicate transaction response will be sent."
359
360
  # (as of 2008-12-30) http://www.authorize.net/support/AIM_guide_SCC.pdf
@@ -373,7 +374,7 @@ module ActiveMerchant #:nodoc:
373
374
  post[:country] = address[:country].to_s
374
375
  post[:state] = address[:state].blank? ? 'n/a' : address[:state]
375
376
  end
376
-
377
+
377
378
  if address = options[:shipping_address]
378
379
  post[:ship_to_first_name] = address[:first_name].to_s
379
380
  post[:ship_to_last_name] = address[:last_name].to_s
@@ -398,11 +399,11 @@ module ActiveMerchant #:nodoc:
398
399
  end
399
400
  end
400
401
 
401
- def message_from(results)
402
+ def message_from(results)
402
403
  if results[:response_code] == DECLINED
403
404
  return CVVResult.messages[ results[:card_code] ] if CARD_CODE_ERRORS.include?(results[:card_code])
404
405
  if AVS_REASON_CODES.include?(results[:response_reason_code]) && AVS_ERRORS.include?(results[:avs_result_code])
405
- return AVSResult.messages[ results[:avs_result_code] ]
406
+ return AVSResult.messages[ results[:avs_result_code] ]
406
407
  end
407
408
  end
408
409
 
@@ -484,7 +485,7 @@ module ActiveMerchant #:nodoc:
484
485
  xml.tag!('name', options[:subscription_name]) if options[:subscription_name]
485
486
  # Contains information about the payment schedule
486
487
  add_arb_payment_schedule(xml, options)
487
- # The amount to be billed to the customer
488
+ # The amount to be billed to the customer
488
489
  # for each payment in the subscription
489
490
  xml.tag!('amount', amount(options[:amount])) if options[:amount]
490
491
  if trial = options[:trial]
@@ -523,7 +524,7 @@ module ActiveMerchant #:nodoc:
523
524
  def add_arb_duration(xml, options)
524
525
  duration = options[:duration]
525
526
  return unless duration
526
- # The date the subscription begins
527
+ # The date the subscription begins
527
528
  # (also the date the initial billing occurs)
528
529
  xml.tag!('startDate', duration[:start_date]) if duration[:start_date]
529
530
  # Number of billing occurrences or payments for the subscription
@@ -569,7 +570,7 @@ module ActiveMerchant #:nodoc:
569
570
  end
570
571
 
571
572
  # Adds customer’s bank account information
572
- # Note: This element should only be included
573
+ # Note: This element should only be included
573
574
  # when the payment method is bank account.
574
575
  def add_arb_bank_account(xml, options)
575
576
  bank_account = options[:bank_account]
@@ -581,10 +582,10 @@ module ActiveMerchant #:nodoc:
581
582
  xml.tag!('routingNumber', bank_account[:routing_number])
582
583
  # The bank account number used for payment of the subscription
583
584
  xml.tag!('accountNumber', bank_account[:account_number])
584
- # The full name of the individual associated
585
+ # The full name of the individual associated
585
586
  # with the bank account number
586
587
  xml.tag!('nameOfAccount', bank_account[:name_of_account])
587
- # The full name of the individual associated
588
+ # The full name of the individual associated
588
589
  # with the bank account number (optional)
589
590
  xml.tag!('bankName', bank_account[:bank_name]) if bank_account[:bank_name]
590
591
  # The type of electronic check transaction used for the subscription
@@ -655,7 +656,7 @@ module ActiveMerchant #:nodoc:
655
656
  def recurring_commit(action, request)
656
657
  url = test? ? arb_test_url : arb_live_url
657
658
  xml = ssl_post(url, request, "Content-Type" => "text/xml")
658
-
659
+
659
660
  response = recurring_parse(action, xml)
660
661
 
661
662
  message = response[:message] || response[:text]