paypal-sdk-rest 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/paypal-sdk/core/openid_connect.rb +18 -0
- data/lib/paypal-sdk/core/util/http_helper.rb +2 -0
- data/lib/paypal-sdk/rest/data_types.rb +25 -13
- data/lib/paypal-sdk/rest/version.rb +1 -1
- data/spec/README.md +1 -1
- data/spec/core/api/rest_spec.rb +1 -1
- data/spec/log/http.log +0 -107
- data/spec/log/rest_http.log +22 -93
- data/spec/payments_examples_spec.rb +17 -5
- data/spec/subscription_examples_spec.rb +1 -1
- data/spec/web_profile_examples_spec.rb +1 -1
- 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: 56a51c751103c35d5b89fae2c5f706cbc6d52538
|
4
|
+
data.tar.gz: 3d0891c29c2cf27a44908b16ae784620c8fc957d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f32d3aa53f21ac022debe5a4723676a7e0af39ceca7b4589bfd2c27733d4f5a5c20f6b59b11939e89bc9cd08ebbeef9cf9e123176558377653f961b4d694065
|
7
|
+
data.tar.gz: 48bf8528e105b3f7c578f5809e0020d8b2d8c256d6f7226eacbd48ade7adb1087b1dbcc2db6c8d992abb4ba7df4349adc6a3a7591bfc98d4d33700fb24dfdebe
|
data/README.md
CHANGED
@@ -131,7 +131,7 @@ PayPal::SDK::REST.set_config(
|
|
131
131
|
:funding_instruments => [{
|
132
132
|
:credit_card => {
|
133
133
|
:type => "visa",
|
134
|
-
:number => "
|
134
|
+
:number => "4567516310777851",
|
135
135
|
:expire_month => "11",
|
136
136
|
:expire_year => "2018",
|
137
137
|
:cvv2 => "874",
|
@@ -191,7 +191,7 @@ end
|
|
191
191
|
```
|
192
192
|
|
193
193
|
## Create Future Payment
|
194
|
-
[Future Payments](https://developer.paypal.com/docs/integration/mobile/make-future-payment/) sample is available [here](https://github.com/paypal/rest-api-sdk-ruby/blob/master/
|
194
|
+
[Future Payments](https://developer.paypal.com/docs/integration/mobile/make-future-payment/) sample is available [here](https://github.com/paypal/rest-api-sdk-ruby/blob/master/samples/payment/create_future_payment.rb#L149)
|
195
195
|
|
196
196
|
## Webhook event validation
|
197
197
|
See [webhook event validation code sample](https://github.com/paypal/PayPal-Ruby-SDK/blob/master/samples/notifications/verify_webhook_event.rb) and [webhook event validation docs](https://developer.paypal.com/docs/integration/direct/rest-webhooks-overview/#event-signature)
|
@@ -55,8 +55,16 @@ module PayPal::SDK
|
|
55
55
|
class Tokeninfo < Base
|
56
56
|
include RequestDataType
|
57
57
|
PATH = "v1/identity/openidconnect/tokenservice"
|
58
|
+
FP_PATH = "v1/oauth2/token"
|
58
59
|
|
59
60
|
class << self
|
61
|
+
|
62
|
+
def basic_auth_header(options)
|
63
|
+
credentials = options[:client_id].to_s + ":" + options[:client_secret].to_s
|
64
|
+
encoded = Base64.encode64(credentials.force_encoding('UTF-8')).gsub!(/\n/, "")
|
65
|
+
"Basic #{encoded}"
|
66
|
+
end
|
67
|
+
|
60
68
|
def create_from_authorization_code(options, http_header = {})
|
61
69
|
options = { :code => options } if options.is_a? String
|
62
70
|
options = options.merge( :grant_type => "authorization_code" )
|
@@ -71,6 +79,16 @@ module PayPal::SDK
|
|
71
79
|
end
|
72
80
|
alias_method :refresh, :create_from_refresh_token
|
73
81
|
|
82
|
+
def create_from_future_payment_auth_code(options, http_header = {})
|
83
|
+
options = { :code => options } if options.is_a? String
|
84
|
+
options = options.merge( { :grant_type => "authorization_code", :response_type => "token", :redirect_uri => "urn:ietf:wg:oauth:2.0:oob" } )
|
85
|
+
http_header = http_header.merge( { "Content-Type" => "application/x-www-form-urlencoded", "Authorization" => basic_auth_header(with_credentials(options)) } )
|
86
|
+
|
87
|
+
Tokeninfo.new(api.post(FP_PATH, options, http_header))
|
88
|
+
end
|
89
|
+
alias_method :token_hash, :create_from_future_payment_auth_code
|
90
|
+
alias_method :create_fp, :create_from_future_payment_auth_code
|
91
|
+
|
74
92
|
def with_credentials(options = {})
|
75
93
|
options = options.dup
|
76
94
|
[ :client_id, :client_secret ].each do |key|
|
@@ -89,10 +89,12 @@ module PayPal::SDK::Core
|
|
89
89
|
# * payload - Hash(:http, :method, :uri, :body, :header)
|
90
90
|
def log_http_call(payload)
|
91
91
|
logger.info "Request[#{payload[:method]}]: #{payload[:uri].to_s}"
|
92
|
+
logger.debug "Request.body=#{payload[:body]}\trequest.header=#{payload[:header]}"
|
92
93
|
start_time = Time.now
|
93
94
|
response = yield
|
94
95
|
logger.info sprintf("Response[%s]: %s, Duration: %.3fs", response.code,
|
95
96
|
response.message, Time.now - start_time)
|
97
|
+
logger.debug "Response.body: #{response.body}"
|
96
98
|
response
|
97
99
|
end
|
98
100
|
|
@@ -99,16 +99,6 @@ module PayPal::SDK
|
|
99
99
|
|
100
100
|
class FuturePayment < Payment
|
101
101
|
|
102
|
-
include PayPal::SDK::OpenIDConnect
|
103
|
-
|
104
|
-
def self.exch_token(auth_code)
|
105
|
-
if auth_code
|
106
|
-
tokeninfo = Tokeninfo.create(auth_code)
|
107
|
-
puts "tokeninfo=", tokeninfo.to_hash
|
108
|
-
tokeninfo
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
102
|
def create(correlation_id=nil)
|
113
103
|
path = "v1/payments/payment"
|
114
104
|
if correlation_id != nil
|
@@ -120,6 +110,18 @@ module PayPal::SDK
|
|
120
110
|
self.merge!(response)
|
121
111
|
success?
|
122
112
|
end
|
113
|
+
|
114
|
+
class << self
|
115
|
+
|
116
|
+
def exch_token(auth_code)
|
117
|
+
if auth_code
|
118
|
+
PayPal::SDK::OpenIDConnect::DataTypes::Tokeninfo.token_hash(auth_code)
|
119
|
+
else
|
120
|
+
raise ArgumentError.new("authorization code required") if auth_code.to_s.strip.empty?
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
123
125
|
end
|
124
126
|
|
125
127
|
class Payer < Base
|
@@ -892,9 +894,19 @@ module PayPal::SDK
|
|
892
894
|
|
893
895
|
class CreditCardList < Base
|
894
896
|
def self.load_members
|
895
|
-
array_of :
|
896
|
-
object_of :
|
897
|
-
object_of :
|
897
|
+
array_of :items, CreditCard
|
898
|
+
object_of :total_items, Integer
|
899
|
+
object_of :total_pages, Integer
|
900
|
+
array_of :links, Links
|
901
|
+
end
|
902
|
+
|
903
|
+
class << self
|
904
|
+
def list(options={})
|
905
|
+
# for entire list of filter options, see https://developer.paypal.com/webapps/developer/docs/api/#list-credit-card-resources
|
906
|
+
path = "v1/vault/credit-cards"
|
907
|
+
response = api.get(path, options)
|
908
|
+
self.new(response)
|
909
|
+
end
|
898
910
|
end
|
899
911
|
end
|
900
912
|
|
data/spec/README.md
CHANGED
data/spec/core/api/rest_spec.rb
CHANGED
@@ -97,7 +97,7 @@ describe PayPal::SDK::Core::API::REST do
|
|
97
97
|
"funding_instruments" => [{
|
98
98
|
"credit_card" => {
|
99
99
|
"type" => "visa",
|
100
|
-
"number" => "
|
100
|
+
"number" => "4567516310777851",
|
101
101
|
"expire_month" => "11", "expire_year" => "2018",
|
102
102
|
"first_name" => "Joe", "last_name" => "Shopper" }}]},
|
103
103
|
"transactions" => [{
|
data/spec/log/http.log
CHANGED
@@ -1,107 +0,0 @@
|
|
1
|
-
opening connection to api.sandbox.paypal.com:443...
|
2
|
-
opened
|
3
|
-
starting SSL for api.sandbox.paypal.com:443...
|
4
|
-
SSL established
|
5
|
-
<- "POST /v1/notifications/webhooks HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 18a117b6-aa14-4705-bf80-d9fe6552a133\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 161\r\n\r\n"
|
6
|
-
<- "{\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\"}]}"
|
7
|
-
-> "HTTP/1.1 201 Created\r\n"
|
8
|
-
-> "Date: Mon, 29 Jun 2015 00:16:47 GMT\r\n"
|
9
|
-
-> "Server: Apache\r\n"
|
10
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=199\r\n"
|
11
|
-
-> "Paypal-Debug-Id: ca3b32418d9db\r\n"
|
12
|
-
-> "Content-Language: *\r\n"
|
13
|
-
-> "Content-Length: 650\r\n"
|
14
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1871614037; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
15
|
-
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
16
|
-
-> "Vary: Authorization\r\n"
|
17
|
-
-> "Connection: close\r\n"
|
18
|
-
-> "Content-Type: application/json\r\n"
|
19
|
-
-> "\r\n"
|
20
|
-
reading 650 bytes...
|
21
|
-
-> "{\"id\":\"50T98599JH617711K\",\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"delete\",\"method\":\"DELETE\"}]}"
|
22
|
-
read 650 bytes
|
23
|
-
Conn close
|
24
|
-
opening connection to api.sandbox.paypal.com:443...
|
25
|
-
opened
|
26
|
-
starting SSL for api.sandbox.paypal.com:443...
|
27
|
-
SSL established
|
28
|
-
<- "GET /v1/notifications/webhooks/50T98599JH617711K HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
|
29
|
-
-> "HTTP/1.1 200 OK\r\n"
|
30
|
-
-> "Date: Mon, 29 Jun 2015 00:16:47 GMT\r\n"
|
31
|
-
-> "Server: Apache\r\n"
|
32
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=528494\r\n"
|
33
|
-
-> "Paypal-Debug-Id: 655c05e28d8fa\r\n"
|
34
|
-
-> "Content-Language: *\r\n"
|
35
|
-
-> "Content-Length: 650\r\n"
|
36
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1871614037; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
37
|
-
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
38
|
-
-> "Vary: Authorization\r\n"
|
39
|
-
-> "Connection: close\r\n"
|
40
|
-
-> "Content-Type: application/json\r\n"
|
41
|
-
-> "\r\n"
|
42
|
-
reading 650 bytes...
|
43
|
-
-> "{\"id\":\"50T98599JH617711K\",\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"delete\",\"method\":\"DELETE\"}]}"
|
44
|
-
read 650 bytes
|
45
|
-
Conn close
|
46
|
-
opening connection to api.sandbox.paypal.com:443...
|
47
|
-
opened
|
48
|
-
starting SSL for api.sandbox.paypal.com:443...
|
49
|
-
SSL established
|
50
|
-
<- "GET /v1/notifications/webhooks HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
|
51
|
-
-> "HTTP/1.1 200 OK\r\n"
|
52
|
-
-> "Date: Mon, 29 Jun 2015 00:16:48 GMT\r\n"
|
53
|
-
-> "Server: Apache\r\n"
|
54
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=600\r\n"
|
55
|
-
-> "Paypal-Debug-Id: 666c52848db49\r\n"
|
56
|
-
-> "Content-Language: *\r\n"
|
57
|
-
-> "Content-Length: 1311\r\n"
|
58
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1888391253; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
59
|
-
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
60
|
-
-> "Vary: Authorization\r\n"
|
61
|
-
-> "Connection: close\r\n"
|
62
|
-
-> "Content-Type: application/json\r\n"
|
63
|
-
-> "\r\n"
|
64
|
-
reading 1311 bytes...
|
65
|
-
-> "{\"webhooks\":[{\"id\":\"8VM94926UH399150D\",\"url\":\"https://requestb.in/10ujt3c1?uniqid=558f54001056e\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/8VM94926UH399150D\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/8VM94926UH399150D\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/8VM94926UH399150D\",\"rel\":\"delete\",\"method\":\"DELETE\"}]},{\"id\":\"50T98599JH617711K\",\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"delete\",\"method\":\"DELETE\"}]}]}"
|
66
|
-
read 1311 bytes
|
67
|
-
Conn close
|
68
|
-
opening connection to api.sandbox.paypal.com:443...
|
69
|
-
opened
|
70
|
-
starting SSL for api.sandbox.paypal.com:443...
|
71
|
-
SSL established
|
72
|
-
<- "GET /v1/notifications/webhooks/50T98599JH617711K/event-types HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
|
73
|
-
-> "HTTP/1.1 200 OK\r\n"
|
74
|
-
-> "Date: Mon, 29 Jun 2015 00:16:49 GMT\r\n"
|
75
|
-
-> "Server: Apache\r\n"
|
76
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=526559\r\n"
|
77
|
-
-> "Paypal-Debug-Id: 748c1aeb8d5ba\r\n"
|
78
|
-
-> "Content-Language: *\r\n"
|
79
|
-
-> "Content-Length: 201\r\n"
|
80
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1905168469; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
81
|
-
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
82
|
-
-> "Vary: Authorization\r\n"
|
83
|
-
-> "Connection: close\r\n"
|
84
|
-
-> "Content-Type: application/json\r\n"
|
85
|
-
-> "\r\n"
|
86
|
-
reading 201 bytes...
|
87
|
-
-> "{\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}]}"
|
88
|
-
read 201 bytes
|
89
|
-
Conn close
|
90
|
-
opening connection to api.sandbox.paypal.com:443...
|
91
|
-
opened
|
92
|
-
starting SSL for api.sandbox.paypal.com:443...
|
93
|
-
SSL established
|
94
|
-
<- "DELETE /v1/notifications/webhooks/50T98599JH617711K HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
|
95
|
-
-> "HTTP/1.1 204 No Content\r\n"
|
96
|
-
-> "Date: Mon, 29 Jun 2015 00:16:49 GMT\r\n"
|
97
|
-
-> "Server: Apache\r\n"
|
98
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=624\r\n"
|
99
|
-
-> "Paypal-Debug-Id: 594920158d7fe\r\n"
|
100
|
-
-> "Content-Language: *\r\n"
|
101
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1905168469; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
102
|
-
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
103
|
-
-> "Vary: Authorization\r\n"
|
104
|
-
-> "Connection: close\r\n"
|
105
|
-
-> "Content-Type: text/plain; charset=ISO-8859-1\r\n"
|
106
|
-
-> "\r\n"
|
107
|
-
Conn close
|
data/spec/log/rest_http.log
CHANGED
@@ -2,116 +2,45 @@ opening connection to api.sandbox.paypal.com:443...
|
|
2
2
|
opened
|
3
3
|
starting SSL for api.sandbox.paypal.com:443...
|
4
4
|
SSL established
|
5
|
-
<- "
|
6
|
-
|
7
|
-
-> "
|
8
|
-
-> "Date: Wed, 17 Jun 2015 16:03:02 GMT\r\n"
|
9
|
-
-> "Server: Apache\r\n"
|
10
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=205660\r\n"
|
11
|
-
-> "Paypal-Debug-Id: 4902c6a25a289\r\n"
|
12
|
-
-> "Content-Language: *\r\n"
|
13
|
-
-> "Connection: close\r\n"
|
14
|
-
-> "Connection: close\r\n"
|
15
|
-
-> "Content-Length: 185\r\n"
|
16
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D916095317; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
17
|
-
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
18
|
-
-> "Vary: Authorization\r\n"
|
19
|
-
-> "Content-Type: application/json\r\n"
|
20
|
-
-> "\r\n"
|
21
|
-
reading 185 bytes...
|
22
|
-
-> "{\"name\":\"UNKNOWN_ERROR\",\"message\":\"An unknown error has occurred\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#UNKNOWN_ERROR\",\"debug_id\":\"4902c6a25a289\"}"
|
23
|
-
read 185 bytes
|
24
|
-
Conn close
|
25
|
-
opening connection to api.sandbox.paypal.com:443...
|
26
|
-
opened
|
27
|
-
starting SSL for api.sandbox.paypal.com:443...
|
28
|
-
SSL established
|
29
|
-
<- "GET /v1/payments/payment?count=10 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015DOFRpuzFpZfHX0ilj8893ElG2peUPhPPO1bzZaUlDTE\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
|
30
|
-
-> "HTTP/1.1 200 OK\r\n"
|
31
|
-
-> "Date: Wed, 17 Jun 2015 16:03:14 GMT\r\n"
|
5
|
+
<- "GET /v1/payments/payment/PAY-1234 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015L7-5a9a9WxiKZ3.imHj5JgriF7lV8prm0ZYyamGCGoI\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 1.3.1 (paypal-sdk-core 1.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
|
6
|
+
-> "HTTP/1.1 404 Not Found\r\n"
|
7
|
+
-> "Date: Thu, 02 Jul 2015 18:51:07 GMT\r\n"
|
32
8
|
-> "Server: Apache\r\n"
|
33
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=
|
34
|
-
-> "Paypal-Debug-Id:
|
9
|
+
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=476\r\n"
|
10
|
+
-> "Paypal-Debug-Id: 1ad36fab73506\r\n"
|
35
11
|
-> "Content-Language: *\r\n"
|
36
|
-
-> "
|
12
|
+
-> "Content-Length: 207\r\n"
|
13
|
+
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D461935957; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
37
14
|
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
38
15
|
-> "Vary: Authorization\r\n"
|
39
16
|
-> "Connection: close\r\n"
|
40
|
-
-> "Transfer-Encoding: chunked\r\n"
|
41
17
|
-> "Content-Type: application/json\r\n"
|
42
18
|
-> "\r\n"
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
-> "{\"payments\":[{\"id\":\"PAY-4RG04167Y3679044FKWAZUJA\",\"create_time\":\"2015-06-17T16:02:44Z\",\"update_time\":\"2015-06-17T16:02:46Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"55819a94a9f6d\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"1S363116N1212452J\",\"create_time\":\"2015-06-17T16:02:44Z\",\"update_time\":\"2015-06-17T16:02:46Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-4RG04167Y3679044FKWAZUJA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/1S363116N1212452J\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/1S363116N1212452J/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-4RG04167Y3679044FKWAZUJA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-4RG04167Y3679044FKWAZUJA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-94W42352G3625413LKWAZFEA\",\"create_time\":\"2015-06-17T15:30:24Z\",\"update_time\":\"2015-06-17T15:30:26Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581928f8dd0c\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"7EG93024KM342302E\",\"create_time\":\"2015-06-17T15:30:24Z\",\"update_time\":\"2015-06-17T15:30:26Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-94W42352G3625413LKWAZFEA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7EG93024KM342302E\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7EG93024KM342302E/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-94W42352G3625413LKWAZFEA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-94W42352G3625413LKWAZFEA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-78S39199MJ676670TKWAZE3I\",\"create_time\":\"2015-06-17T15:29:49Z\",\"update_time\":\"2015-06-17T15:29:51Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581926cd1ef2\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"4FV54189LD8932322\",\"create_time\":\"2015-06-17T15:29:49Z\",\"update_time\":\"2015-06-17T15:29:51Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-78S39199MJ676670TKWAZE3I\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4FV54189LD8932322\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4FV54189LD8932322/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-78S39199MJ676670TKWAZE3I\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-78S39199MJ676670TKWAZE3I\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-9DN27361C2703300EKWAZDIQ\",\"create_time\":\"2015-06-17T15:26:26Z\",\"update_time\":\"2015-06-17T15:26:28Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card_token\":{\"credit_card_id\":\"CARD-19321487CE645782DKWAZDII\",\"last4\":\"7702\",\"type\":\"visa\",\"expire_month\":\"11\",\"expire_year\":\"2019\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"558191a21aaed\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\"}]},\"related_resources\":[{\"sale\":{\"id\":\"0UT44837MG029733C\",\"create_time\":\"2015-06-17T15:26:26Z\",\"update_time\":\"2015-06-17T15:26:28Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-9DN27361C2703300EKWAZDIQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0UT44837MG029733C\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0UT44837MG029733C/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-9DN27361C2703300EKWAZDIQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-9DN27361C2703300EKWAZDIQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-1FJ72485FN6485823KWAZCZA\",\"create_time\":\"2015-06-17T15:25:24Z\",\"update_time\":\"2015-06-17T15:25:26Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"55819163c08f9\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"9S673821UG796180S\",\"create_time\":\"2015-06-17T15:25:24Z\",\"update_time\":\"2015-06-17T15:25:26Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-1FJ72485FN6485823KWAZCZA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9S673821UG796180S\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9S673821UG796180S/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1FJ72485FN6485823KWAZCZA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1FJ72485FN6485823KWAZCZA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-6JY80631CT282263PKWAWPUI\",\"create_time\":\"2015-06-17T12:28:01Z\",\"update_time\":\"2015-06-17T12:28:12Z\",\"state\":\"approved\",\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"mastercard\",\"number\":\"xxxxxxxxxxxx5559\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\",\"billing_address\":{\"line1\":\"52 N Main ST\",\"city\":\"Johnstown\",\"state\":\"OH\",\"postal_code\":\"43210\",\"country_code\":\"US\"}}}]},\"transactions\":["
|
47
|
-
read 8192 bytes
|
48
|
-
reading 2 bytes...
|
49
|
-
-> ""
|
50
|
-
-> "\r\n"
|
51
|
-
read 2 bytes
|
52
|
-
-> "2000\r\n"
|
53
|
-
reading 8192 bytes...
|
54
|
-
-> ""
|
55
|
-
-> "{\"amount\":{\"total\":\"107.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"107.41\",\"tax\":\"0.03\",\"shipping\":\"0.03\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"authorization\":{\"id\":\"0F879792UF348410B\",\"create_time\":\"2015-06-17T12:28:01Z\",\"update_time\":\"2015-06-17T12:28:12Z\",\"amount\":{\"total\":\"107.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"107.41\",\"tax\":\"0.03\",\"shipping\":\"0.03\"}},\"state\":\"authorized\",\"parent_payment\":\"PAY-6JY80631CT282263PKWAWPUI\",\"valid_until\":\"2015-07-16T12:28:01Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/0F879792UF348410B\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/0F879792UF348410B/capture\",\"rel\":\"capture\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/0F879792UF348410B/void\",\"rel\":\"void\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-6JY80631CT282263PKWAWPUI\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-6JY80631CT282263PKWAWPUI\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-2FN79792JL482730FKWAWKBI\",\"create_time\":\"2015-06-17T12:16:05Z\",\"update_time\":\"2015-06-17T12:16:49Z\",\"state\":\"approved\",\"intent\":\"order\",\"payer\":{\"payment_method\":\"paypal\",\"status\":\"VERIFIED\",\"payer_info\":{\"email\":\"passionarya@gmail.com\",\"first_name\":\"passion\",\"last_name\":\"arya\",\"payer_id\":\"LJQW7QV5CMGKJ\",\"shipping_address\":{\"line1\":\"1 Main St\",\"city\":\"San Jose\",\"state\":\"CA\",\"postal_code\":\"95131\",\"country_code\":\"US\",\"recipient_name\":\"passion arya\"}}},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"558165052e585\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\"}]},\"related_resources\":[{\"order\":{\"id\":\"O-1EH64738GR325874S\",\"create_time\":\"2015-06-17T12:16:05Z\",\"update_time\":\"2015-06-17T12:16:38Z\",\"state\":\"authorized\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"parent_payment\":\"PAY-2FN79792JL482730FKWAWKBI\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/orders/O-1EH64738GR325874S\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-2FN79792JL482730FKWAWKBI\",\"rel\":\"parent_payment\",\"method\":\"GET\"}],\"reason_code\":\"order\"}},{\"authorization\":{\"id\":\"6CW979277C8653353\",\"create_time\":\"2015-06-17T12:16:48Z\",\"update_time\":\"2015-06-17T12:16:49Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-2FN79792JL482730FKWAWKBI\",\"valid_until\":\"2015-07-16T12:16:48Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/6CW979277C8653353\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/6CW979277C8653353/capture\",\"rel\":\"capture\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/6CW979277C8653353/void\",\"rel\":\"void\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/6CW979277C8653353/reauthorize\",\"rel\":\"reauthorize\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-2FN79792JL482730FKWAWKBI\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-2FN79792JL482730FKWAWKBI\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-2AD33606NT514341KKWAWJXA\",\"create_time\":\"2015-06-17T12:15:24Z\",\"update_time\":\"2015-06-17T12:15:26Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"558164dc5226c\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"31344398DP987593P\",\"create_time\":\"2015-06-17T12:15:24Z\",\"update_time\":\"2015-06-17T12:15:26Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-2AD33606NT514341KKWAWJXA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/31344398DP987593P\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/31344398DP987593P/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-2AD33606NT514341KKWAWJXA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-2AD33606NT514341KKWAWJXA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-1AV94905D05234514KWAWJAY\",\"create_time\":\"2015-06-17T12:13:55Z\",\"update_time\":\"2015-06-17T12:14:37Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"paypal\",\"status\":\"VERIFIED\",\"payer_info\":{\"email\":\"passionarya@gmail.com\",\"first_name\":\"passion\",\"last_name\":\"arya\",\"payer_id\":\"LJQW7QV5CMGKJ\",\"shipping_address\":{\"line1\":\"1 Main St\",\"city\":\"San Jose\",\"state\":\"CA\",\"postal_code\":\"95131\",\"country_code\":\"US\",\"recipient_name\":\"passion arya\"}}},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581648074c1e\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"sku\":\"123123\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\"},{\"name\":\"Granola bars\",\"sku\":\"321321\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\"}]},\"related_resources\":[{\"sale\":{\"id\":\"2K505029HN1211825\",\"create_time\":\"2015-06-17T12:13:55Z\",\"update_time\":\"2015-06-17T12:14:37Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"payment_mode\":\"INSTANT_TRANSFER\",\"state\":\"completed\",\"protection_eligibility\":\"ELIGIBLE\",\"protection_eligibility_type\":\"ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE\",\"parent_payment\":\"PAY-1AV94905D05234514KWAWJAY\",\"transaction_fee\":{\"value\":\"0.88\",\"currency\":\"USD\"},\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2K505029HN1211825\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2K505029HN1211825/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1AV94905D05234514KWAWJAY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1AV94905D05234514KWAWJAY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-6053768531209024AKWAV22A\",\"create_time\":\"2015-06-17T11:43:36Z\",\"update_time\":\"2015-06-17T11:44:56Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"paypal\",\"status\":\"VERIFIED\",\"payer_info\":{\"email\":\"dubeyvikass22@live.com\",\"first_name\":\"vikas\",\"last_name\":\"dubey\",\"payer_id\":\"6NZTQBCPLCD9S\",\"shipping_address\":{\"line1\":\"101 10 floore\",\"line2\":\"City Center\",\"city\":\"Ahmedabad\",\"state\":\"Gujarat\",\"postal_code\":\"3800054\",\"country_code\":\"IN\",\"recipient_name\":\"Ronak Prajapati\"}}},\"transactions\":[{\"amount\":{\"total\":\"0.66\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"0.66\"}},\"description\":\"Payment description\",\"invoice_number\":\"TBH_55815d68082f0\",\"item_list\":{\"items\":[{\"name\":\"Afrikaaans to Arabic Translation\",\"price\":\"0.22\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Afrikaaans to Arabic Translation\"},{\"name\":\"Afrikaaans to English Translation\",\"price\":\"0.22\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Afrikaaans to English Translation\"},{\"name\":\"Afrikaaans to Gujarati Translation\",\"price\":\"0.22\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Afrikaaans to Gujarati Translation\"}]},\"related_resources\":[{\"sale\":{\"id\":\"0YX952993U1445832\",\"create_time\":\"2015-06-17T11:43:36Z\",\"update_time\":\"2015-06-17"
|
56
|
-
read 8192 bytes
|
57
|
-
reading 2 bytes...
|
58
|
-
-> ""
|
59
|
-
-> "\r\n"
|
60
|
-
read 2 bytes
|
61
|
-
-> "371\r\n"
|
62
|
-
reading 881 bytes...
|
63
|
-
-> ""
|
64
|
-
-> "T11:44:56Z\",\"amount\":{\"total\":\"0.66\",\"currency\":\"USD\"},\"payment_mode\":\"INSTANT_TRANSFER\",\"state\":\"completed\",\"protection_eligibility\":\"ELIGIBLE\",\"protection_eligibility_type\":\"ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE\",\"parent_payment\":\"PAY-6053768531209024AKWAV22A\",\"transaction_fee\":{\"value\":\"0.32\",\"currency\":\"USD\"},\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0YX952993U1445832\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0YX952993U1445832/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-6053768531209024AKWAV22A\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-6053768531209024AKWAV22A\",\"rel\":\"self\",\"method\":\"GET\"}]}],\"count\":10,\"next_id\":\"PAY-2U295199GL626082MKWAVKJY\"}"
|
65
|
-
read 881 bytes
|
66
|
-
reading 2 bytes...
|
67
|
-
-> ""
|
68
|
-
-> "\r\n"
|
69
|
-
read 2 bytes
|
70
|
-
-> "0\r\n"
|
71
|
-
-> "\r\n"
|
19
|
+
reading 207 bytes...
|
20
|
+
-> "{\"name\":\"INVALID_RESOURCE_ID\",\"message\":\"The requested resource ID was not found\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID\",\"debug_id\":\"1ad36fab73506\"}"
|
21
|
+
read 207 bytes
|
72
22
|
Conn close
|
73
23
|
opening connection to api.sandbox.paypal.com:443...
|
74
24
|
opened
|
75
25
|
starting SSL for api.sandbox.paypal.com:443...
|
76
26
|
SSL established
|
77
|
-
<- "POST /v1/
|
78
|
-
<- "{
|
79
|
-
-> "HTTP/1.1
|
80
|
-
-> "Date:
|
27
|
+
<- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015L7-5a9a9WxiKZ3.imHj5JgriF7lV8prm0ZYyamGCGoI\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 1.3.1 (paypal-sdk-core 1.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 2\r\n\r\n"
|
28
|
+
<- "{}"
|
29
|
+
-> "HTTP/1.1 400 Bad Request\r\n"
|
30
|
+
-> "Date: Thu, 02 Jul 2015 18:51:07 GMT\r\n"
|
81
31
|
-> "Server: Apache\r\n"
|
82
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=
|
83
|
-
-> "Paypal-Debug-Id:
|
32
|
+
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=295\r\n"
|
33
|
+
-> "Paypal-Debug-Id: 069a291c73040\r\n"
|
84
34
|
-> "Content-Language: *\r\n"
|
85
|
-
-> "Content-Length: 667\r\n"
|
86
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1318748501; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
87
|
-
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
88
|
-
-> "Vary: Authorization\r\n"
|
89
35
|
-> "Connection: close\r\n"
|
90
|
-
-> "
|
91
|
-
-> "\r\n"
|
92
|
-
|
93
|
-
-> "{\"id\":\"CARD-6F200375X0174994DKWAZUTQ\",\"state\":\"ok\",\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx1111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\",\"valid_until\":\"2018-06-16T00:00:00Z\",\"create_time\":\"2015-06-17T16:03:26Z\",\"update_time\":\"2015-06-17T16:03:26Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6F200375X0174994DKWAZUTQ\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6F200375X0174994DKWAZUTQ\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6F200375X0174994DKWAZUTQ\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
|
94
|
-
read 667 bytes
|
95
|
-
Conn close
|
96
|
-
opening connection to api.sandbox.paypal.com:443...
|
97
|
-
opened
|
98
|
-
starting SSL for api.sandbox.paypal.com:443...
|
99
|
-
SSL established
|
100
|
-
<- "GET /v1/vault/credit-card/CARD-6F200375X0174994DKWAZUTQ HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015hHEMGKOcPqeg2Ngcw8AQ-IN2MfFF5VPkpM-hU.XFXVg\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
|
101
|
-
-> "HTTP/1.1 200 OK\r\n"
|
102
|
-
-> "Date: Wed, 17 Jun 2015 16:03:26 GMT\r\n"
|
103
|
-
-> "Server: Apache\r\n"
|
104
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=44734\r\n"
|
105
|
-
-> "Paypal-Debug-Id: ee7797e650dd2\r\n"
|
106
|
-
-> "Content-Language: *\r\n"
|
107
|
-
-> "Content-Length: 667\r\n"
|
108
|
-
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1318748501; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
36
|
+
-> "Connection: close\r\n"
|
37
|
+
-> "Content-Length: 306\r\n"
|
38
|
+
-> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D461935957; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
|
109
39
|
-> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
|
110
40
|
-> "Vary: Authorization\r\n"
|
111
|
-
-> "Connection: close\r\n"
|
112
41
|
-> "Content-Type: application/json\r\n"
|
113
42
|
-> "\r\n"
|
114
|
-
reading
|
115
|
-
-> "{\"
|
116
|
-
read
|
43
|
+
reading 306 bytes...
|
44
|
+
-> "{\"name\":\"VALIDATION_ERROR\",\"details\":[{\"field\":\"payer\",\"issue\":\"Required field missing\"},{\"field\":\"intent\",\"issue\":\"Required field missing\"}],\"message\":\"Invalid request - see details\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR\",\"debug_id\":\"069a291c73040\"}"
|
45
|
+
read 306 bytes
|
117
46
|
Conn close
|
@@ -9,7 +9,7 @@ describe "Payments" do
|
|
9
9
|
"funding_instruments" => [ {
|
10
10
|
"credit_card" => {
|
11
11
|
"type" => "visa",
|
12
|
-
"number" => "
|
12
|
+
"number" => "4567516310777851",
|
13
13
|
"expire_month" => "11", "expire_year" => "2018",
|
14
14
|
"cvv2" => "874",
|
15
15
|
"first_name" => "Joe", "last_name" => "Shopper",
|
@@ -150,11 +150,14 @@ describe "Payments" do
|
|
150
150
|
access_token = nil
|
151
151
|
|
152
152
|
it "Exchange Authorization Code for Refresh / Access Tokens" do
|
153
|
+
|
153
154
|
# put your authorization code for testing here
|
154
155
|
auth_code = ''
|
156
|
+
|
155
157
|
if auth_code != ''
|
156
|
-
|
157
|
-
access_token.should_not be_nil
|
158
|
+
tokeninfo = FuturePayment.exch_token(auth_code)
|
159
|
+
tokeninfo.access_token.should_not be_nil
|
160
|
+
tokeninfo.refresh_token.should_not be_nil
|
158
161
|
end
|
159
162
|
end
|
160
163
|
|
@@ -296,7 +299,7 @@ describe "Payments" do
|
|
296
299
|
it "Create" do
|
297
300
|
credit_card = CreditCard.new({
|
298
301
|
"type" => "visa",
|
299
|
-
"number" => "
|
302
|
+
"number" => "4567516310777851",
|
300
303
|
"expire_month" => "11", "expire_year" => "2018",
|
301
304
|
"cvv2" => "874",
|
302
305
|
"first_name" => "Joe", "last_name" => "Shopper",
|
@@ -317,7 +320,7 @@ describe "Payments" do
|
|
317
320
|
it "Delete" do
|
318
321
|
credit_card = CreditCard.new({
|
319
322
|
"type" => "visa",
|
320
|
-
"number" => "
|
323
|
+
"number" => "4567516310777851",
|
321
324
|
"expire_month" => "11", "expire_year" => "2018" })
|
322
325
|
expect(credit_card.create).to be_truthy
|
323
326
|
expect(credit_card.delete).to be_truthy
|
@@ -342,6 +345,15 @@ describe "Payments" do
|
|
342
345
|
credit_card.error["details"][0]["issue"].should eql "Required field missing"
|
343
346
|
end
|
344
347
|
end
|
348
|
+
end
|
349
|
+
|
350
|
+
describe 'CreditCardList', :integration => true do
|
351
|
+
|
352
|
+
it "List" do
|
353
|
+
options = { :create_time => "2015-03-28T15:33:43Z" }
|
354
|
+
credit_card_list = CreditCardList.list()
|
355
|
+
expect(credit_card_list.total_items).to be > 0
|
356
|
+
end
|
345
357
|
|
346
358
|
end
|
347
359
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-sdk-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|