paypal-recurring 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paypal-recurring (0.1.5)
4
+ paypal-recurring (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -11,6 +11,7 @@ module PayPal
11
11
  attr_accessor :initial_amount
12
12
  attr_accessor :initial_amount_action
13
13
  attr_accessor :ipn_url
14
+ attr_accessor :locale
14
15
  attr_accessor :outstanding
15
16
  attr_accessor :payer_id
16
17
  attr_accessor :period
@@ -45,7 +46,20 @@ module PayPal
45
46
  # response.checkout_url
46
47
  #
47
48
  def checkout
48
- params = collect(:amount, :return_url, :cancel_url, :currency, :description, :ipn_url).merge(:payment_action => "Authorization", :no_shipping => 1, :L_BILLINGTYPE0 => "RecurringPayments")
49
+ params = collect(
50
+ :locale,
51
+ :amount,
52
+ :return_url,
53
+ :cancel_url,
54
+ :currency,
55
+ :description,
56
+ :ipn_url
57
+ ).merge(
58
+ :payment_action => "Authorization",
59
+ :no_shipping => 1,
60
+ :L_BILLINGTYPE0 => "RecurringPayments"
61
+ )
62
+
49
63
  request.run(:checkout, params)
50
64
  end
51
65
 
@@ -45,6 +45,7 @@ module PayPal
45
45
  :initial_amount => "INITAMT",
46
46
  :initial_amount_action => "FAILEDINITAMTACTION",
47
47
  :ipn_url => ["PAYMENTREQUEST_0_NOTIFYURL", "NOTIFYURL"],
48
+ :locale => "LOCALECODE",
48
49
  :method => "METHOD",
49
50
  :no_shipping => "NOSHIPPING",
50
51
  :outstanding => "AUTOBILLOUTAMT",
@@ -163,6 +164,10 @@ module PayPal
163
164
  def build_initial_amount_action(value) # :nodoc:
164
165
  INITIAL_AMOUNT_ACTIONS.fetch(value.to_sym, value) if value
165
166
  end
167
+
168
+ def build_locale(value) # :nodoc:
169
+ value.to_s.upcase
170
+ end
166
171
  end
167
172
  end
168
173
  end
@@ -3,7 +3,7 @@ module PayPal
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 5
6
+ PATCH = 6
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  end
9
9
  end
@@ -111,5 +111,9 @@ describe PayPal::Recurring::Request do
111
111
  it "normalizes reference" do
112
112
  subject.normalize_params(:reference => "abc").should == {:PROFILEREFERENCE => "abc", :PAYMENTREQUEST_0_CUSTOM => "abc", :PAYMENTREQUEST_0_INVNUM => "abc"}
113
113
  end
114
+
115
+ it "normalizes locale" do
116
+ subject.normalize_params(:locale => :us).should == {:LOCALECODE => "US"}
117
+ end
114
118
  end
115
119
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: paypal-recurring
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.5
5
+ version: 0.1.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nando Vieira
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-06 00:00:00 Z
13
+ date: 2011-07-11 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -149,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
- hash: -54874171068176103
152
+ hash: -4543493111016794906
153
153
  segments:
154
154
  - 0
155
155
  version: "0"
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  requirements:
159
159
  - - ">="
160
160
  - !ruby/object:Gem::Version
161
- hash: -54874171068176103
161
+ hash: -4543493111016794906
162
162
  segments:
163
163
  - 0
164
164
  version: "0"