paypal-sdk-core 0.2.1 → 0.2.2
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 +15 -0
- data/CHANGELOG.txt +16 -0
- data/lib/generators/paypal/sdk/templates/paypal.rb +2 -2
- data/lib/generators/paypal/sdk/templates/paypal.yml +2 -2
- data/lib/paypal-sdk-core.rb +17 -25
- data/lib/paypal-sdk/core/api.rb +20 -0
- data/lib/paypal-sdk/core/api/base.rb +0 -2
- data/lib/paypal-sdk/core/api/rest.rb +30 -13
- data/lib/paypal-sdk/core/config.rb +25 -6
- data/lib/paypal-sdk/core/credential.rb +16 -0
- data/lib/paypal-sdk/core/openid_connect.rb +116 -0
- data/lib/paypal-sdk/core/openid_connect/api.rb +41 -0
- data/lib/paypal-sdk/core/openid_connect/data_types.rb +72 -0
- data/lib/paypal-sdk/core/openid_connect/get_api.rb +28 -0
- data/lib/paypal-sdk/core/openid_connect/request_data_type.rb +52 -0
- data/lib/paypal-sdk/core/openid_connect/set_api.rb +36 -0
- data/lib/paypal-sdk/core/util.rb +11 -0
- data/lib/paypal-sdk/core/version.rb +1 -1
- data/spec/core/api/platform_spec.rb +0 -1
- data/spec/core/api/rest_spec.rb +6 -0
- data/spec/core/config_spec.rb +48 -0
- data/spec/core/openid_connect_spec.rb +88 -0
- data/spec/log/rest_http.log +29 -30
- data/spec/log/test.log +670 -1970
- data/spec/spec_helper.rb +2 -2
- metadata +56 -50
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'paypal-sdk-core'
|
2
|
+
|
3
|
+
module PayPal::SDK::Core
|
4
|
+
module OpenIDConnect
|
5
|
+
module DataTypes
|
6
|
+
class Base < PayPal::SDK::Core::API::DataTypes::Base
|
7
|
+
end
|
8
|
+
|
9
|
+
class Address < Base
|
10
|
+
def self.load_members
|
11
|
+
object_of :street_address, String
|
12
|
+
object_of :locality, String
|
13
|
+
object_of :region, String
|
14
|
+
object_of :postal_code, String
|
15
|
+
object_of :country, String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Userinfo < Base
|
20
|
+
def self.load_members
|
21
|
+
object_of :user_id, String
|
22
|
+
object_of :sub, String
|
23
|
+
object_of :name, String
|
24
|
+
object_of :given_name, String
|
25
|
+
object_of :family_name, String
|
26
|
+
object_of :middle_name, String
|
27
|
+
object_of :picture, String
|
28
|
+
object_of :email, String
|
29
|
+
object_of :email_verified, Boolean
|
30
|
+
object_of :gender, String
|
31
|
+
object_of :birthday, String
|
32
|
+
object_of :zoneinfo, String
|
33
|
+
object_of :locale, String
|
34
|
+
object_of :language, String
|
35
|
+
object_of :verified, Boolean
|
36
|
+
object_of :phone_number, String
|
37
|
+
object_of :address, Address
|
38
|
+
object_of :verified_account, Boolean
|
39
|
+
object_of :account_type, String
|
40
|
+
object_of :age_range, String
|
41
|
+
object_of :payer_id, String
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class Tokeninfo < Base
|
46
|
+
def self.load_members
|
47
|
+
object_of :scope, String
|
48
|
+
object_of :access_token, String
|
49
|
+
object_of :refresh_token, String
|
50
|
+
object_of :token_type, String
|
51
|
+
object_of :id_token, String
|
52
|
+
object_of :expires_in, Integer
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
class Error < Base
|
57
|
+
def self.load_members
|
58
|
+
object_of :error, String
|
59
|
+
object_of :error_description, String
|
60
|
+
object_of :error_uri, String
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
constants.each do |data_type_klass|
|
66
|
+
data_type_klass = const_get(data_type_klass)
|
67
|
+
data_type_klass.load_members if defined? data_type_klass.load_members
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module PayPal::SDK
|
2
|
+
module Core
|
3
|
+
module OpenIDConnect
|
4
|
+
module GetAPI
|
5
|
+
# Get API object
|
6
|
+
# === Example
|
7
|
+
# Payment.api
|
8
|
+
# payment.api
|
9
|
+
def api
|
10
|
+
@api || parent_api
|
11
|
+
end
|
12
|
+
|
13
|
+
# Parent API object
|
14
|
+
def parent_api
|
15
|
+
superclass.respond_to?(:api) ? superclass.api : RequestDataType.api
|
16
|
+
end
|
17
|
+
|
18
|
+
def client_id
|
19
|
+
api.config.openid_client_id || api.config.client_id
|
20
|
+
end
|
21
|
+
|
22
|
+
def client_secret
|
23
|
+
api.config.openid_client_secret || api.config.client_secret
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module PayPal::SDK
|
2
|
+
module Core
|
3
|
+
module OpenIDConnect
|
4
|
+
module RequestDataType
|
5
|
+
|
6
|
+
# Get a local API object or Class level API object
|
7
|
+
def api
|
8
|
+
@api || self.class.api
|
9
|
+
end
|
10
|
+
|
11
|
+
class << self
|
12
|
+
# Global API object
|
13
|
+
# === Example
|
14
|
+
# RequestDataType.api
|
15
|
+
def api
|
16
|
+
@api ||= API.new({})
|
17
|
+
end
|
18
|
+
|
19
|
+
def client_id
|
20
|
+
api.config.openid_client_id || api.config.client_id
|
21
|
+
end
|
22
|
+
|
23
|
+
def client_secret
|
24
|
+
api.config.openid_client_secret || api.config.client_secret
|
25
|
+
end
|
26
|
+
|
27
|
+
# Setter for RequestDataType.api
|
28
|
+
# === Example
|
29
|
+
# RequestDataType.set_config(..)
|
30
|
+
include SetAPI
|
31
|
+
|
32
|
+
# Configure depended module, when RequestDataType is include.
|
33
|
+
# === Example
|
34
|
+
# class Payment < DataTypes
|
35
|
+
# include RequestDataType
|
36
|
+
# end
|
37
|
+
# Payment.set_config(..)
|
38
|
+
# payment.set_config(..)
|
39
|
+
# Payment.api
|
40
|
+
# payment.api
|
41
|
+
def included(klass)
|
42
|
+
klass.class_eval do
|
43
|
+
extend GetAPI
|
44
|
+
extend SetAPI
|
45
|
+
include SetAPI
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module PayPal::SDK
|
2
|
+
module Core
|
3
|
+
module OpenIDConnect
|
4
|
+
module SetAPI
|
5
|
+
# Set new api
|
6
|
+
# === Examples
|
7
|
+
# payment.set_config(:development)
|
8
|
+
# payment.set_config(:client_id => "XYZ", :client_secret => "SECRET")
|
9
|
+
# payment.set_config
|
10
|
+
# payment.api = API.new(:development)
|
11
|
+
def set_config(*args)
|
12
|
+
if args[0].is_a?(API)
|
13
|
+
@api = args[0]
|
14
|
+
else
|
15
|
+
@api ||= API.new({})
|
16
|
+
@api.set_config(*args) # Just override the configuration and Not
|
17
|
+
@api
|
18
|
+
end
|
19
|
+
end
|
20
|
+
alias_method :config=, :set_config
|
21
|
+
alias_method :set_api, :set_config
|
22
|
+
alias_method :api=, :set_config
|
23
|
+
|
24
|
+
# Override client id
|
25
|
+
def client_id=(client_id)
|
26
|
+
set_config(:client_id => client_id)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Override client secret
|
30
|
+
def client_secret=(client_secret)
|
31
|
+
set_config(:client_secret => client_secret)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module PayPal
|
2
|
+
module SDK
|
3
|
+
module Core
|
4
|
+
module Util
|
5
|
+
autoload :OauthSignature, "paypal-sdk/core/util/oauth_signature"
|
6
|
+
autoload :OrderedHash, "paypal-sdk/core/util/ordered_hash"
|
7
|
+
autoload :HTTPHelper, "paypal-sdk/core/util/http_helper"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -81,7 +81,6 @@ describe PayPal::SDK::Core::API::Platform do
|
|
81
81
|
|
82
82
|
describe "with token" do
|
83
83
|
it "create invoice" do
|
84
|
-
pending "Fix issue with Invoice service"
|
85
84
|
client = Platform.new("Invoice", :with_oauth_token )
|
86
85
|
response = client.request("CreateInvoice", CreateInvoiceParams)
|
87
86
|
should_be_success(response)
|
data/spec/core/api/rest_spec.rb
CHANGED
@@ -76,6 +76,12 @@ describe PayPal::SDK::Core::API::REST do
|
|
76
76
|
}.should raise_error PayPal::SDK::Core::Exceptions::UnauthorizedAccess
|
77
77
|
end
|
78
78
|
|
79
|
+
it "Should handle expired token" do
|
80
|
+
old_token = @api.token
|
81
|
+
@api.token_hash[:expires_in] = 0
|
82
|
+
@api.token.should_not eql old_token
|
83
|
+
end
|
84
|
+
|
79
85
|
it "Get token" do
|
80
86
|
@api.token.should_not be_nil
|
81
87
|
end
|
data/spec/core/config_spec.rb
CHANGED
@@ -33,6 +33,47 @@ describe PayPal::SDK::Core::Config do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
it "Configure with parameters" do
|
37
|
+
begin
|
38
|
+
backup_configurations = Config.configurations
|
39
|
+
Config.configurations = nil
|
40
|
+
Config.configure( :username => "Testing" )
|
41
|
+
Config.config.username.should eql "Testing"
|
42
|
+
Config.config.app_id.should be_nil
|
43
|
+
ensure
|
44
|
+
Config.configurations = backup_configurations
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
it "Configure with block" do
|
49
|
+
begin
|
50
|
+
backup_configurations = Config.configurations
|
51
|
+
Config.configurations = nil
|
52
|
+
Config.configure do |config|
|
53
|
+
config.username = "Testing"
|
54
|
+
end
|
55
|
+
Config.config.username.should eql "Testing"
|
56
|
+
Config.config.app_id.should be_nil
|
57
|
+
ensure
|
58
|
+
Config.configurations = backup_configurations
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
it "Configure with default values" do
|
63
|
+
begin
|
64
|
+
backup_configurations = Config.configurations
|
65
|
+
default_config = Config.config
|
66
|
+
Config.configure do |config|
|
67
|
+
config.username = "Testing"
|
68
|
+
end
|
69
|
+
Config.config.username.should eql "Testing"
|
70
|
+
Config.config.app_id.should_not be_nil
|
71
|
+
Config.config.app_id.should eql default_config.app_id
|
72
|
+
ensure
|
73
|
+
Config.configurations = backup_configurations
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
36
77
|
it "validate configuration" do
|
37
78
|
config = Config.new( :username => "XYZ")
|
38
79
|
lambda {
|
@@ -83,6 +124,13 @@ describe PayPal::SDK::Core::Config do
|
|
83
124
|
Config.logger.should eql my_logger
|
84
125
|
end
|
85
126
|
|
127
|
+
it "Access PayPal::SDK methods" do
|
128
|
+
PayPal::SDK.configure.should eql PayPal::SDK::Core::Config.config
|
129
|
+
PayPal::SDK.logger.should eql PayPal::SDK::Core::Config.logger
|
130
|
+
PayPal::SDK.logger = PayPal::SDK.logger
|
131
|
+
PayPal::SDK.logger.should eql PayPal::SDK::Core::Config.logger
|
132
|
+
end
|
133
|
+
|
86
134
|
describe "include Configuration" do
|
87
135
|
class TestConfig
|
88
136
|
include PayPal::SDK::Core::Configuration
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PayPal::SDK::OpenIDConnect do
|
4
|
+
OpenIDConnect = PayPal::SDK::OpenIDConnect
|
5
|
+
|
6
|
+
before :all do
|
7
|
+
OpenIDConnect.set_config( :client_id => "client_id", :openid_redirect_uri => "http://google.com" )
|
8
|
+
end
|
9
|
+
|
10
|
+
it "generate autorize_url" do
|
11
|
+
url = OpenIDConnect::Tokeninfo.authorize_url
|
12
|
+
url.should match "client_id=client_id"
|
13
|
+
url.should match Regexp.escape("redirect_uri=#{CGI.escape("http://google.com")}")
|
14
|
+
url.should match "scope=openid"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "Override authorize_url params" do
|
18
|
+
url = OpenIDConnect.authorize_url(
|
19
|
+
:client_id => "new_client_id",
|
20
|
+
:redirect_uri => "http://example.com",
|
21
|
+
:scope => "openid profile")
|
22
|
+
url.should match "client_id=new_client_id"
|
23
|
+
url.should match Regexp.escape("redirect_uri=#{CGI.escape("http://example.com")}")
|
24
|
+
url.should match Regexp.escape("scope=#{CGI.escape("openid profile")}")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "Generate logout_url" do
|
28
|
+
url = OpenIDConnect.logout_url
|
29
|
+
url.should match "logout=true"
|
30
|
+
url.should match Regexp.escape("redirect_uri=#{CGI.escape("http://google.com")}")
|
31
|
+
url.should_not match "id_token"
|
32
|
+
end
|
33
|
+
|
34
|
+
it "Override logout_url params" do
|
35
|
+
url = OpenIDConnect.logout_url({
|
36
|
+
:redirect_uri => "http://example.com",
|
37
|
+
:id_token => "testing" })
|
38
|
+
url.should match Regexp.escape("redirect_uri=#{CGI.escape("http://example.com")}")
|
39
|
+
url.should match "id_token=testing"
|
40
|
+
end
|
41
|
+
|
42
|
+
it "Create token" do
|
43
|
+
lambda{
|
44
|
+
tokeninfo = OpenIDConnect::Tokeninfo.create("invalid-autorize-code")
|
45
|
+
}.should raise_error PayPal::SDK::Core::Exceptions::BadRequest
|
46
|
+
end
|
47
|
+
|
48
|
+
it "Refresh token" do
|
49
|
+
lambda{
|
50
|
+
tokeninfo = OpenIDConnect::Tokeninfo.refresh("invalid-refresh-token")
|
51
|
+
}.should raise_error PayPal::SDK::Core::Exceptions::BadRequest
|
52
|
+
end
|
53
|
+
|
54
|
+
it "Get userinfo" do
|
55
|
+
lambda{
|
56
|
+
userinfo = OpenIDConnect::Userinfo.get("invalid-access-token")
|
57
|
+
}.should raise_error PayPal::SDK::Core::Exceptions::UnauthorizedAccess
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "Tokeninfo" do
|
61
|
+
before do
|
62
|
+
@tokeninfo = OpenIDConnect::Tokeninfo.new( :access_token => "test_access_token",
|
63
|
+
:refresh_token => "test_refresh_token",
|
64
|
+
:id_token => "test_id_token" )
|
65
|
+
end
|
66
|
+
|
67
|
+
it "refresh" do
|
68
|
+
lambda{
|
69
|
+
tokeninfo = @tokeninfo.refresh
|
70
|
+
}.should raise_error PayPal::SDK::Core::Exceptions::BadRequest
|
71
|
+
end
|
72
|
+
|
73
|
+
it "userinfo" do
|
74
|
+
lambda{
|
75
|
+
userinfo = @tokeninfo.userinfo
|
76
|
+
}.should raise_error PayPal::SDK::Core::Exceptions::UnauthorizedAccess
|
77
|
+
end
|
78
|
+
|
79
|
+
it "Generate logout_url" do
|
80
|
+
url = @tokeninfo.logout_url
|
81
|
+
url.should match "id_token=test_id_token"
|
82
|
+
url.should match "logout=true"
|
83
|
+
url.should match Regexp.escape("redirect_uri=#{CGI.escape("http://google.com")}")
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
end
|
data/spec/log/rest_http.log
CHANGED
@@ -1,41 +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 rmEAod96Ok-P8b0L.yjgtceMgptc4H85ahkd-YSyfWA\r\nContent-Type: application/json\r\nUser-Agent: paypal-sdk-core/0.2.2 ruby 1.9.3p327 (2012-11-10 revision 37606) [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
|
-
-> "
|
8
|
-
-> "
|
7
|
+
-> "Date: Thu, 25 Apr 2013 10:48:06 GMT\r\n"
|
8
|
+
-> "PayPal-Debug-Id: d5acab8deb92c\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-4V176325M4053643WKF4QTYY\",\"create_time\":\"2013-04-25T10:48:03Z\",\"update_time\":\"2013-04-25T10:48:06Z\",\"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\":\"4M440216RW8947146\",\"create_time\":\"2013-04-25T10:48:03Z\",\"update_time\":\"2013-04-25T10:48:06Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-4V176325M4053643WKF4QTYY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4M440216RW8947146\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4M440216RW8947146/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-4V176325M4053643WKF4QTYY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-4V176325M4053643WKF4QTYY\",\"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 rmEAod96Ok-P8b0L.yjgtceMgptc4H85ahkd-YSyfWA\r\nContent-Type: application/json\r\nUser-Agent: paypal-sdk-core/0.2.2 ruby 1.9.3p327 (2012-11-10 revision 37606) [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
|
-
-> "
|
22
|
-
-> "
|
23
|
-
-> "Transfer-Encoding: chunked\r\n"
|
21
|
+
-> "Date: Thu, 25 Apr 2013 10:48:10 GMT\r\n"
|
22
|
+
-> "PayPal-Debug-Id: cc1aa426eb68c\r\n"
|
24
23
|
-> "Content-Type: application/json\r\n"
|
25
24
|
-> "Transfer-Encoding: chunked\r\n"
|
26
25
|
-> "\r\n"
|
27
26
|
-> "2000\r\n"
|
28
27
|
reading 8192 bytes...
|
29
|
-
-> "{\"payments\":[{\"id\":\"PAY-
|
28
|
+
-> "{\"payments\":[{\"id\":\"PAY-4V176325M4053643WKF4QTYY\",\"create_time\":\"2013-04-25T10:48:03Z\",\"update_time\":\"2013-04-25T10:48:06Z\",\"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\":\"4M440216RW8947146\",\"create_time\":\"2013-04-25T10:48:03Z\",\"update_time\":\"2013-04-25T10:48:06Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-4V176325M4053643WKF4QTYY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4M440216RW8947146\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4M440216RW8947146/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-4V176325M4053643WKF4QTYY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-4V176325M4053643WKF4QTYY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-7TN670764C5298445KF4QPGI\",\"create_time\":\"2013-04-25T10:38:17Z\",\"update_time\":\"2013-04-25T10:38: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\",\"billing_address\":{\"line1\":\"52 N Main ST\",\"city\":\"Johnstown\",\"state\":\"OH\",\"postal_code\":\"43210\",\"country_code\":\"US\"}}}]},\"transactions\":[{\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"sale\":{\"id\":\"76N55507AH5227802\",\"create_time\":\"2013-04-25T10:38:17Z\",\"update_time\":\"2013-04-25T10:38:23Z\",\"state\":\"refunded\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-7TN670764C5298445KF4QPGI\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/76N55507AH5227802\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/76N55507AH5227802/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7TN670764C5298445KF4QPGI\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}},{\"refund\":{\"id\":\"0NV22512548964945\",\"create_time\":\"2013-04-25T10:38:23Z\",\"update_time\":\"2013-04-25T10:38:23Z\",\"state\":\"completed\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-7TN670764C5298445KF4QPGI\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/refund/0NV22512548964945\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7TN670764C5298445KF4QPGI\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7TN670764C5298445KF4QPGI\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-5P318033B9714045TKF4QPEY\",\"create_time\":\"2013-04-25T10:38:11Z\",\"update_time\":\"2013-04-25T10:38:13Z\",\"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\",\"billing_address\":{\"line1\":\"52 N Main ST\",\"city\":\"Johnstown\",\"state\":\"OH\",\"postal_code\":\"43210\",\"country_code\":\"US\"}}}]},\"transactions\":[{\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"sale\":{\"id\":\"4KU48653LS155130Y\",\"create_time\":\"2013-04-25T10:38:11Z\",\"update_time\":\"2013-04-25T10:38:13Z\",\"state\":\"completed\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-5P318033B9714045TKF4QPEY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4KU48653LS155130Y\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4KU48653LS155130Y/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5P318033B9714045TKF4QPEY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5P318033B9714045TKF4QPEY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-1CB2792639156360XKF4QO7A\",\"create_time\":\"2013-04-25T10:37:48Z\",\"update_time\":\"2013-04-25T10:37:51Z\",\"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\",\"billing_address\":{\"line1\":\"52 N Main ST\",\"city\":\"Johnstown\",\"state\":\"OH\",\"postal_code\":\"43210\",\"country_code\":\"US\"}}}]},\"transactions\":[{\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"sale\":{\"id\":\"2H0726929K574474B\",\"create_time\":\"2013-04-25T10:37:48Z\",\"update_time\":\"2013-04-25T10:37:51Z\",\"state\":\"completed\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-1CB2792639156360XKF4QO7A\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2H0726929K574474B\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2H0726929K574474B/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1CB2792639156360XKF4QO7A\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1CB2792639156360XKF4QO7A\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-7V627526C20969744KF4QO5I\",\"create_time\":\"2013-04-25T10:37:41Z\",\"update_time\":\"2013-04-25T10:37:43Z\",\"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\",\"billing_address\":{\"line1\":\"52 N Main ST\",\"city\":\"Johnstown\",\"state\":\"OH\",\"postal_code\":\"43210\",\"country_code\":\"US\"}}}]},\"transactions\":[{\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"sale\":{\"id\":\"83A81899W7817181U\",\"create_time\":\"2013-04-25T10:37:41Z\",\"update_time\":\"2013-04-25T10:37:43Z\",\"state\":\"completed\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-7V627526C20969744KF4QO5I\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/83A81899W7817181U\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/83A81899W7817181U/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7V627526C20969744KF4QO5I\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7V627526C20969744KF4QO5I\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-9N105488J74848037KF4QO3I\",\"create_time\":\"2013-04-25T10:37:33Z\",\"update_time\":\"2013-04-25T10: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\",\"billing_address\":{\"line1\":\"52 N Main ST\",\"city\":\"Johnstown\",\"state\":\"OH\",\"postal_code\":\"43210\",\"country_code\":\"US\"}}}]},\"transactions\":[{\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"sale\":{\"id\":\"4W335777UN8721338\",\"create_time\":\"2013-04-25T10:37:33Z\",\"update_time\":\"2013-04-25T10:37:35Z\",\"state\":\"completed\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-9N105488J74848037KF4QO3I\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4W335777UN8721338\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4W335777UN8721338/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.san"
|
30
29
|
read 8192 bytes
|
31
30
|
reading 2 bytes...
|
32
31
|
-> "\r\n"
|
33
32
|
read 2 bytes
|
34
|
-
-> "
|
35
|
-
reading
|
36
|
-
-> "
|
37
|
-
-> "
|
38
|
-
read
|
33
|
+
-> "142a\r\n"
|
34
|
+
reading 5162 bytes...
|
35
|
+
-> "dbox.paypal.com/v1/payments/payment/PAY-9N105488J74848037KF4QO3I\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-9N105488J74848037KF4QO3I\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-3GL2386337922372BKF4QOZQ\",\"create_time\":\"2013-04-25T10:37:26Z\",\"update_time\":\"2013-04-25T10:37:31Z\",\"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\",\"billing_address\":{\"line1\":\"5"
|
36
|
+
-> "2 N Main ST\",\"city\":\"Johnstown\",\"state\":\"OH\",\"postal_code\":\"43210\",\"country_code\":\"US\"}}}]},\"transactions\":[{\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"sale\":{\"id\":\"0TJ67271619084815\",\"create_time\":\"2013-04-25T10:37:26Z\",\"update_time\":\"2013-04-25T10:37:31Z\",\"state\":\"completed\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-3GL2386337922372BKF4QOZQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0TJ67271619084815\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0TJ67271619084815/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3GL2386337922372BKF4QOZQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3GL2386337922372BKF4QOZQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-96E579680F121110PKF4QKZQ\",\"create_time\":\"2013-04-25T10:28:54Z\",\"update_time\":\"2013-04-25T10:29:53Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"paypal\",\"payer_info\":{\"email\":\"marcin.gorny-1@gmail.com\",\"first_name\":\"biedronka\",\"last_name\":\"biedronka\",\"payer_id\":\"8EUBH3F2SKJL2\"}},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"20.00\"}},\"description\":\"Pizza13\",\"related_resources\":[{\"sale\":{\"id\":\"37E90389LS3825352\",\"create_time\":\"2013-04-25T10:28:54Z\",\"update_time\":\"2013-04-25T10:29:53Z\",\"state\":\"completed\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-96E579680F121110PKF4QKZQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/37E90389LS3825352\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/37E90389LS3825352/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-96E579680F121110PKF4QKZQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-96E579680F121110PKF4QKZQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-93551992F6539335KKF4QHKA\",\"create_time\":\"2013-04-25T10:21:28Z\",\"update_time\":\"2013-04-25T10:21:30Z\",\"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\":\"49M03446R8590435M\",\"create_time\":\"2013-04-25T10:21:28Z\",\"update_time\":\"2013-04-25T10:21:30Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-93551992F6539335KKF4QHKA\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/49M03446R8590435M\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/49M03446R8590435M/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-93551992F6539335KKF4QHKA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-93551992F6539335KKF4QHKA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-3JS16356JD102794YKF4QHHQ\",\"create_time\":\"2013-04-25T10:21:18Z\",\"update_time\":\"2013-04-25T10:21:20Z\",\"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\":\"6LT33095G47591526\",\"create_time\":\"2013-04-25T10:21:18Z\",\"update_time\":\"2013-04-25T10:21:20Z\",\"state\":\"completed\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"parent_payment\":\"PAY-3JS16356JD102794YKF4QHHQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/6LT33095G47591526\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/6LT33095G47591526/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3JS16356JD102794YKF4QHHQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-3JS16356JD102794YKF4QHHQ\",\"rel\":\"self\",\"method\":\"GET\"}]}],\"count\":10,\"next_id\":\"PAY-91801461P3077731NKF4QHGI\"}"
|
37
|
+
read 5162 bytes
|
39
38
|
reading 2 bytes...
|
40
39
|
-> "\r\n"
|
41
40
|
read 2 bytes
|
@@ -44,61 +43,61 @@ read 2 bytes
|
|
44
43
|
Conn keep-alive
|
45
44
|
opening connection to api.sandbox.paypal.com...
|
46
45
|
opened
|
47
|
-
<- "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 oZZJUPoSoOwErVU0Fvf8dWwENTtGDBSERWKfivjakcU\r\nContent-Type: application/json\r\nUser-Agent: paypal-sdk-core/0.2.2 ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux]\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 138\r\n\r\n"
|
48
47
|
<- "{\"type\":\"visa\",\"number\":\"4111111111111111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"cvv2\":\"874\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}"
|
49
48
|
-> "HTTP/1.1 201 Created\r\n"
|
50
49
|
-> "Server: Apache-Coyote/1.1\r\n"
|
51
|
-
-> "
|
52
|
-
-> "
|
50
|
+
-> "Date: Thu, 25 Apr 2013 10:48:15 GMT\r\n"
|
51
|
+
-> "PayPal-Debug-Id: 37464bc9ed4a0\r\n"
|
53
52
|
-> "Content-Type: application/json\r\n"
|
54
53
|
-> "Content-Length: 347\r\n"
|
55
54
|
-> "\r\n"
|
56
55
|
reading 347 bytes...
|
57
|
-
-> "{\"id\":\"CARD-
|
56
|
+
-> "{\"id\":\"CARD-5NK38980C6213343VKF4QT3Y\",\"valid_until\":\"2016-04-24T00: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-5NK38980C6213343VKF4QT3Y\",\"rel\":\"self\",\"method\":\"GET\"}]}"
|
58
57
|
read 347 bytes
|
59
58
|
Conn keep-alive
|
60
59
|
opening connection to api.sandbox.paypal.com...
|
61
60
|
opened
|
62
|
-
<- "GET /v1/vault/credit-card/CARD-
|
61
|
+
<- "GET /v1/vault/credit-card/CARD-5NK38980C6213343VKF4QT3Y HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer oZZJUPoSoOwErVU0Fvf8dWwENTtGDBSERWKfivjakcU\r\nContent-Type: application/json\r\nUser-Agent: paypal-sdk-core/0.2.2 ruby 1.9.3p327 (2012-11-10 revision 37606) [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"
|
63
62
|
-> "HTTP/1.1 200 OK\r\n"
|
64
63
|
-> "Server: Apache-Coyote/1.1\r\n"
|
65
|
-
-> "
|
66
|
-
-> "
|
64
|
+
-> "Date: Thu, 25 Apr 2013 10:48:15 GMT\r\n"
|
65
|
+
-> "PayPal-Debug-Id: 0e9e5226eca6b\r\n"
|
67
66
|
-> "Content-Type: application/json\r\n"
|
68
67
|
-> "Content-Length: 347\r\n"
|
69
68
|
-> "\r\n"
|
70
69
|
reading 347 bytes...
|
71
|
-
-> "{\"id\":\"CARD-
|
70
|
+
-> "{\"id\":\"CARD-5NK38980C6213343VKF4QT3Y\",\"valid_until\":\"2016-04-24T00: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-5NK38980C6213343VKF4QT3Y\",\"rel\":\"self\",\"method\":\"GET\"}]}"
|
72
71
|
read 347 bytes
|
73
72
|
Conn keep-alive
|
74
73
|
opening connection to api.sandbox.paypal.com...
|
75
74
|
opened
|
76
|
-
<- "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 rmEAod96Ok-P8b0L.yjgtceMgptc4H85ahkd-YSyfWA\r\nContent-Type: application/json\r\nUser-Agent: paypal-sdk-core/0.2.2 ruby 1.9.3p327 (2012-11-10 revision 37606) [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"
|
77
76
|
-> "HTTP/1.1 404 Not Found\r\n"
|
78
77
|
-> "Server: Apache-Coyote/1.1\r\n"
|
79
|
-
-> "
|
80
|
-
-> "
|
78
|
+
-> "Date: Thu, 25 Apr 2013 10:48:17 GMT\r\n"
|
79
|
+
-> "PayPal-Debug-Id: 8812df9cec100\r\n"
|
81
80
|
-> "Content-Type: application/json\r\n"
|
82
81
|
-> "Content-Length: 189\r\n"
|
83
82
|
-> "\r\n"
|
84
83
|
reading 189 bytes...
|
85
|
-
-> "{\"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\":\"8812df9cec100\"}"
|
86
85
|
read 189 bytes
|
87
86
|
Conn keep-alive
|
88
87
|
opening connection to api.sandbox.paypal.com...
|
89
88
|
opened
|
90
|
-
<- "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 rmEAod96Ok-P8b0L.yjgtceMgptc4H85ahkd-YSyfWA\r\nContent-Type: application/json\r\nUser-Agent: paypal-sdk-core/0.2.2 ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux]\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 2\r\n\r\n"
|
91
90
|
<- "{}"
|
92
91
|
-> "HTTP/1.1 400 Bad Request\r\n"
|
93
92
|
-> "Server: Apache-Coyote/1.1\r\n"
|
94
|
-
-> "
|
95
|
-
-> "Date: Fri, 22 Mar 2013 13:04:44 GMT\r\n"
|
93
|
+
-> "Date: Thu, 25 Apr 2013 10:48:19 GMT\r\n"
|
96
94
|
-> "Connection: close\r\n"
|
95
|
+
-> "PayPal-Debug-Id: c985399cec4c8\r\n"
|
97
96
|
-> "Content-Type: application/json\r\n"
|
98
97
|
-> "Content-Length: 346\r\n"
|
99
98
|
-> "Connection: close\r\n"
|
100
99
|
-> "\r\n"
|
101
100
|
reading 346 bytes...
|
102
|
-
-> "{\"name\":\"VALIDATION_ERROR\",\"details\":[{\"field\":\"
|
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\":\"c985399cec4c8\"}"
|
103
102
|
read 346 bytes
|
104
103
|
Conn close
|