paypal-sdk-core 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.txt +3 -0
- data/lib/paypal-sdk/core/api/base.rb +5 -1
- data/lib/paypal-sdk/core/openid_connect/api.rb +6 -0
- data/lib/paypal-sdk/core/version.rb +1 -1
- data/spec/core/api/merchant_spec.rb +4 -0
- data/spec/core/api/platform_spec.rb +4 -0
- data/spec/core/openid_connect_spec.rb +4 -0
- data/spec/log/rest_http.log +29 -29
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGQxNTQwNGE3MzYyNzNhZTVkNGIyYWVlOGQyNmRhMDMxODU4MDQ5NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTNlYmZkMWYxNjc4Y2RkN2I4MmU5ZjVlMDY1MzJlYzg2ODUzNzFhYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWE2M2FhNGMwNzk4YWI0MzNlNTJmNTI2YjhjMTJjNDg5ZTMwOWM1MmNlZDE5
|
10
|
+
ZGQzZWJmODBhMjUzMTcxNGJhOGNiYjU3ZjI3NmIyZjdjYjY4OGUyNGZhNGU2
|
11
|
+
ZTNkNWY0YTg1MDAzMDhjYTI4MzM0YjE1MWEyZDcyZjk1ZGI3OTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGM1ZTA2OTg4ZWM2NmRhNmMyZDIxY2EyM2I5ZTE3MDRkYTc0NjE0NjBmMTE1
|
14
|
+
ZDRlZGFkZmE2MDJjYjU5ODZhMTJkNjU4NTRiMGRjNWYxYzhmM2QzZjYxODY2
|
15
|
+
NGJjZjFiNGI2YWMwNzBlOTRlMWY5MDgzYzAyYTI4YTEzNWM0MDU=
|
data/CHANGELOG.txt
CHANGED
@@ -144,8 +144,12 @@ module PayPal::SDK::Core
|
|
144
144
|
end
|
145
145
|
|
146
146
|
class << self
|
147
|
+
def sdk_library_details
|
148
|
+
@library_details ||= "paypal-sdk-core #{PayPal::SDK::Core::VERSION}; ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}-#{RUBY_PLATFORM}"
|
149
|
+
end
|
150
|
+
|
147
151
|
def user_agent
|
148
|
-
@user_agent ||= "
|
152
|
+
@user_agent ||= "PayPalSDK/sdk-core-ruby #{VERSION} (#{sdk_library_details})"
|
149
153
|
end
|
150
154
|
end
|
151
155
|
end
|
@@ -8,6 +8,10 @@ describe PayPal::SDK::Core::API::Merchant do
|
|
8
8
|
MassPayParams = { "ReceiverType" => "EmailAddress", "MassPayItem" => [{
|
9
9
|
"ReceiverEmail" => "enduser_biz@gmail.com", "Amount" => { "@currencyID" => "USD", "value" => "3.00" } }] }
|
10
10
|
|
11
|
+
it "Validate user_agent" do
|
12
|
+
Merchant.user_agent.should match "PayPalSDK/sdk-core-ruby"
|
13
|
+
end
|
14
|
+
|
11
15
|
describe "Configuration" do
|
12
16
|
it "service endpoint for sandbox" do
|
13
17
|
client = Merchant.new
|
@@ -13,6 +13,10 @@ describe PayPal::SDK::Core::API::Platform do
|
|
13
13
|
{ "name"=>"item2", "quantity"=>"2", "unitPrice"=>"2.00" } ] },
|
14
14
|
"currencyCode" => "USD", "paymentTerms" => "DueOnReceipt" } }
|
15
15
|
|
16
|
+
it "Validate user_agent" do
|
17
|
+
Platform.user_agent.should match "PayPalSDK/sdk-core-ruby"
|
18
|
+
end
|
19
|
+
|
16
20
|
describe "Configuration" do
|
17
21
|
it "create client with Service name" do
|
18
22
|
client = Platform.new("AdaptivePayments")
|
@@ -7,6 +7,10 @@ describe PayPal::SDK::OpenIDConnect do
|
|
7
7
|
OpenIDConnect.set_config( :client_id => "client_id", :openid_redirect_uri => "http://google.com" )
|
8
8
|
end
|
9
9
|
|
10
|
+
it "Validate user_agent" do
|
11
|
+
OpenIDConnect::API.user_agent.should match "PayPalSDK/openid-connect-ruby"
|
12
|
+
end
|
13
|
+
|
10
14
|
it "generate autorize_url" do
|
11
15
|
url = OpenIDConnect::Tokeninfo.authorize_url
|
12
16
|
url.should match "client_id=client_id"
|
data/spec/log/rest_http.log
CHANGED
@@ -1,40 +1,40 @@
|
|
1
1
|
opening connection to api.sandbox.paypal.com...
|
2
2
|
opened
|
3
|
-
<- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer
|
3
|
+
<- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer JE8G4V.17O9J9xIZFKQITpoUmrpViF8lA-VyQfQCDqo\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.2.3 (paypal-sdk-core 0.2.3; ruby 1.9.3p327-i686-linux)\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 286\r\n\r\n"
|
4
4
|
<- "{\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"4417119669820331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"}}]}"
|
5
5
|
-> "HTTP/1.1 201 Created\r\n"
|
6
6
|
-> "Server: Apache-Coyote/1.1\r\n"
|
7
|
-
-> "Date:
|
8
|
-
-> "PayPal-Debug-Id:
|
7
|
+
-> "Date: Fri, 26 Apr 2013 05:46:37 GMT\r\n"
|
8
|
+
-> "PayPal-Debug-Id: e6e15a750de50\r\n"
|
9
9
|
-> "Content-Type: application/json\r\n"
|
10
10
|
-> "Content-Length: 1176\r\n"
|
11
11
|
-> "\r\n"
|
12
12
|
reading 1176 bytes...
|
13
|
-
-> "{\"id\":\"PAY-
|
13
|
+
-> "{\"id\":\"PAY-7F944019LL3444544KF5BJOQ\",\"create_time\":\"2013-04-26T05:46:34Z\",\"update_time\":\"2013-04-26T05:46:37Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"2VF23254MX2272604\",\"create_time\":\"2013-04-26T05:46:34Z\",\"update_time\":\"2013-04-26T05:46:37Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-7F944019LL3444544KF5BJOQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2VF23254MX2272604\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2VF23254MX2272604/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F944019LL3444544KF5BJOQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F944019LL3444544KF5BJOQ\",\"rel\":\"self\",\"method\":\"GET\"}]}"
|
14
14
|
read 1176 bytes
|
15
15
|
Conn keep-alive
|
16
16
|
opening connection to api.sandbox.paypal.com...
|
17
17
|
opened
|
18
|
-
<- "GET /v1/payments/payment?count=10 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer
|
18
|
+
<- "GET /v1/payments/payment?count=10 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer JE8G4V.17O9J9xIZFKQITpoUmrpViF8lA-VyQfQCDqo\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.2.3 (paypal-sdk-core 0.2.3; ruby 1.9.3p327-i686-linux)\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"
|
19
19
|
-> "HTTP/1.1 200 OK\r\n"
|
20
20
|
-> "Server: Apache-Coyote/1.1\r\n"
|
21
|
-
-> "Date:
|
22
|
-
-> "PayPal-Debug-Id:
|
21
|
+
-> "Date: Fri, 26 Apr 2013 05:46:40 GMT\r\n"
|
22
|
+
-> "PayPal-Debug-Id: 59b6b64d1207d\r\n"
|
23
23
|
-> "Content-Type: application/json\r\n"
|
24
24
|
-> "Transfer-Encoding: chunked\r\n"
|
25
25
|
-> "\r\n"
|
26
26
|
-> "2000\r\n"
|
27
27
|
reading 8192 bytes...
|
28
|
-
-> "{\"payments\":[{\"id\":\"PAY-
|
28
|
+
-> "{\"payments\":[{\"id\":\"PAY-7F944019LL3444544KF5BJOQ\",\"create_time\":\"2013-04-26T05:46:34Z\",\"update_time\":\"2013-04-26T05:46:37Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"2VF23254MX2272604\",\"create_time\":\"2013-04-26T05:46:34Z\",\"update_time\":\"2013-04-26T05:46:37Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-7F944019LL3444544KF5BJOQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2VF23254MX2272604\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2VF23254MX2272604/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F944019LL3444544KF5BJOQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F944019LL3444544KF5BJOQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-49A93227RV5030257KF5BIFY\",\"create_time\":\"2013-04-26T05:43:51Z\",\"update_time\":\"2013-04-26T05:43:55Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"5EC63430H42995346\",\"create_time\":\"2013-04-26T05:43:51Z\",\"update_time\":\"2013-04-26T05:43:55Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-49A93227RV5030257KF5BIFY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/5EC63430H42995346\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/5EC63430H42995346/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-49A93227RV5030257KF5BIFY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-49A93227RV5030257KF5BIFY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-51326687487421944KF5BH3Q\",\"create_time\":\"2013-04-26T05:43:10Z\",\"update_time\":\"2013-04-26T05:43:10Z\",\"state\":\"created\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"paypal\"},\"transactions\":[{\"amount\":{\"total\":\"10.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"10.00\"}}}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-51326687487421944KF5BH3Q\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-85914261YJ749681L\",\"rel\":\"approval_url\",\"method\":\"REDIRECT\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-51326687487421944KF5BH3Q/execute\",\"rel\":\"execute\",\"method\":\"POST\"}]},{\"id\":\"PAY-6FC3936313982164AKF5BFHI\",\"create_time\":\"2013-04-26T05:37:33Z\",\"update_time\":\"2013-04-26T05:37:35Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"9MR04769XK572345M\",\"create_time\":\"2013-04-26T05:37:33Z\",\"update_time\":\"2013-04-26T05:37:35Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-6FC3936313982164AKF5BFHI\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9MR04769XK572345M\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9MR04769XK572345M/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-6FC3936313982164AKF5BFHI\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-6FC3936313982164AKF5BFHI\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-3Y717559PN075215MKF5BFFQ\",\"create_time\":\"2013-04-26T05:37:26Z\",\"update_time\":\"2013-04-26T05:37:28Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"7FF658696N275381M\",\"create_time\":\"2013-04-26T05:37:26Z\",\"update_time\":\"2013-04-26T05:37:28Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-3Y717559PN075215MKF5BFFQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7FF658696N275381M\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7FF658696N275381M/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3Y717559PN075215MKF5BFFQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3Y717559PN075215MKF5BFFQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-66X542721E258470NKF5BFEA\",\"create_time\":\"2013-04-26T05:37:20Z\",\"update_time\":\"2013-04-26T05:37:23Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"0M6775184W495294L\",\"create_time\":\"2013-04-26T05:37:21Z\",\"update_time\":\"2013-04-26T05:37:23Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-66X542721E258470NKF5BFEA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0M6775184W495294L\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0M6775184W495294L/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-66X542721E258470NKF5BFEA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-66X542721E258470NKF5BFEA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-7XL5305797375744LKF5BFEA\",\"create_time\":\"2013-04-26T05:37:20Z\",\"update_time\":\"2013-04-26T05:37:22Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"4NK94285TB3340154\",\"create_time\":\"2013-04-26T05:37:20Z\",\"update_time\":\"2013-04-26T05:37:22Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-7XL5305797375744LKF5BFEA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4NK94285TB3340154\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4NK94285TB3340154/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7XL5305797375744LKF5BFEA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7XL5305797375744LKF5BFEA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-5V573397P4834670DKF5BFCY\",\"create_time\":\"2013-04-26T05:37:15Z\",\"update_time\":\"2013-04-26T05:37:17Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":"
|
29
29
|
read 8192 bytes
|
30
30
|
reading 2 bytes...
|
31
31
|
-> "\r\n"
|
32
32
|
read 2 bytes
|
33
|
-
-> "
|
34
|
-
reading
|
35
|
-
-> "
|
36
|
-
-> "
|
37
|
-
read
|
33
|
+
-> "bfa\r\n"
|
34
|
+
reading 3066 bytes...
|
35
|
+
-> "\"7.47\"}},\"related_resources\":[{\"sale\":{\"id\":\"9NS53175HV0997438\",\"create_time\":\"2013-04-26T05:37:15Z\",\"update_time\":\"2013-04-26T05:37:17Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-5V573397P4834670DKF5BFCY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9NS53175HV0997438\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9NS53175HV0997438/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5V573397P4834670DKF5BFCY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\""
|
36
|
+
-> ":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5V573397P4834670DKF5BFCY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-44U57996ER339901MKF5BEYA\",\"create_time\":\"2013-04-26T05:36:32Z\",\"update_time\":\"2013-04-26T05:36:34Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card_token\":{\"credit_card_id\":\"CARD-926684478N266762EKF5AR2Q\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"20.00\"}},\"description\":\"Pizza 4\",\"related_resources\":[{\"sale\":{\"id\":\"5V576565MV6826026\",\"create_time\":\"2013-04-26T05:36:32Z\",\"update_time\":\"2013-04-26T05:36:34Z\",\"state\":\"completed\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-44U57996ER339901MKF5BEYA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/5V576565MV6826026\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/5V576565MV6826026/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-44U57996ER339901MKF5BEYA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-44U57996ER339901MKF5BEYA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-0K313993Y4768024HKF5BEPQ\",\"create_time\":\"2013-04-26T05:35:58Z\",\"update_time\":\"2013-04-26T05:36:01Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card_token\":{\"credit_card_id\":\"CARD-926684478N266762EKF5AR2Q\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"20.00\"}},\"description\":\"Pizza 4\",\"related_resources\":[{\"sale\":{\"id\":\"9KN427579N3250453\",\"create_time\":\"2013-04-26T05:35:58Z\",\"update_time\":\"2013-04-26T05:36:01Z\",\"state\":\"completed\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-0K313993Y4768024HKF5BEPQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9KN427579N3250453\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/9KN427579N3250453/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-0K313993Y4768024HKF5BEPQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-0K313993Y4768024HKF5BEPQ\",\"rel\":\"self\",\"method\":\"GET\"}]}],\"count\":10,\"next_id\":\"PAY-9LW90008G66073115KF5BBDI\"}"
|
37
|
+
read 3066 bytes
|
38
38
|
reading 2 bytes...
|
39
39
|
-> "\r\n"
|
40
40
|
read 2 bytes
|
@@ -43,61 +43,61 @@ read 2 bytes
|
|
43
43
|
Conn keep-alive
|
44
44
|
opening connection to api.sandbox.paypal.com...
|
45
45
|
opened
|
46
|
-
<- "POST /v1/vault/credit-card HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer
|
46
|
+
<- "POST /v1/vault/credit-card HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer VpNUzWtf3ZMZx5fbtzthRTtV.Mw3E5j0oeUkOLaClWc\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.2.3 (paypal-sdk-core 0.2.3; ruby 1.9.3p327-i686-linux)\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 138\r\n\r\n"
|
47
47
|
<- "{\"type\":\"visa\",\"number\":\"4111111111111111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"cvv2\":\"874\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}"
|
48
48
|
-> "HTTP/1.1 201 Created\r\n"
|
49
49
|
-> "Server: Apache-Coyote/1.1\r\n"
|
50
|
-
-> "Date:
|
51
|
-
-> "PayPal-Debug-Id:
|
50
|
+
-> "Date: Fri, 26 Apr 2013 05:46:46 GMT\r\n"
|
51
|
+
-> "PayPal-Debug-Id: 9d05b07d102c6\r\n"
|
52
52
|
-> "Content-Type: application/json\r\n"
|
53
53
|
-> "Content-Length: 347\r\n"
|
54
54
|
-> "\r\n"
|
55
55
|
reading 347 bytes...
|
56
|
-
-> "{\"id\":\"CARD-
|
56
|
+
-> "{\"id\":\"CARD-30429915LC3037518KF5BJRQ\",\"valid_until\":\"2016-04-25T00:00:00.000Z\",\"state\":\"ok\",\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx1111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-30429915LC3037518KF5BJRQ\",\"rel\":\"self\",\"method\":\"GET\"}]}"
|
57
57
|
read 347 bytes
|
58
58
|
Conn keep-alive
|
59
59
|
opening connection to api.sandbox.paypal.com...
|
60
60
|
opened
|
61
|
-
<- "GET /v1/vault/credit-card/CARD-
|
61
|
+
<- "GET /v1/vault/credit-card/CARD-30429915LC3037518KF5BJRQ HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer VpNUzWtf3ZMZx5fbtzthRTtV.Mw3E5j0oeUkOLaClWc\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.2.3 (paypal-sdk-core 0.2.3; ruby 1.9.3p327-i686-linux)\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"
|
62
62
|
-> "HTTP/1.1 200 OK\r\n"
|
63
63
|
-> "Server: Apache-Coyote/1.1\r\n"
|
64
|
-
-> "Date:
|
65
|
-
-> "PayPal-Debug-Id:
|
64
|
+
-> "Date: Fri, 26 Apr 2013 05:46:47 GMT\r\n"
|
65
|
+
-> "PayPal-Debug-Id: 45a81e4510c22\r\n"
|
66
66
|
-> "Content-Type: application/json\r\n"
|
67
67
|
-> "Content-Length: 347\r\n"
|
68
68
|
-> "\r\n"
|
69
69
|
reading 347 bytes...
|
70
|
-
-> "{\"id\":\"CARD-
|
70
|
+
-> "{\"id\":\"CARD-30429915LC3037518KF5BJRQ\",\"valid_until\":\"2016-04-25T00:00:00.000Z\",\"state\":\"ok\",\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx1111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-30429915LC3037518KF5BJRQ\",\"rel\":\"self\",\"method\":\"GET\"}]}"
|
71
71
|
read 347 bytes
|
72
72
|
Conn keep-alive
|
73
73
|
opening connection to api.sandbox.paypal.com...
|
74
74
|
opened
|
75
|
-
<- "GET /v1/payments/payment/PAY-1234 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer
|
75
|
+
<- "GET /v1/payments/payment/PAY-1234 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer JE8G4V.17O9J9xIZFKQITpoUmrpViF8lA-VyQfQCDqo\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.2.3 (paypal-sdk-core 0.2.3; ruby 1.9.3p327-i686-linux)\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"
|
76
76
|
-> "HTTP/1.1 404 Not Found\r\n"
|
77
77
|
-> "Server: Apache-Coyote/1.1\r\n"
|
78
|
-
-> "Date:
|
79
|
-
-> "PayPal-Debug-Id:
|
78
|
+
-> "Date: Fri, 26 Apr 2013 05:46:48 GMT\r\n"
|
79
|
+
-> "PayPal-Debug-Id: ea69630610998\r\n"
|
80
80
|
-> "Content-Type: application/json\r\n"
|
81
81
|
-> "Content-Length: 189\r\n"
|
82
82
|
-> "\r\n"
|
83
83
|
reading 189 bytes...
|
84
|
-
-> "{\"name\":\"INVALID_RESOURCE_ID\",\"message\":\"The requested resource ID was not found\",\"information_link\":\"https://developer.paypal.com/docs/api/#INVALID_RESOURCE_ID\",\"debug_id\":\"
|
84
|
+
-> "{\"name\":\"INVALID_RESOURCE_ID\",\"message\":\"The requested resource ID was not found\",\"information_link\":\"https://developer.paypal.com/docs/api/#INVALID_RESOURCE_ID\",\"debug_id\":\"ea69630610998\"}"
|
85
85
|
read 189 bytes
|
86
86
|
Conn keep-alive
|
87
87
|
opening connection to api.sandbox.paypal.com...
|
88
88
|
opened
|
89
|
-
<- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer
|
89
|
+
<- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer JE8G4V.17O9J9xIZFKQITpoUmrpViF8lA-VyQfQCDqo\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.2.3 (paypal-sdk-core 0.2.3; ruby 1.9.3p327-i686-linux)\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 2\r\n\r\n"
|
90
90
|
<- "{}"
|
91
91
|
-> "HTTP/1.1 400 Bad Request\r\n"
|
92
92
|
-> "Server: Apache-Coyote/1.1\r\n"
|
93
|
-
-> "Date:
|
93
|
+
-> "Date: Fri, 26 Apr 2013 05:46:50 GMT\r\n"
|
94
94
|
-> "Connection: close\r\n"
|
95
|
-
-> "PayPal-Debug-Id:
|
95
|
+
-> "PayPal-Debug-Id: 1530f96611238\r\n"
|
96
96
|
-> "Content-Type: application/json\r\n"
|
97
97
|
-> "Content-Length: 346\r\n"
|
98
98
|
-> "Connection: close\r\n"
|
99
99
|
-> "\r\n"
|
100
100
|
reading 346 bytes...
|
101
|
-
-> "{\"name\":\"VALIDATION_ERROR\",\"details\":[{\"field\":\"payer\",\"issue\":\"Required field missing\"},{\"field\":\"transactions\",\"issue\":\"Required field missing\"},{\"field\":\"intent\",\"issue\":\"Required field missing\"}],\"message\":\"Invalid request - see details\",\"information_link\":\"https://developer.paypal.com/docs/api/#VALIDATION_ERROR\",\"debug_id\":\"
|
101
|
+
-> "{\"name\":\"VALIDATION_ERROR\",\"details\":[{\"field\":\"payer\",\"issue\":\"Required field missing\"},{\"field\":\"transactions\",\"issue\":\"Required field missing\"},{\"field\":\"intent\",\"issue\":\"Required field missing\"}],\"message\":\"Invalid request - see details\",\"information_link\":\"https://developer.paypal.com/docs/api/#VALIDATION_ERROR\",\"debug_id\":\"1530f96611238\"}"
|
102
102
|
read 346 bytes
|
103
103
|
Conn close
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xml-simple
|