paypalhttp 1.0.1 → 2.0.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/lib/paypalhttp/serializers/form_encoded.rb +2 -2
- data/lib/paypalhttp/version.rb +1 -1
- data/spec/paypalhttp/encoder_spec.rb +18 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 910250d5540f67f211cda11bc4c0565ec3bbc4063277198b72fddf66a9a7f8db
|
4
|
+
data.tar.gz: a4574de9deaeed11f0808e0a38ad0ef5c9ad5628f9df8e6657cd1b9340279eaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7626a3dc47b0417902ea12147a4982b0acb39b3fe1e09aeaa0748de48aa5fa1a98cdcbeeb3a1b0f96205de58b21be735033f0154970121235948895be2c05d85
|
7
|
+
data.tar.gz: 0f01023ab3a9def51632d37a086e531cba7eec02007bc112273defd5d086f488f59a664e591f447332cad1e81e4de489dbc22de8ca0759869b9f4d479daf32d8
|
@@ -1,11 +1,11 @@
|
|
1
|
-
require '
|
1
|
+
require 'cgi'
|
2
2
|
|
3
3
|
module PayPalHttp
|
4
4
|
class FormEncoded
|
5
5
|
def encode(request)
|
6
6
|
encoded_params = []
|
7
7
|
request.body.each do |k, v|
|
8
|
-
encoded_params.push("#{
|
8
|
+
encoded_params.push("#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}")
|
9
9
|
end
|
10
10
|
|
11
11
|
encoded_params.join("&")
|
data/lib/paypalhttp/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION = "
|
1
|
+
VERSION = "2.0.0"
|
@@ -105,7 +105,24 @@ describe Encoder do
|
|
105
105
|
})
|
106
106
|
serialized = Encoder.new.serialize_request(req)
|
107
107
|
|
108
|
-
expect(serialized).to eq("key=value
|
108
|
+
expect(serialized).to eq("key=value+with+a+space&another_key=1013")
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'encodes different special/unsafe characters when using CGI.escape' do
|
112
|
+
req = OpenStruct.new({
|
113
|
+
:verb => "POST",
|
114
|
+
:path => "/v1/api",
|
115
|
+
:headers => {
|
116
|
+
"content-type" => "application/x-www-form-urlencoded; charset=utf8"
|
117
|
+
},
|
118
|
+
:body => {
|
119
|
+
:key => " ..<..>..%..{..}..|../..^..`..!",
|
120
|
+
:another_key => 1013,
|
121
|
+
}
|
122
|
+
})
|
123
|
+
serialized = Encoder.new.serialize_request(req)
|
124
|
+
|
125
|
+
expect(serialized).to eq("key=+..%3C..%3E..%25..%7B..%7D..%7C..%2F..%5E..%60..%21&another_key=1013")
|
109
126
|
end
|
110
127
|
|
111
128
|
it 'throws when content-type is unsupported' do
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypalhttp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPal
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Used for generated API clients
|
14
|
-
email:
|
14
|
+
email:
|
15
15
|
executables: []
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
@@ -33,11 +33,11 @@ files:
|
|
33
33
|
- spec/paypalhttp/serializers/form_part_spec.rb
|
34
34
|
- spec/paypalhttp/serializers/multipart_spec.rb
|
35
35
|
- spec/spec_helper.rb
|
36
|
-
homepage:
|
36
|
+
homepage:
|
37
37
|
licenses:
|
38
38
|
- MIT
|
39
39
|
metadata: {}
|
40
|
-
post_install_message:
|
40
|
+
post_install_message:
|
41
41
|
rdoc_options: []
|
42
42
|
require_paths:
|
43
43
|
- lib
|
@@ -52,8 +52,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
|
-
rubygems_version: 3.0.
|
56
|
-
signing_key:
|
55
|
+
rubygems_version: 3.0.3.1
|
56
|
+
signing_key:
|
57
57
|
specification_version: 4
|
58
58
|
summary: PayPalHttp Client Library
|
59
59
|
test_files: []
|