paypal-rest-api 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/paypal-api/request.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb41159069ce06e4af428ec51fd553c176383626ac51eae019484f7bf65d22c8
|
4
|
+
data.tar.gz: 6c91629dd7dc266198642ae2ed4606c764cf8e376a39695fb7fbdf5ebfd22e28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dfa83c73dbf06ac3badf8151241baa837a075f17bbe40927b8b1280bbff3867bdf8da3b4ed2e4b4126530767019aabf82899941edc0efeccdca42eba7d597e5
|
7
|
+
data.tar.gz: '08df1fc1d94b9c395e684a366aed64c50f94a2e357ee1d0ddb0894ba2bd5db7a2a8513799caa6138c87784fe1932f7bbcd8028f0c679e843fa9f0cfbe9b97f69'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.1
|
data/lib/paypal-api/request.rb
CHANGED
@@ -74,7 +74,6 @@ module PaypalAPI
|
|
74
74
|
def build_http_request(request_type, path, body:, query:, headers:)
|
75
75
|
uri = build_http_uri(path, query)
|
76
76
|
http_request = request_type.new(uri, "accept-encoding" => nil)
|
77
|
-
|
78
77
|
build_http_headers(http_request, body, headers || {})
|
79
78
|
build_http_body(http_request, body)
|
80
79
|
|
@@ -88,8 +87,18 @@ module PaypalAPI
|
|
88
87
|
http_request["authorization"] = client.access_token.authorization_string
|
89
88
|
end
|
90
89
|
|
90
|
+
#
|
91
|
+
# We should set json content type header to not get 415 UnsupportedMediaType
|
92
|
+
# error in various APIs
|
93
|
+
#
|
94
|
+
# PayPal requires "application/json" content type even for GET requests
|
95
|
+
# and for POST requests without body.
|
96
|
+
#
|
97
|
+
# Net::HTTP sets default content-type "application/x-www-form-urlencoded"
|
98
|
+
# if not provided
|
99
|
+
#
|
91
100
|
unless headers.key?("content-type")
|
92
|
-
http_request["content-type"] = "application/json"
|
101
|
+
http_request["content-type"] = "application/json"
|
93
102
|
end
|
94
103
|
|
95
104
|
unless headers.key?("paypal-request-id")
|