activemerchant 1.49.0 → 1.50.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +47 -0
  3. data/CONTRIBUTORS +4 -0
  4. data/README.md +5 -1
  5. data/lib/active_merchant/billing/credit_card.rb +9 -0
  6. data/lib/active_merchant/billing/gateways/allied_wallet.rb +203 -0
  7. data/lib/active_merchant/billing/gateways/authorize_net.rb +17 -6
  8. data/lib/active_merchant/billing/gateways/beanstream.rb +4 -0
  9. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +0 -4
  10. data/lib/active_merchant/billing/gateways/beanstream_interac.rb +4 -0
  11. data/lib/active_merchant/billing/gateways/bpoint.rb +277 -0
  12. data/lib/active_merchant/billing/gateways/cashnet.rb +19 -8
  13. data/lib/active_merchant/billing/gateways/cenpos.rb +15 -29
  14. data/lib/active_merchant/billing/gateways/conekta.rb +3 -2
  15. data/lib/active_merchant/billing/gateways/dibs.rb +206 -0
  16. data/lib/active_merchant/billing/gateways/fat_zebra.rb +19 -12
  17. data/lib/active_merchant/billing/gateways/merchant_partners.rb +245 -0
  18. data/lib/active_merchant/billing/gateways/netbilling.rb +1 -0
  19. data/lib/active_merchant/billing/gateways/omise.rb +319 -0
  20. data/lib/active_merchant/billing/gateways/optimal_payment.rb +5 -4
  21. data/lib/active_merchant/billing/gateways/orbital.rb +7 -0
  22. data/lib/active_merchant/billing/gateways/payu_in.rb +243 -0
  23. data/lib/active_merchant/billing/gateways/quickpay.rb +11 -357
  24. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +188 -0
  25. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +240 -0
  26. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +227 -0
  27. data/lib/active_merchant/billing/gateways/s5.rb +226 -0
  28. data/lib/active_merchant/billing/gateways/sage_pay.rb +7 -1
  29. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/stripe.rb +8 -5
  31. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +2 -2
  32. data/lib/active_merchant/billing/gateways/vanco.rb +280 -0
  33. data/lib/active_merchant/connection.rb +3 -0
  34. data/lib/active_merchant/version.rb +1 -1
  35. metadata +15 -27
  36. checksums.yaml.gz.sig +0 -2
  37. data.tar.gz.sig +0 -0
  38. data/lib/active_merchant/billing/gateways/adyen.rb +0 -209
  39. metadata.gz.sig +0 -1
@@ -68,6 +68,9 @@ module ActiveMerchant
68
68
  when :put
69
69
  debug body
70
70
  http.put(endpoint.request_uri, body, headers)
71
+ when :patch
72
+ debug body
73
+ http.patch(endpoint.request_uri, body, headers)
71
74
  when :delete
72
75
  # It's kind of ambiguous whether the RFC allows bodies
73
76
  # for DELETE requests. But Net::HTTP's delete method
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.49.0"
2
+ VERSION = "1.50.0"
3
3
  end
metadata CHANGED
@@ -1,36 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.49.0
4
+ version: 1.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZhZG1p
14
- bnMxFzAVBgoJkiaJk/IsZAEZFgdzaG9waWZ5MRMwEQYKCZImiZPyLGQBGRYDY29t
15
- MB4XDTE0MDUxNTIwMzM0OFoXDTE1MDUxNTIwMzM0OFowPzEPMA0GA1UEAwwGYWRt
16
- aW5zMRcwFQYKCZImiZPyLGQBGRYHc2hvcGlmeTETMBEGCgmSJomT8ixkARkWA2Nv
17
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL0/81O3e1vh5smcwp2G
18
- MpLQ6q0kejQLa65bPYPxdzWA1SYOKyGfw+yR9LdFzsuKpwWzKq6zX35lj1IckWS4
19
- bNBEQzxmufUxU0XPM02haFB8fOfDJzdXsWte9Ge4IFwahwn68gpMqN+BvxL+KMYz
20
- Iut9YmN44d4LZdsENEIO5vmybuG2vYDz7R56qB0PA+Q2P2CdhymsBad2DQs69FBo
21
- uico9V6VMYYctL9lCYdzu9IXrOYNTt88suKIVzzAlHOKeN0Ng5qdztFoTR8sfxDr
22
- Ydg3KHl5n47wlpgd8R0f/4b5gGxW+v9pyJCgQnLlRu7DedVSvv7+GMtj3g9r3nhJ
23
- KqECAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFI/o
24
- maf34HXbUOQsdoLHacEKQgunMB0GA1UdEQQWMBSBEmFkbWluc0BzaG9waWZ5LmNv
25
- bTAdBgNVHRIEFjAUgRJhZG1pbnNAc2hvcGlmeS5jb20wDQYJKoZIhvcNAQEFBQAD
26
- ggEBADkK9aj5T0HPExsov4EoMWFnO+G7RQ28C30VAfKxnL2UxG6i4XMHVs6Xi94h
27
- qXFw1ec9Y2eDUqaolT3bviOk9BB197+A8Vz/k7MC6ci2NE+yDDB7HAC8zU6LAx8Y
28
- Iqvw7B/PSZ/pz4bUVFlTATif4mi1vO3lidRkdHRtM7UePSn2rUpOi0gtXBP3bLu5
29
- YjHJN7wx5cugMEyroKITG5gL0Nxtu21qtOlHX4Hc4KdE2JqzCPOsS4zsZGhgwhPs
30
- fl3hbtVFTqbOlwL9vy1fudXcolIE/ZTcxQ+er07ZFZdKCXayR9PPs64heamfn0fp
31
- TConQSX2BnZdhIEYW+cKzEC/bLc=
32
- -----END CERTIFICATE-----
33
- date: 2015-05-01 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2015-06-01 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
14
  name: activesupport
@@ -183,7 +161,7 @@ files:
183
161
  - lib/active_merchant/billing/cvv_result.rb
184
162
  - lib/active_merchant/billing/gateway.rb
185
163
  - lib/active_merchant/billing/gateways.rb
186
- - lib/active_merchant/billing/gateways/adyen.rb
164
+ - lib/active_merchant/billing/gateways/allied_wallet.rb
187
165
  - lib/active_merchant/billing/gateways/app55.rb
188
166
  - lib/active_merchant/billing/gateways/authorize_net.rb
189
167
  - lib/active_merchant/billing/gateways/authorize_net_arb.rb
@@ -201,6 +179,7 @@ files:
201
179
  - lib/active_merchant/billing/gateways/blue_pay.rb
202
180
  - lib/active_merchant/billing/gateways/bogus.rb
203
181
  - lib/active_merchant/billing/gateways/borgun.rb
182
+ - lib/active_merchant/billing/gateways/bpoint.rb
204
183
  - lib/active_merchant/billing/gateways/braintree.rb
205
184
  - lib/active_merchant/billing/gateways/braintree/braintree_common.rb
206
185
  - lib/active_merchant/billing/gateways/braintree_blue.rb
@@ -218,6 +197,7 @@ files:
218
197
  - lib/active_merchant/billing/gateways/conekta.rb
219
198
  - lib/active_merchant/billing/gateways/cyber_source.rb
220
199
  - lib/active_merchant/billing/gateways/data_cash.rb
200
+ - lib/active_merchant/billing/gateways/dibs.rb
221
201
  - lib/active_merchant/billing/gateways/efsnet.rb
222
202
  - lib/active_merchant/billing/gateways/elavon.rb
223
203
  - lib/active_merchant/billing/gateways/epay.rb
@@ -255,6 +235,7 @@ files:
255
235
  - lib/active_merchant/billing/gateways/maxipago.rb
256
236
  - lib/active_merchant/billing/gateways/merchant_e_solutions.rb
257
237
  - lib/active_merchant/billing/gateways/merchant_one.rb
238
+ - lib/active_merchant/billing/gateways/merchant_partners.rb
258
239
  - lib/active_merchant/billing/gateways/merchant_ware.rb
259
240
  - lib/active_merchant/billing/gateways/merchant_ware_version_four.rb
260
241
  - lib/active_merchant/billing/gateways/merchant_warrior.rb
@@ -276,6 +257,7 @@ files:
276
257
  - lib/active_merchant/billing/gateways/network_merchants.rb
277
258
  - lib/active_merchant/billing/gateways/nmi.rb
278
259
  - lib/active_merchant/billing/gateways/ogone.rb
260
+ - lib/active_merchant/billing/gateways/omise.rb
279
261
  - lib/active_merchant/billing/gateways/openpay.rb
280
262
  - lib/active_merchant/billing/gateways/optimal_payment.rb
281
263
  - lib/active_merchant/billing/gateways/orbital.rb
@@ -308,6 +290,7 @@ files:
308
290
  - lib/active_merchant/billing/gateways/paypal_express_common.rb
309
291
  - lib/active_merchant/billing/gateways/payscout.rb
310
292
  - lib/active_merchant/billing/gateways/paystation.rb
293
+ - lib/active_merchant/billing/gateways/payu_in.rb
311
294
  - lib/active_merchant/billing/gateways/payway.rb
312
295
  - lib/active_merchant/billing/gateways/pin.rb
313
296
  - lib/active_merchant/billing/gateways/plugnpay.rb
@@ -317,9 +300,13 @@ files:
317
300
  - lib/active_merchant/billing/gateways/quantum.rb
318
301
  - lib/active_merchant/billing/gateways/quickbooks.rb
319
302
  - lib/active_merchant/billing/gateways/quickpay.rb
303
+ - lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb
304
+ - lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb
305
+ - lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb
320
306
  - lib/active_merchant/billing/gateways/qvalent.rb
321
307
  - lib/active_merchant/billing/gateways/realex.rb
322
308
  - lib/active_merchant/billing/gateways/redsys.rb
309
+ - lib/active_merchant/billing/gateways/s5.rb
323
310
  - lib/active_merchant/billing/gateways/sage.rb
324
311
  - lib/active_merchant/billing/gateways/sage/sage_bankcard.rb
325
312
  - lib/active_merchant/billing/gateways/sage/sage_core.rb
@@ -345,6 +332,7 @@ files:
345
332
  - lib/active_merchant/billing/gateways/usa_epay.rb
346
333
  - lib/active_merchant/billing/gateways/usa_epay_advanced.rb
347
334
  - lib/active_merchant/billing/gateways/usa_epay_transaction.rb
335
+ - lib/active_merchant/billing/gateways/vanco.rb
348
336
  - lib/active_merchant/billing/gateways/verifi.rb
349
337
  - lib/active_merchant/billing/gateways/viaklix.rb
350
338
  - lib/active_merchant/billing/gateways/webpay.rb
@@ -391,7 +379,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
391
379
  version: '0'
392
380
  requirements: []
393
381
  rubyforge_project: activemerchant
394
- rubygems_version: 2.2.2
382
+ rubygems_version: 2.2.3
395
383
  signing_key:
396
384
  specification_version: 4
397
385
  summary: Framework and tools for dealing with credit card transactions.
@@ -1,2 +0,0 @@
1
- 8
2
- ���� |��XRa|�� Y�sE���qͻ�h�~� �O�َ!y��5�=��%51�tB�M�Pl��h?{�?�� �h�l8�$�s��ݮ�.@�v�adX��U�(x��ރ/�7Q��bO8��)�9Oa5�?]�f�~|&��h�13��.�o��[�5h X�h���7T%�: ,w������z��2e=-�V�Yi��rJ
data.tar.gz.sig DELETED
Binary file
@@ -1,209 +0,0 @@
1
- module ActiveMerchant #:nodoc:
2
- module Billing #:nodoc:
3
- class AdyenGateway < Gateway
4
- self.test_url = 'https://pal-test.adyen.com/pal/adapter/httppost'
5
- self.live_url = 'https://pal-live.adyen.com/pal/adapter/httppost'
6
-
7
- self.supported_countries = ['AR', 'AT', 'BE', 'BR', 'CA', 'CH', 'CL', 'CN', 'CO', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'HK', 'ID', 'IE', 'IL', 'IN', 'IT', 'JP', 'KR', 'LU', 'MX', 'MY', 'NL', 'NO', 'PA', 'PE', 'PH', 'PL', 'PT', 'RU', 'SE', 'SG', 'TH', 'TR', 'TW', 'US', 'VN', 'ZA']
8
- self.default_currency = 'EUR'
9
- self.money_format = :cents
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :dankort, :maestro]
11
-
12
- self.homepage_url = 'https://www.adyen.com/'
13
- self.display_name = 'Adyen'
14
-
15
- def initialize(options = {})
16
- requires!(options, :company, :merchant, :password)
17
- super
18
- end
19
-
20
- def purchase(money, creditcard, options = {})
21
- requires!(options, :order_id)
22
-
23
- MultiResponse.run do |r|
24
- r.process { authorize(money, creditcard, options) }
25
- r.process { capture(money, r.authorization, options) }
26
- end
27
- end
28
-
29
- def authorize(money, creditcard, options = {})
30
- requires!(options, :order_id)
31
-
32
- post = {}
33
- post[:paymentRequest] = payment_request(money, options)
34
- post[:paymentRequest][:amount] = amount_hash(money, options[:currency])
35
- post[:paymentRequest][:card] = credit_card_hash(creditcard)
36
-
37
- if address = (options[:billing_address] || options[:address])
38
- post[:paymentRequest][:billingAddress] = address_hash(address)
39
- end
40
-
41
- if options[:shipping_address]
42
- post[:paymentRequest][:deliveryAddress] = address_hash(options[:shipping_address])
43
- end
44
-
45
- commit('Payment.authorise', post)
46
- end
47
-
48
- def capture(money, authorization, options = {})
49
- requires!(options, :order_id)
50
-
51
- post = {}
52
- post[:modificationRequest] = modification_request(authorization, options)
53
- post[:modificationRequest][:modificationAmount] = amount_hash(money, options[:currency])
54
-
55
- commit('Payment.capture', post)
56
- end
57
-
58
- def refund(money, authorization, options = {})
59
- requires!(options, :order_id)
60
-
61
- post = {}
62
- post[:modificationRequest] = modification_request(authorization, options)
63
- post[:modificationRequest][:modificationAmount] = amount_hash(money, options[:currency])
64
-
65
- commit('Payment.refund', post)
66
- end
67
-
68
- def void(identification, options = {})
69
- requires!(options, :order_id)
70
-
71
- post = {}
72
- post[:modificationRequest] = modification_request(identification, options)
73
-
74
- commit('Payment.cancel', post)
75
- end
76
-
77
- def verify(creditcard, options = {})
78
- authorize(0, creditcard, options)
79
- end
80
-
81
- private
82
-
83
- def commit(action, post)
84
- request = post_data(flatten_hash(post.merge(:action => action)))
85
- raw_response = ssl_post(url, request, headers)
86
- response = parse(raw_response)
87
-
88
- Response.new(
89
- success_from(response),
90
- message_from(response),
91
- response,
92
- test: test?,
93
- authorization: response['pspReference']
94
- )
95
-
96
- rescue ResponseError => e
97
- case e.response.code
98
- when '401'
99
- return Response.new(false, 'Invalid credentials', {}, :test => test?)
100
- when '500'
101
- if e.response.body.split(' ')[0] == 'validation'
102
- return Response.new(false, e.response.body.split(' ', 3)[2], {}, :test => test?)
103
- end
104
- end
105
- raise
106
- end
107
-
108
- def flatten_hash(hash, prefix = nil)
109
- flat_hash = {}
110
- hash.each_pair do |key, val|
111
- conc_key = prefix.nil? ? key : "#{prefix}.#{key}"
112
- if val.is_a?(Hash)
113
- flat_hash.merge!(flatten_hash(val, conc_key))
114
- else
115
- flat_hash[conc_key] = val
116
- end
117
- end
118
- flat_hash
119
- end
120
-
121
- def headers
122
- {
123
- 'Authorization' => 'Basic ' + Base64.encode64("ws@Company.#{@options[:company]}:#{@options[:password]}").strip
124
- }
125
- end
126
-
127
- def parse(response)
128
- Hash[
129
- response.split('&').map do |x|
130
- key, val = x.split('=', 2)
131
- [key.split('.').last, CGI.unescape(val)]
132
- end
133
- ]
134
- end
135
-
136
- def post_data(data)
137
- data.map do |key, val|
138
- "#{key}=#{CGI.escape(val.to_s)}"
139
- end.reduce do |x, y|
140
- "#{x}&#{y}"
141
- end
142
- end
143
-
144
- def message_from(response)
145
- return response['resultCode'] if response.has_key?('resultCode') # Payment request
146
- return response['response'] if response['response'] # Modification request
147
- "Failure" # Negative fallback in case of error
148
- end
149
-
150
- def success_from(response)
151
- return true if response.has_key?('authCode')
152
-
153
- successful_responses = %w([capture-received] [cancel-received] [refund-received])
154
- successful_responses.include?(response['response'])
155
- end
156
-
157
- def url
158
- test? ? self.test_url : self.live_url
159
- end
160
-
161
- def address_hash(address)
162
- full_address = "#{address[:address1]} #{address[:address2]}"
163
-
164
- {
165
- :city => address[:city],
166
- :street => full_address.split(/\s+/).keep_if { |x| x !~ /\d/ }.join(' '),
167
- :houseNumberOrName => full_address.split(/\s+/).keep_if { |x| x =~ /\d/ }.join(' '),
168
- :postalCode => address[:zip],
169
- :stateOrProvince => address[:state],
170
- :country => address[:country]
171
- }
172
- end
173
-
174
- def amount_hash(money, currency)
175
- {
176
- :currency => (currency || currency(money)),
177
- :value => amount(money)
178
- }
179
- end
180
-
181
- def credit_card_hash(creditcard)
182
- {
183
- :cvc => creditcard.verification_value,
184
- :expiryMonth => format(creditcard.month, :two_digits),
185
- :expiryYear => format(creditcard.year, :four_digits),
186
- :holderName => creditcard.name,
187
- :number => creditcard.number
188
- }
189
- end
190
-
191
- def modification_request(reference, options)
192
- {
193
- :merchantAccount => @options[:merchant],
194
- :originalReference => reference
195
- }.keep_if { |_, v| v }
196
- end
197
-
198
- def payment_request(money, options)
199
- {
200
- :merchantAccount => @options[:merchant],
201
- :reference => options[:order_id],
202
- :shopperEmail => options[:email],
203
- :shopperIP => options[:ip],
204
- :shopperReference => options[:customer]
205
- }.keep_if { |_, v| v }
206
- end
207
- end
208
- end
209
- end
metadata.gz.sig DELETED
@@ -1 +0,0 @@
1
- r���!��ꗐ��u试e0�8�)���qDLe���\�})X�I֒�>\�<�Ce?r����÷z>g��EYL�2g�s&!��bE