creative-paypal-express 1.2.0 → 1.2.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/paypal/express/request.rb +2 -1
- data/spec/paypal/express/request_spec.rb +23 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b6637908ce92f01757f3561a0835d86e667ce2
|
4
|
+
data.tar.gz: c3c7ca0dde27ed7f3e43bc18f7e6328fdf75c99a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 320892ab92f76b77fef75b53044c77f10c1fa3a153ad41ea0cfaf137d6e794f33827adf5f47603c451fae7e98df2f038516a1f10b4f422fb3ecdd1245e97947d
|
7
|
+
data.tar.gz: 06323e9c79aea9270dc3665c054ebd56854ec62dee1dc012804a98cc75f1de0691c8cb6bf2d325a7de2be8b4f61297cfaeadd201c5a620b370ad5f829f6e4b8e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## v1.2.1
|
2
|
+
__Updated:__
|
3
|
+
- Subscription amendment now takes mandatory currency_code option.
|
4
|
+
|
5
|
+
```rb
|
6
|
+
Paypal::Express::Request.new(params).amend!("profile_id", {amount: 19.95, currency_code: "EUR", note: "will show up in email and profile logs"})
|
7
|
+
```
|
8
|
+
|
1
9
|
## v1.2.0
|
2
10
|
__Added:__
|
3
11
|
- Ability to amend a created paypal subscription (its amount)
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
@@ -135,7 +135,8 @@ module Paypal
|
|
135
135
|
:PROFILEID => profile_id,
|
136
136
|
:NOTE => options[:note],
|
137
137
|
:AMT => options[:amount].presence || (raise ArgumentError.new(":amount option missing!")), # Paypal accepts 19.95 type decimals
|
138
|
-
|
138
|
+
:CURRENCYCODE => options[:currency_code].presence || (raise ArgumentError.new(":currency_code option missing!")), # "EUR"
|
139
|
+
}.select{|k, v| v.present?}
|
139
140
|
|
140
141
|
response = request(:UpdateRecurringPaymentsProfile, params)
|
141
142
|
return Response.new(response)
|
@@ -489,21 +489,36 @@ describe Paypal::Express::Request do
|
|
489
489
|
end
|
490
490
|
|
491
491
|
describe "#amend!(profile_id, options={})" do
|
492
|
-
|
493
|
-
|
492
|
+
context "when calling with mandatory options missing" do
|
493
|
+
it "should raise ArgumentError" do
|
494
|
+
expect{instance.amend!('profile_id', {currency_code: "EUR"})}.to raise_error(ArgumentError, ":amount option missing!")
|
495
|
+
expect{instance.amend!('profile_id', {amount: 19.95})}.to raise_error(ArgumentError, ":currency_code option missing!")
|
496
|
+
end
|
497
|
+
end
|
498
|
+
|
499
|
+
context "when calling with note option" do
|
500
|
+
it "should call UpdateRecurringPaymentsProfile with correct method and params" do
|
501
|
+
expect{instance.amend!('profile_id', {note: "test changes", amount: 19.95, currency_code: "EUR"})}.
|
502
|
+
to request_to(nvp_endpoint, :post)
|
503
|
+
|
504
|
+
expect(instance._method_).to eq :UpdateRecurringPaymentsProfile
|
505
|
+
expect(instance._sent_params_).to eq({:PROFILEID => 'profile_id', :NOTE => "test changes", CURRENCYCODE: "EUR", :AMT => 19.95})
|
506
|
+
end
|
494
507
|
end
|
495
508
|
|
496
|
-
|
497
|
-
|
498
|
-
|
509
|
+
context "when calling without note option" do
|
510
|
+
it "should call UpdateRecurringPaymentsProfile with correct method and params" do
|
511
|
+
expect{instance.amend!('profile_id', {amount: 19.95, currency_code: "EUR"})}.
|
512
|
+
to request_to(nvp_endpoint, :post)
|
499
513
|
|
500
|
-
|
501
|
-
|
514
|
+
expect(instance._method_).to eq :UpdateRecurringPaymentsProfile
|
515
|
+
expect(instance._sent_params_).to eq({:PROFILEID => 'profile_id', CURRENCYCODE: "EUR", :AMT => 19.95})
|
516
|
+
end
|
502
517
|
end
|
503
518
|
|
504
519
|
it 'should return Paypal::Express::Response' do
|
505
520
|
fake_response 'UpdateRecurringPaymentsProfile/success'
|
506
|
-
response = instance.amend!('profile_id', {note: "test changes", amount: 19.95})
|
521
|
+
response = instance.amend!('profile_id', {note: "test changes", currency_code: "EUR", amount: 19.95})
|
507
522
|
|
508
523
|
expect(response.class).to eq Paypal::Express::Response
|
509
524
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: creative-paypal-express
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-02-
|
12
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|