activemerchant 1.20.1 → 1.20.2

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,9 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.20.2 (January 16, 2012)
4
+
5
+ * Remove authorize/capture support for Stripe [gdb]
6
+
3
7
  == Version 1.20.1 (December 22, 2011)
4
8
 
5
9
  * PayflowExpressUk: Fix parsing street2 from response [odorcicd]
@@ -35,6 +35,13 @@ module ActiveMerchant #:nodoc:
35
35
  super
36
36
  end
37
37
 
38
+ # To create a charge on a card or a token, call
39
+ #
40
+ # purchase(money, card_hash_or_token, { ... })
41
+ #
42
+ # To create a charge on a customer, call
43
+ #
44
+ # purchase(money, nil, { :customer => id, ... })
38
45
  def purchase(money, creditcard, options = {})
39
46
  post = {}
40
47
 
@@ -50,14 +57,14 @@ module ActiveMerchant #:nodoc:
50
57
  end
51
58
 
52
59
  def authorize(money, creditcard, options = {})
53
- purchase(money, creditcard, options.merge(:uncaptured => true))
60
+ raise "Stripe does not support separate authorization and capture"
54
61
  end
55
62
 
56
63
  def capture(money, identification, options = {})
57
- commit("charges/#{CGI.escape(identification)}/capture", {})
64
+ raise "Stripe does not support separate authorization and capture"
58
65
  end
59
66
 
60
- def void(identification, options={})
67
+ def void(identification, options = {})
61
68
  commit("charges/#{CGI.escape(identification)}/refund", {})
62
69
  end
63
70
 
@@ -69,7 +76,7 @@ module ActiveMerchant #:nodoc:
69
76
  commit("charges/#{CGI.escape(identification)}/refund", post)
70
77
  end
71
78
 
72
- def store(creditcard, options={})
79
+ def store(creditcard, options = {})
73
80
  post = {}
74
81
  add_creditcard(post, creditcard, options)
75
82
  add_customer_data(post, options)
@@ -81,6 +88,15 @@ module ActiveMerchant #:nodoc:
81
88
  end
82
89
  end
83
90
 
91
+ def update(customer_id, creditcard, options = {})
92
+ options = options.merge(:customer => customer_id)
93
+ store(creditcard, options)
94
+ end
95
+
96
+ def unstore(customer_id, options = {})
97
+ commit("customers/#{CGI.escape(customer_id)}", nil, :delete)
98
+ end
99
+
84
100
  private
85
101
 
86
102
  def add_amount(post, money, options)
@@ -89,7 +105,8 @@ module ActiveMerchant #:nodoc:
89
105
  end
90
106
 
91
107
  def add_customer_data(post, options)
92
- post[:description] = options[:email] || options[:description]
108
+ post[:description] = options[:description]
109
+ post[:email] = options[:email]
93
110
  end
94
111
 
95
112
  def add_address(post, options)
@@ -132,6 +149,8 @@ module ActiveMerchant #:nodoc:
132
149
  end
133
150
 
134
151
  def post_data(params)
152
+ return nil unless params
153
+
135
154
  params.map do |key, value|
136
155
  next if value.blank?
137
156
  if value.is_a?(Hash)
@@ -177,7 +196,7 @@ module ActiveMerchant #:nodoc:
177
196
  response = json_error(raw_response)
178
197
  end
179
198
 
180
- card = response["card"] || {}
199
+ card = response["card"] || response["active_card"] || {}
181
200
  avs_code = AVS_CODE_TRANSLATOR["line1: #{card["address_line1_check"]}, zip: #{card["address_zip_check"]}"]
182
201
  cvc_code = CVC_CODE_TRANSLATOR[card["cvc_check"]]
183
202
  Response.new(success,
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.20.1"
2
+ VERSION = "1.20.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 69
4
+ hash: 67
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 20
9
- - 1
10
- version: 1.20.1
9
+ - 2
10
+ version: 1.20.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Luetke
@@ -36,7 +36,7 @@ cert_chain:
36
36
  hPaSTyVU0yCSnw==
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2011-12-22 00:00:00 -05:00
39
+ date: 2012-01-16 00:00:00 -05:00
40
40
  default_executable:
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
@@ -140,12 +140,12 @@ dependencies:
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- hash: 21
143
+ hash: 19
144
144
  segments:
145
145
  - 1
146
146
  - 0
147
- - 1
148
- version: 1.0.1
147
+ - 2
148
+ version: 1.0.2
149
149
  prerelease: false
150
150
  type: :runtime
151
151
  requirement: *id007
metadata.gz.sig CHANGED
Binary file