activemerchant 1.42.3 → 1.42.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjhkNTg2ZGQxMmYxMTJjMGVhNTZhOWJhMmM4NWE5OTEzMDRiZGY0Ng==
4
+ NThjMjQ4YWE3M2Y3MGUyM2UzMDg2MWQ3ZjJjYjNiMzAyNzUxNTUyYw==
5
5
  data.tar.gz: !binary |-
6
- ZGI2ZmRkZWVjN2Y5NTYyNDQ2MmQ3NWRiNzg3MWQ2Y2FjMjk4NjY1ZQ==
6
+ ZTVkZDAwNWUyOGIwZGJmYzQxMmRmOWQ0YTdjODQ1Y2RkZTYxOGU3NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGJhMjg0N2JjNDI5ZDk3Y2MyM2ExNzY2NDQ4MmU1MjUwNWNhYTg3NTEyNmQx
10
- NjE1MDMxMjcxZjBhNGY1OTQ0NzMwNDkzYTQwMjQzZTY1N2U1ZjhkMzFkNzYy
11
- OTQ1YmEwOWVlYjdmNjI4ZmMyYWI4MGIwOGJkNWM1Njk1N2UxMDM=
9
+ MjBkOGY2OTgzZTg3YzU5YmEwMzQwZjI3ODM2MTcwZDdmODBlYTExMjRiNTVi
10
+ YzYyMDdlNThkYjBhNTBhMWFjZWM0ZTdkODVlYTI1NGVjNTdjMWU3ZTg1YmYx
11
+ NTVjYjE5ZTA1ZDYyNDgzYTE2NDY1MDY2NDMyOGQ4ZDRmM2E5OWI=
12
12
  data.tar.gz: !binary |-
13
- NTlkYjg4NGY2OGE5ZmZhN2ZiZGY3MDhlM2E3NjFlZmNlNzdmMDQxZTgyZWQx
14
- NDk5MDQ0OTU2MTYzNDU1YjNlMjIxNzE3NzY3ZGVkNDVkOTVmZDQ3OTA3MDE4
15
- NDYzMWIzNWNkOTVjZGFlYzExODcxYTliYzYxYWVhMTY4ZGFkOGY=
13
+ MmMwZDg4OGJmNzFlOTI4N2ZlNjczYWRkY2ZjM2ZiOGIzZTBmNGQ1M2VkZGRj
14
+ MWZjOGU0YjEyMDRhMmZmYzBiMDBhMmFmMGNiM2JkMjQ1MDUxMGE4NTc5NDVm
15
+ NWYyZGI1NWYzZmMzYzgyNTBjZDkyMDc2NTVhMzJmYWE2ZWYxZTY=
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,5 +1,12 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.42.4 (January 8th, 2014)
4
+
5
+ * DataCash: Set 'ecomm' as capturemethod [DavidGeukers]
6
+ * Cybersource: Fix subscriptions with a setup fee [ntalbott]
7
+ * Stripe: Do not pass customer details to the /cards endpoint [michellebu]
8
+ * Stripe: Allow Stripe API version to be initialized with the gateway [odorcicd]
9
+
3
10
  == Version 1.42.3 (December 18th, 2013)
4
11
 
5
12
  * Balanced: Add support for appears_on_statement_as [duff]
@@ -313,7 +313,10 @@ module ActiveMerchant #:nodoc:
313
313
  end
314
314
 
315
315
  def build_create_subscription_request(payment_method, options)
316
- options[:subscription] = (options[:subscription] || {}).merge(:frequency => "on-demand", :amount => 0, :automatic_renew => false)
316
+ default_subscription_params = {:frequency => "on-demand", :amount => 0, :automatic_renew => false}
317
+ options[:subscription] = default_subscription_params.update(
318
+ options[:subscription] || {}
319
+ )
317
320
 
318
321
  xml = Builder::XmlMarkup.new :indent => 2
319
322
  add_address(xml, payment_method, options[:billing_address], options)
@@ -321,13 +324,18 @@ module ActiveMerchant #:nodoc:
321
324
  if card_brand(payment_method) == 'check'
322
325
  add_check(xml, payment_method)
323
326
  add_check_payment_method(xml)
324
- add_check_service(xml, options) if options[:setup_fee]
325
327
  else
326
328
  add_creditcard(xml, payment_method)
327
329
  add_creditcard_payment_method(xml)
328
- add_purchase_service(xml, options) if options[:setup_fee]
329
330
  end
330
331
  add_subscription(xml, options)
332
+ if options[:setup_fee]
333
+ if card_brand(payment_method) == 'check'
334
+ add_check_service(xml, options)
335
+ else
336
+ add_purchase_service(xml, options)
337
+ end
338
+ end
331
339
  add_subscription_create_service(xml, options)
332
340
  add_business_rules_data(xml)
333
341
  xml.target!
@@ -200,6 +200,7 @@ module ActiveMerchant
200
200
  xml.tag! :TxnDetails do
201
201
  xml.tag! :merchantreference, format_reference_number(options[:order_id])
202
202
  xml.tag! :amount, amount(money), :currency => options[:currency] || currency(money)
203
+ xml.tag! :capturemethod, 'ecomm'
203
204
  end
204
205
  end
205
206
  end
@@ -285,6 +286,7 @@ module ActiveMerchant
285
286
  xml.tag! :TxnDetails do
286
287
  xml.tag! :merchantreference, format_reference_number(options[:order_id])
287
288
  xml.tag! :amount, amount(money), :currency => options[:currency] || currency(money)
289
+ xml.tag! :capturemethod, 'ecomm'
288
290
  end
289
291
  end
290
292
  end
@@ -33,6 +33,8 @@ module ActiveMerchant #:nodoc:
33
33
  requires!(options, :login)
34
34
  @api_key = options[:login]
35
35
  @fee_refund_api_key = options[:fee_refund_login]
36
+ @version = options[:version]
37
+
36
38
  super
37
39
  end
38
40
 
@@ -69,6 +71,7 @@ module ActiveMerchant #:nodoc:
69
71
 
70
72
  def refund(money, identification, options = {})
71
73
  post = {:amount => amount(money)}
74
+ post[:refund_application_fee] = true if options[:refund_application_fee]
72
75
 
73
76
  MultiResponse.run(:first) do |r|
74
77
  r.process { commit(:post, "charges/#{CGI.escape(identification)}/refund", post, options) }
@@ -99,20 +102,26 @@ module ActiveMerchant #:nodoc:
99
102
  # Note: creating a new credit card will not change the customer's existing default credit card (use :set_default => true)
100
103
  def store(creditcard, options = {})
101
104
  post = {}
102
- add_creditcard(post, creditcard, options)
103
- post[:description] = options[:description]
104
- post[:email] = options[:email]
105
+ card_params = {}
106
+ add_creditcard(card_params, creditcard, options)
107
+ post[:description] = options[:description] if options[:description]
108
+ post[:email] = options[:email] if options[:email]
105
109
 
106
110
  if options[:customer]
107
111
  MultiResponse.run(:first) do |r|
108
- r.process { commit(:post, "customers/#{CGI.escape(options[:customer])}/cards", post, options) }
112
+ # The /cards endpoint does not update other customer parameters.
113
+ r.process { commit(:post, "customers/#{CGI.escape(options[:customer])}/cards", card_params, options) }
109
114
 
110
- return r unless options[:set_default] and r.success? and !r.params["id"].blank?
115
+ if options[:set_default] and r.success? and !r.params['id'].blank?
116
+ post[:default_card] = r.params['id']
117
+ end
111
118
 
112
- r.process { update_customer(options[:customer], :default_card => r.params["id"]) }
119
+ if post.count > 0
120
+ r.process { update_customer(options[:customer], post) }
121
+ end
113
122
  end
114
123
  else
115
- commit(:post, 'customers', post, options)
124
+ commit(:post, 'customers', post.merge(card_params), options)
116
125
  end
117
126
  end
118
127
 
@@ -252,7 +261,8 @@ module ActiveMerchant #:nodoc:
252
261
  :publisher => 'active_merchant'
253
262
  })
254
263
 
255
- key = options[:key] || @api_key
264
+ key = options[:key] || @api_key
265
+ version = options[:version] || @version
256
266
 
257
267
  headers = {
258
268
  "Authorization" => "Basic " + Base64.encode64(key.to_s + ":").strip,
@@ -260,7 +270,7 @@ module ActiveMerchant #:nodoc:
260
270
  "X-Stripe-Client-User-Agent" => @@ua,
261
271
  "X-Stripe-Client-User-Metadata" => {:ip => options[:ip]}.to_json
262
272
  }
263
- headers.merge!("Stripe-Version" => options[:version]) if options[:version]
273
+ headers.merge!("Stripe-Version" => version) if version
264
274
  headers
265
275
  end
266
276
 
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.42.3"
2
+ VERSION = "1.42.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.42.3
4
+ version: 1.42.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
@@ -38,7 +38,7 @@ cert_chain:
38
38
  U1BPVm5oYkZKM3ZTWFkxdWxQL1I2WFc5dm53CjZra1FpMmZIaFUyMHVnTXpw
39
39
  ODgxRWl4citUakMwUnZVZXJMRzdnPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUt
40
40
  LS0tLQo=
41
- date: 2013-12-18 00:00:00.000000000 Z
41
+ date: 2014-01-08 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: activesupport
metadata.gz.sig CHANGED
Binary file