activemerchant 1.34.0 → 1.34.1

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,16 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.34.1 (June 28, 2013)
4
+
5
+ * WorldPay: Add dynamic return URL [jordanwheeler]
6
+ * Merchant One: New gateway [coteyr, melari]
7
+ * Balanced: Fix exception for invalid email [duff]
8
+ * Update supported countries for Paymill & PaymentExpress [duff]
9
+ * Worldpay: Add support for diners club [duff]
10
+ * Stripe: Include address with card data [melari]
11
+
12
+ == Version 1.34.0 (June 20, 2013)
13
+
3
14
  * PayPal Express gateway: Add unstore support [duff]
4
15
  * Stripe: Send application_fee with capture requests [melari]
5
16
  * Make #unstore method signature consistent across gateways [duff]
@@ -310,6 +310,7 @@ module ActiveMerchant #:nodoc:
310
310
  # lookup account from Balanced, account_uri should be in the
311
311
  # exception in a dictionary called extras
312
312
  account_uri = response['extras']['account_uri']
313
+ raise Error.new(response) unless account_uri
313
314
  end
314
315
  end
315
316
 
@@ -0,0 +1,115 @@
1
+ require "cgi"
2
+
3
+ module ActiveMerchant #:nodoc:
4
+ module Billing #:nodoc:
5
+ class MerchantOneGateway < Gateway
6
+
7
+ class MerchantOneSslConnection < ActiveMerchant::Connection
8
+ def configure_ssl(http)
9
+ super(http)
10
+ http.use_ssl = true
11
+ http.ssl_version = :SSLv3
12
+ end
13
+ end
14
+
15
+ BASE_URL = 'https://secure.merchantonegateway.com/api/transact.php'
16
+
17
+ self.supported_countries = ['US']
18
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
19
+ self.homepage_url = 'http://merchantone.com/'
20
+ self.display_name = 'Merchant One Gateway'
21
+ self.money_format = :dollars
22
+
23
+ def initialize(options = {})
24
+ requires!(options, :username, :password)
25
+ super
26
+ end
27
+
28
+ def authorize(money, creditcard, options = {})
29
+ post = {}
30
+ add_customer_data(post, options)
31
+ add_creditcard(post, creditcard)
32
+ add_address(post, creditcard, options)
33
+ add_customer_data(post, options)
34
+ add_amount(post, money, options)
35
+ commit('auth', money, post)
36
+ end
37
+
38
+ def purchase(money, creditcard, options = {})
39
+ post = {}
40
+ add_customer_data(post, options)
41
+ add_creditcard(post, creditcard)
42
+ add_address(post, creditcard, options)
43
+ add_customer_data(post, options)
44
+ add_amount(post, money, options)
45
+ commit('sale', money, post)
46
+ end
47
+
48
+ def capture(money, authorization, options = {})
49
+ post = {}
50
+ post.merge!(:transactionid => authorization)
51
+ add_amount(post, money, options)
52
+ commit('capture', money, post)
53
+ end
54
+
55
+ def new_connection(endpoint)
56
+ MerchantOneSslConnection.new(endpoint)
57
+ end
58
+
59
+ private
60
+
61
+ def add_customer_data(post, options)
62
+ post['firstname'] = options[:billing_address][:first_name]
63
+ post['lastname'] = options[:billing_address][:last_name]
64
+ end
65
+
66
+ def add_amount(post, money, options)
67
+ post['amount'] = amount(money)
68
+ end
69
+
70
+ def add_address(post, creditcard, options)
71
+ post['address1'] = options[:billing_address][:address1]
72
+ post['city'] = options[:billing_address][:city]
73
+ post['state'] = options[:billing_address][:state]
74
+ post['zip'] = options[:billing_address][:zip]
75
+ post['country'] = options[:billing_address][:country]
76
+ end
77
+
78
+ def add_creditcard(post, creditcard)
79
+ post['cvv'] = creditcard.verification_value
80
+ post['ccnumber'] = creditcard.number
81
+ post['ccexp'] = "#{sprintf("%02d", creditcard.month)}#{"#{creditcard.year}"[-2, 2]}"
82
+ end
83
+
84
+ def commit(action, money, parameters={})
85
+ parameters['username'] = @options[:username]
86
+ parameters['password'] = @options[:password]
87
+ parse(ssl_post(BASE_URL,post_data(action, parameters)))
88
+ end
89
+
90
+ def post_data(action, parameters = {})
91
+ parameters.merge!({:type => action})
92
+ ret = ""
93
+ for key in parameters.keys
94
+ ret += "#{key}=#{CGI.escape(parameters[key].to_s)}"
95
+ if key != parameters.keys.last
96
+ ret += "&"
97
+ end
98
+ end
99
+ ret.to_s
100
+ end
101
+
102
+ def parse(data)
103
+ responses = CGI.parse(data).inject({}){|h,(k, v)| h[k] = v.first; h}
104
+ Response.new(
105
+ (responses["response"].to_i == 1),
106
+ responses["responsetext"],
107
+ responses,
108
+ :test => test?,
109
+ :authorization => responses["transactionid"]
110
+ )
111
+ end
112
+ end
113
+ end
114
+ end
115
+
@@ -16,7 +16,7 @@ module ActiveMerchant #:nodoc:
16
16
  # However, regular accounts with DPS only support VISA and Mastercard
17
17
  self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club, :jcb ]
18
18
 
19
- self.supported_countries = %w[ AU MY NZ SG ZA GB US ]
19
+ self.supported_countries = %w[ AU CA DE ES FR GB HK IE MY NL NZ SG US ZA ]
20
20
 
21
21
  self.homepage_url = 'http://www.paymentexpress.com/'
22
22
  self.display_name = 'PaymentExpress'
@@ -1,9 +1,9 @@
1
1
  module ActiveMerchant #:nodoc:
2
2
  module Billing #:nodoc:
3
3
  class PaymillGateway < Gateway
4
- self.supported_countries = %w(AD AT BE CH CY CZ DE DK EE ES FI FO FR GB GR
5
- HU IE IL IS IT LI LT LU LV MT NL NO PL PT SE
6
- SI SK TR VA)
4
+ self.supported_countries = %w(AD AT BE BG CH CY CZ DE DK EE ES FI FO FR GB
5
+ GI GR HU IE IL IS IT LI LT LU LV MT NL NO PL
6
+ PT RO SE SI SK TR VA)
7
7
 
8
8
  self.supported_cardtypes = [:visa, :master]
9
9
  self.homepage_url = 'https://paymill.com'
@@ -158,6 +158,7 @@ module ActiveMerchant #:nodoc:
158
158
  card[:name] = creditcard.name if creditcard.name
159
159
  end
160
160
 
161
+ post[:card] = card
161
162
  add_address(post, options)
162
163
  elsif creditcard.kind_of?(String)
163
164
  if options[:track_data]
@@ -165,8 +166,8 @@ module ActiveMerchant #:nodoc:
165
166
  else
166
167
  card[:number] = creditcard
167
168
  end
169
+ post[:card] = card
168
170
  end
169
- post[:card] = card
170
171
  end
171
172
 
172
173
  def add_customer(post, options)
@@ -18,7 +18,8 @@ module ActiveMerchant #:nodoc:
18
18
  'american_express' => 'AMEX-SSL',
19
19
  'jcb' => 'JCB-SSL',
20
20
  'maestro' => 'MAESTRO-SSL',
21
- 'laser' => 'LASER-SSL'
21
+ 'laser' => 'LASER-SSL',
22
+ 'diners_club' => 'DINERS-SSL'
22
23
  }
23
24
 
24
25
  def initialize(options = {})
@@ -16,6 +16,7 @@ module ActiveMerchant #:nodoc:
16
16
 
17
17
  mapping :description, 'desc'
18
18
  mapping :notify_url, 'MC_callback'
19
+ mapping :return_url, 'MC_return'
19
20
 
20
21
 
21
22
  # WorldPay supports two different test modes - :always_succeed and :always_fail
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.34.0"
2
+ VERSION = "1.34.1"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.34.0
5
+ version: 1.34.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tobias Luetke
@@ -37,7 +37,7 @@ cert_chain:
37
37
  Z1BvU1BxN25rK3MyRlFVQko5VVpGSzFsZ016aG8vNGZaZ3pKd2J1K2NPOFNO
38
38
  dWFMUy9iagpoUGFTVHlWVTB5Q1Nudz09Ci0tLS0tRU5EIENFUlRJRklDQVRF
39
39
  LS0tLS0K
40
- date: 2013-06-20 00:00:00.000000000 Z
40
+ date: 2013-06-28 00:00:00.000000000 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,18 +138,18 @@ dependencies:
138
138
  - !ruby/object:Gem::Dependency
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
- - - ! '>='
141
+ - - <
142
142
  - !ruby/object:Gem::Version
143
- version: '0'
143
+ version: 1.6.0
144
144
  none: false
145
145
  name: nokogiri
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  requirement: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - <
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: 1.6.0
153
153
  none: false
154
154
  - !ruby/object:Gem::Dependency
155
155
  version_requirements: !ruby/object:Gem::Requirement
@@ -287,6 +287,7 @@ files:
287
287
  - lib/active_merchant/billing/gateways/linkpoint.rb
288
288
  - lib/active_merchant/billing/gateways/litle.rb
289
289
  - lib/active_merchant/billing/gateways/merchant_e_solutions.rb
290
+ - lib/active_merchant/billing/gateways/merchant_one.rb
290
291
  - lib/active_merchant/billing/gateways/merchant_ware.rb
291
292
  - lib/active_merchant/billing/gateways/merchant_warrior.rb
292
293
  - lib/active_merchant/billing/gateways/mercury.rb
metadata.gz.sig CHANGED
Binary file