paypal-recurring 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +1 -1
- data/lib/paypal/recurring/base.rb +15 -1
- data/lib/paypal/recurring/request.rb +5 -0
- data/lib/paypal/recurring/version.rb +1 -1
- data/spec/paypal/request_spec.rb +4 -0
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -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(
|
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
|
data/spec/paypal/request_spec.rb
CHANGED
@@ -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
|
+
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-
|
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: -
|
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: -
|
161
|
+
hash: -4543493111016794906
|
162
162
|
segments:
|
163
163
|
- 0
|
164
164
|
version: "0"
|