paypal-sdk-rest-pmrb 1.9.0 → 1.10.0
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/README.md +0 -4
- data/lib/paypal-sdk/core/api/data_types/base.rb +2 -1
- data/lib/paypal-sdk/core/api/data_types/simple_types.rb +4 -1
- data/lib/paypal-sdk/core/util/http_helper.rb +11 -1
- data/lib/paypal-sdk/rest/version.rb +1 -1
- data/spec/core/api/data_type_spec.rb +16 -0
- metadata +17 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fd03cce19fa0cf591f4dfa048a29c3c99661a4ec3b1f29cd254d41f6f0a72d3
|
|
4
|
+
data.tar.gz: 01b96bfc0d972e85c1e0ec22746b46004cc46ac35500e08ed094213db770efad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 22813888bca03c4cf1bbeff43158d76d4c1040f1ed497748f31cf4f2e4e371351ac25f093ea3c5c278ba746fddf71c03114ce53ee1a1edc9bef7238659ce66d0
|
|
7
|
+
data.tar.gz: cf1dc8b54a14892875749a218e077dfee33423fa765433695dac048826e68de0f90264f1c2b9922286c69580ab2818ba536b5a5b1a4a79cd256ba07a6ca411d9
|
data/README.md
CHANGED
|
@@ -23,10 +23,6 @@ PayPal has deprecated their [REST SDK][restsdk] and archived the corresponding [
|
|
|
23
23
|
## PayPal Checkout v2
|
|
24
24
|
We recommend that you integrate with API [v2/checkout/orders](https://developer.paypal.com/docs/api/orders/v2/) and [v2/payments](https://developer.paypal.com/docs/api/payments/v2/) whenever possible. Please refer to the [Checkout Ruby SDK](https://github.com/paypal/Checkout-Ruby-SDK) to continue with the integration.
|
|
25
25
|
|
|
26
|
-
## Prerequisites
|
|
27
|
-
- Ruby 2.0.0 or above
|
|
28
|
-
- Bundler
|
|
29
|
-
|
|
30
26
|
## Installation
|
|
31
27
|
|
|
32
28
|
Add this line to your application's Gemfile:
|
|
@@ -58,7 +58,8 @@ module PayPal::SDK::Core
|
|
|
58
58
|
end
|
|
59
59
|
default_value = ( options[:array] ? [] : ( klass < Base ? Util::OrderedHash.new : nil ) )
|
|
60
60
|
define_method member_name do |&block|
|
|
61
|
-
value = instance_variable_get(member_variable_name)
|
|
61
|
+
value = instance_variable_get(member_variable_name)
|
|
62
|
+
value = ( default_value && send("#{member_name}=", default_value) ) if value.nil?
|
|
62
63
|
value.instance_eval(&block) if block
|
|
63
64
|
value
|
|
64
65
|
end
|
|
@@ -29,7 +29,10 @@ module PayPal::SDK::Core
|
|
|
29
29
|
|
|
30
30
|
class Boolean
|
|
31
31
|
def self.new(boolean)
|
|
32
|
-
|
|
32
|
+
return false if boolean == false || boolean == 0 || boolean == ""
|
|
33
|
+
return false if boolean.is_a?(::String) && boolean =~ /^(false|f|no|n|0)$/i
|
|
34
|
+
|
|
35
|
+
!!boolean
|
|
33
36
|
end
|
|
34
37
|
end
|
|
35
38
|
|
|
@@ -37,11 +37,21 @@ module PayPal::SDK::Core
|
|
|
37
37
|
File.expand_path("../../../../../data/paypal.crt", __FILE__)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
# Build a certificate store with system defaults and bundled PayPal certs.
|
|
41
|
+
# This avoids pinning trust to only paypal.crt and works in environments
|
|
42
|
+
# where additional trusted roots are required.
|
|
43
|
+
def default_cert_store
|
|
44
|
+
OpenSSL::X509::Store.new.tap do |store|
|
|
45
|
+
store.set_default_paths
|
|
46
|
+
store.add_file(default_ca_file) if File.exist?(default_ca_file)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
40
50
|
# Apply ssl configuration to http object
|
|
41
51
|
def configure_ssl(http)
|
|
42
52
|
http.tap do |https|
|
|
43
53
|
https.use_ssl = true
|
|
44
|
-
https.
|
|
54
|
+
https.cert_store = default_cert_store
|
|
45
55
|
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
|
46
56
|
begin
|
|
47
57
|
https.ssl_version = :TLSv1_2
|
|
@@ -25,6 +25,11 @@ describe PayPal::SDK::Core::API::DataTypes::Base do
|
|
|
25
25
|
object_of :created_at, DateTime
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
class TestBooleanType < DataType
|
|
29
|
+
include PayPal::SDK::Core::API::DataTypes::SimpleTypes
|
|
30
|
+
object_of :is_active, Boolean
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
class Message < DataType
|
|
29
34
|
object_of :value, String
|
|
30
35
|
end
|
|
@@ -285,5 +290,16 @@ describe PayPal::SDK::Core::API::DataTypes::Base do
|
|
|
285
290
|
expect(test_simple_type.created_at).to be_a DateTime
|
|
286
291
|
end
|
|
287
292
|
|
|
293
|
+
it "should allow boolean true" do
|
|
294
|
+
test_simple_type = TestBooleanType.new( :is_active => true )
|
|
295
|
+
expect(test_simple_type.is_active).to be_a TrueClass
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
it "should allow boolean false" do
|
|
299
|
+
test_simple_type = TestBooleanType.new( :is_active => false )
|
|
300
|
+
puts "test_simple_type.is_active: #{test_simple_type.is_active.inspect}"
|
|
301
|
+
expect(test_simple_type.is_active).to be_a FalseClass
|
|
302
|
+
end
|
|
303
|
+
|
|
288
304
|
end
|
|
289
305
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paypal-sdk-rest-pmrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- PayPal
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: coveralls
|
|
@@ -24,6 +23,20 @@ dependencies:
|
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: base64
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
27
40
|
- !ruby/object:Gem::Dependency
|
|
28
41
|
name: xml-simple
|
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +79,6 @@ dependencies:
|
|
|
66
79
|
- - ">="
|
|
67
80
|
- !ruby/object:Gem::Version
|
|
68
81
|
version: '0'
|
|
69
|
-
description:
|
|
70
82
|
email:
|
|
71
83
|
- piers@varyonic.com
|
|
72
84
|
executables: []
|
|
@@ -148,7 +160,6 @@ homepage: https://github.com/paypal-merchants-rb/PayPal-Ruby-SDK
|
|
|
148
160
|
licenses:
|
|
149
161
|
- PayPal SDK License
|
|
150
162
|
metadata: {}
|
|
151
|
-
post_install_message:
|
|
152
163
|
rdoc_options: []
|
|
153
164
|
require_paths:
|
|
154
165
|
- lib
|
|
@@ -163,8 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
163
174
|
- !ruby/object:Gem::Version
|
|
164
175
|
version: '0'
|
|
165
176
|
requirements: []
|
|
166
|
-
rubygems_version: 3.
|
|
167
|
-
signing_key:
|
|
177
|
+
rubygems_version: 3.6.7
|
|
168
178
|
specification_version: 4
|
|
169
179
|
summary: The PayPal REST SDK provides Ruby APIs to create, process and manage payment.
|
|
170
180
|
test_files:
|