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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28512c971927c8c403fdfdc61e9203fa1b0d927f118531a75525f7b8eeb4c930
4
- data.tar.gz: 89d2613783b9ab46df9ee4b6c4f7aa4018156183e733ddb89be3d002c7b553bd
3
+ metadata.gz: 1fd03cce19fa0cf591f4dfa048a29c3c99661a4ec3b1f29cd254d41f6f0a72d3
4
+ data.tar.gz: 01b96bfc0d972e85c1e0ec22746b46004cc46ac35500e08ed094213db770efad
5
5
  SHA512:
6
- metadata.gz: 0064c25823519a40b1b7a795d1f738e25fbf25007248d845f6392dd6b3a7920583d8d3e741942f3305905f642ba43bdcfef0b43ccae8612a05ebeb8328ec3dc7
7
- data.tar.gz: efae1d0719bbac88cdc0ca8ab9197db516085206c9a29bd1c3730c9bbba20a2195a16708687bf5171eedc42793f85b3c028fc6601bc6009284c706eaf419bb24
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) || ( default_value && send("#{member_name}=", default_value) )
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
- ( boolean == 0 || boolean == "" || boolean =~ /^(false|f|no|n|0)$/i ) ? false : !!boolean
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.ca_file = default_ca_file
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
@@ -1,7 +1,7 @@
1
1
  module PayPal
2
2
  module SDK
3
3
  module REST
4
- VERSION = "1.9.0"
4
+ VERSION = "1.10.0"
5
5
  end
6
6
  end
7
7
  end
@@ -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.9.0
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: 2024-12-14 00:00:00.000000000 Z
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.4.19
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: