paypal-sdk-rest 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paypal-sdk/core/api/base.rb +2 -2
- data/lib/paypal-sdk/rest/data_types.rb +128 -0
- data/lib/paypal-sdk/rest/version.rb +1 -1
- data/lib/paypal-sdk/rest.rb +0 -1
- data/spec/config/paypal.yml +4 -4
- data/spec/core/api/rest_spec.rb +1 -1
- data/spec/log/http.log +0 -95
- data/spec/log/rest_http.log +12 -104
- data/spec/payouts_examples_spec.rb +49 -0
- metadata +5 -4
- data/lib/paypal-sdk/rest/extended_data_types.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07db60ccb56f3303a18377ef1dd37992408b989d
|
4
|
+
data.tar.gz: 732ccec842f2490d9ca90aed7240ed002d1ba787
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ad6624e92f98809956058b6c00ac6b86a6f0682602dc2c4dd5a2dfd25fbaf20370d187ba1f2735b463668b79aabc729d03d0b55d7ed0e9f8cfaae23d84c8256
|
7
|
+
data.tar.gz: 47e46b3cc5c57b236e07d4d8a40df90097bdae92624f684d68fa15f3e70a01d3c2476f4eb2223332dfb191457f5d8576202e62f51ba10374dc907019c6b35bfe
|
@@ -91,9 +91,9 @@ module PayPal::SDK::Core
|
|
91
91
|
# * <tt>action</tt> -- Action to perform
|
92
92
|
# * <tt>params</tt> -- (Optional) Parameters for the action
|
93
93
|
# * <tt>initheader</tt> -- (Optional) HTTP header
|
94
|
-
def post(action, params = {}, header = {})
|
94
|
+
def post(action, params = {}, header = {}, query = {})
|
95
95
|
action, params, header = "", action, params if action.is_a? Hash
|
96
|
-
api_call(:method => :post, :action => action, :params => params, :header => header)
|
96
|
+
api_call(:method => :post, :action => action, :query => query, :params => params, :header => header)
|
97
97
|
end
|
98
98
|
alias_method :request, :post
|
99
99
|
|
@@ -91,6 +91,32 @@ module PayPal::SDK
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
+
|
95
|
+
class FuturePayment < Payment
|
96
|
+
|
97
|
+
include PayPal::SDK::OpenIDConnect
|
98
|
+
|
99
|
+
def self.exch_token(auth_code)
|
100
|
+
if auth_code
|
101
|
+
tokeninfo = Tokeninfo.create(auth_code)
|
102
|
+
puts "tokeninfo=", tokeninfo.to_hash
|
103
|
+
tokeninfo
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def create(correlation_id=nil)
|
108
|
+
path = "v1/payments/payment"
|
109
|
+
if correlation_id != nil
|
110
|
+
header = http_header
|
111
|
+
header = header.merge({
|
112
|
+
"PAYPAL-CLIENT-METADATA-ID" => correlation_id})
|
113
|
+
end
|
114
|
+
response = api.post(path, self.to_hash, http_header)
|
115
|
+
self.merge!(response)
|
116
|
+
success?
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
94
120
|
class Payer < Base
|
95
121
|
def self.load_members
|
96
122
|
object_of :payment_method, String
|
@@ -474,6 +500,9 @@ module PayPal::SDK
|
|
474
500
|
|
475
501
|
class Payee < Base
|
476
502
|
def self.load_members
|
503
|
+
object_of :email, String
|
504
|
+
object_of :merchant_id, String
|
505
|
+
object_of :phone, Phone
|
477
506
|
end
|
478
507
|
end
|
479
508
|
|
@@ -729,6 +758,7 @@ module PayPal::SDK
|
|
729
758
|
object_of :message, String
|
730
759
|
object_of :information_link, String
|
731
760
|
array_of :details, ErrorDetails
|
761
|
+
array_of :links, Links
|
732
762
|
end
|
733
763
|
end
|
734
764
|
|
@@ -933,6 +963,104 @@ module PayPal::SDK
|
|
933
963
|
end
|
934
964
|
end
|
935
965
|
|
966
|
+
class Payout < Base
|
967
|
+
|
968
|
+
def self.load_members
|
969
|
+
object_of :sender_batch_header, PayoutSenderBatchHeader
|
970
|
+
array_of :items, PayoutItem
|
971
|
+
end
|
972
|
+
|
973
|
+
include RequestDataType
|
974
|
+
|
975
|
+
def create(sync_mode = false)
|
976
|
+
path = "v1/payments/payouts"
|
977
|
+
options = { :sync_mode => sync_mode }
|
978
|
+
response = api.post(path, self.to_hash, http_header, options)
|
979
|
+
PayoutBatch.new(response)
|
980
|
+
end
|
981
|
+
|
982
|
+
class << self
|
983
|
+
def get(payout_batch_id, options = {})
|
984
|
+
raise ArgumentError.new("id required") if payout_batch_id.to_s.strip.empty?
|
985
|
+
path = "v1/payments/payouts/#{payout_batch_id}"
|
986
|
+
PayoutBatch.new(api.get(path, options))
|
987
|
+
end
|
988
|
+
end
|
989
|
+
end
|
990
|
+
class PayoutItem < Base
|
991
|
+
|
992
|
+
def self.load_members
|
993
|
+
object_of :recipient_type, String
|
994
|
+
object_of :amount, Currency
|
995
|
+
object_of :note, String
|
996
|
+
object_of :receiver, String
|
997
|
+
object_of :sender_item_id, String
|
998
|
+
end
|
999
|
+
|
1000
|
+
include RequestDataType
|
1001
|
+
|
1002
|
+
class << self
|
1003
|
+
def get(payout_item_id)
|
1004
|
+
raise ArgumentError.new("payout_item_id required") if payout_item_id.to_s.strip.empty?
|
1005
|
+
path = "v1/payments/payouts-item/#{payout_item_id}"
|
1006
|
+
PayoutItemDetails.new(api.get(path))
|
1007
|
+
end
|
1008
|
+
def cancel(payout_item_id)
|
1009
|
+
raise ArgumentError.new("payout_item_id required") if payout_item_id.to_s.strip.empty?
|
1010
|
+
path = "v1/payments/payouts-item/#{payout_item_id}/cancel"
|
1011
|
+
PayoutItemDetails.new(api.post(path))
|
1012
|
+
end
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
end
|
1016
|
+
class PayoutItemDetails < Base
|
1017
|
+
|
1018
|
+
def self.load_members
|
1019
|
+
object_of :payout_item_id, String
|
1020
|
+
object_of :transaction_id, String
|
1021
|
+
object_of :transaction_status, String
|
1022
|
+
object_of :payout_item_fee, Currency
|
1023
|
+
object_of :payout_batch_id, String
|
1024
|
+
object_of :sender_batch_id, String
|
1025
|
+
object_of :payout_item, PayoutItem
|
1026
|
+
object_of :time_processed, String
|
1027
|
+
object_of :errors, Error
|
1028
|
+
array_of :links, Links
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
end
|
1032
|
+
class PayoutBatch < Base
|
1033
|
+
|
1034
|
+
def self.load_members
|
1035
|
+
object_of :batch_header, PayoutBatchHeader
|
1036
|
+
array_of :items, PayoutItemDetails
|
1037
|
+
array_of :links, Links
|
1038
|
+
end
|
1039
|
+
|
1040
|
+
end
|
1041
|
+
class PayoutBatchHeader < Base
|
1042
|
+
|
1043
|
+
def self.load_members
|
1044
|
+
object_of :payout_batch_id, String
|
1045
|
+
object_of :batch_status, String
|
1046
|
+
object_of :time_created, String
|
1047
|
+
object_of :time_completed, String
|
1048
|
+
object_of :sender_batch_header, PayoutSenderBatchHeader
|
1049
|
+
object_of :amount, Currency
|
1050
|
+
object_of :fees, Currency
|
1051
|
+
object_of :errors, Error
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
end
|
1055
|
+
class PayoutSenderBatchHeader < Base
|
1056
|
+
|
1057
|
+
def self.load_members
|
1058
|
+
object_of :sender_batch_id, String
|
1059
|
+
object_of :email_subject, String
|
1060
|
+
object_of :recipient_type, String
|
1061
|
+
end
|
1062
|
+
|
1063
|
+
end
|
936
1064
|
class Invoices < Base
|
937
1065
|
def self.load_members
|
938
1066
|
object_of :total_count, Integer
|
data/lib/paypal-sdk/rest.rb
CHANGED
@@ -5,7 +5,6 @@ module PayPal
|
|
5
5
|
module REST
|
6
6
|
autoload :VERSION, "paypal-sdk/rest/version"
|
7
7
|
autoload :DataTypes, "paypal-sdk/rest/data_types"
|
8
|
-
autoload :ExtendedDataTypes, "paypal-sdk/rest/extended_data_types"
|
9
8
|
autoload :API, "paypal-sdk/rest/api"
|
10
9
|
autoload :RequestDataType, "paypal-sdk/rest/request_data_type"
|
11
10
|
autoload :SetAPI, "paypal-sdk/rest/set_api"
|
data/spec/config/paypal.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
test: &default
|
2
|
-
client_id:
|
3
|
-
client_secret:
|
2
|
+
client_id: AYSq3RDGsmBLJE-otTkBtM-jBRd1TCQwFf9RGfwddNXWz0uFU9ztymylOhRS
|
3
|
+
client_secret: EGnHDxD_qRPdaLdZz8iCr8N7_MzF-YHPTkjs6NKYQvQSBngp4PTTVWkPZRbL
|
4
4
|
username: jb-us-seller_api1.paypal.com
|
5
5
|
password: WX4WTU3S8MY44S7F
|
6
6
|
signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
|
@@ -14,8 +14,8 @@ development:
|
|
14
14
|
|
15
15
|
with_authentication:
|
16
16
|
<<: *default
|
17
|
-
client_id:
|
18
|
-
client_secret:
|
17
|
+
client_id: AYSq3RDGsmBLJE-otTkBtM-jBRd1TCQwFf9RGfwddNXWz0uFU9ztymylOhRS
|
18
|
+
client_secret: EGnHDxD_qRPdaLdZz8iCr8N7_MzF-YHPTkjs6NKYQvQSBngp4PTTVWkPZRbL
|
19
19
|
|
20
20
|
with_certificate:
|
21
21
|
<<: *default
|
data/spec/core/api/rest_spec.rb
CHANGED
data/spec/log/http.log
CHANGED
@@ -1,95 +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/vault/credit-card HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015Wzv2g.FBt8R8lMLiC29HZVC3BHrQNHvOJa1fDg9TaIQ\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.0.0 (paypal-sdk-core 0.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: d00d5d2b-5f98-4d8d-92f5-5bb0121983a6\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: 251\r\n\r\n"
|
6
|
-
<- "{\"number\":\"4417119669820331\",\"type\":\"visa\",\"expire_month\":11,\"expire_year\":2018,\"cvv2\":\"874\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\",\"billing_address\":{\"line1\":\"52 N Main ST\",\"city\":\"Johnstown\",\"country_code\":\"US\",\"postal_code\":\"43210\",\"state\":\"OH\"}}"
|
7
|
-
-> "HTTP/1.1 201 Created\r\n"
|
8
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
9
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=374349\r\n"
|
10
|
-
-> "Paypal-Debug-Id: abeff599fbb6d\r\n"
|
11
|
-
-> "Content-Language: *\r\n"
|
12
|
-
-> "Date: Mon, 26 Jan 2015 23:38:22 GMT\r\n"
|
13
|
-
-> "SERVER_INFO: vaultplatformserv:v1.vault.credit-card&CalThreadId=144&TopLevelTxnStartTime=14b289c3a3b&Host=slcsbvaultplatformserv501.slc.paypal.com&pid=26863\r\n"
|
14
|
-
-> "Content-Type: application/json\r\n"
|
15
|
-
-> "Content-Length: 784\r\n"
|
16
|
-
-> "\r\n"
|
17
|
-
reading 784 bytes...
|
18
|
-
-> "{\"id\":\"CARD-8EH41211YH683514LKTDM73Q\",\"state\":\"ok\",\"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\"},\"valid_until\":\"2018-01-25T00:00:00Z\",\"create_time\":\"2015-01-26T23:38:22Z\",\"update_time\":\"2015-01-26T23:38:22Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-8EH41211YH683514LKTDM73Q\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-8EH41211YH683514LKTDM73Q\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-8EH41211YH683514LKTDM73Q\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
|
19
|
-
read 784 bytes
|
20
|
-
Conn keep-alive
|
21
|
-
opening connection to api.sandbox.paypal.com:443...
|
22
|
-
opened
|
23
|
-
starting SSL for api.sandbox.paypal.com:443...
|
24
|
-
SSL established
|
25
|
-
<- "GET /v1/vault/credit-card/CARD-8EH41211YH683514LKTDM73Q HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015Wzv2g.FBt8R8lMLiC29HZVC3BHrQNHvOJa1fDg9TaIQ\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.0.0 (paypal-sdk-core 0.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"
|
26
|
-
-> "HTTP/1.1 200 OK\r\n"
|
27
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
28
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=370412\r\n"
|
29
|
-
-> "Paypal-Debug-Id: 9f6e4c66f44ea\r\n"
|
30
|
-
-> "Content-Language: *\r\n"
|
31
|
-
-> "Date: Mon, 26 Jan 2015 23:38:21 GMT\r\n"
|
32
|
-
-> "SERVER_INFO: vaultplatformserv:v1.vault.credit-card&CalThreadId=145&TopLevelTxnStartTime=14b289c3cc5&Host=slcsbvaultplatformserv501.slc.paypal.com&pid=26863\r\n"
|
33
|
-
-> "Content-Type: application/json\r\n"
|
34
|
-
-> "Content-Length: 784\r\n"
|
35
|
-
-> "\r\n"
|
36
|
-
reading 784 bytes...
|
37
|
-
-> "{\"id\":\"CARD-8EH41211YH683514LKTDM73Q\",\"state\":\"ok\",\"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\"},\"valid_until\":\"2018-01-25T00:00:00Z\",\"create_time\":\"2015-01-26T23:38:22Z\",\"update_time\":\"2015-01-26T23:38:22Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-8EH41211YH683514LKTDM73Q\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-8EH41211YH683514LKTDM73Q\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-8EH41211YH683514LKTDM73Q\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
|
38
|
-
read 784 bytes
|
39
|
-
Conn keep-alive
|
40
|
-
opening connection to api.sandbox.paypal.com:443...
|
41
|
-
opened
|
42
|
-
starting SSL for api.sandbox.paypal.com:443...
|
43
|
-
SSL established
|
44
|
-
<- "POST /v1/vault/credit-card HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015Wzv2g.FBt8R8lMLiC29HZVC3BHrQNHvOJa1fDg9TaIQ\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.0.0 (paypal-sdk-core 0.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: f038736d-035a-4868-a010-4795d2a63d56\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: 80\r\n\r\n"
|
45
|
-
<- "{\"number\":\"4417119669820331\",\"type\":\"visa\",\"expire_month\":11,\"expire_year\":2018}"
|
46
|
-
-> "HTTP/1.1 201 Created\r\n"
|
47
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
48
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=422766\r\n"
|
49
|
-
-> "Paypal-Debug-Id: 8329db02fbfc9\r\n"
|
50
|
-
-> "Content-Language: *\r\n"
|
51
|
-
-> "Date: Mon, 26 Jan 2015 23:38:23 GMT\r\n"
|
52
|
-
-> "SERVER_INFO: vaultplatformserv:v1.vault.credit-card&CalThreadId=144&TopLevelTxnStartTime=14b289c3ed1&Host=slcsbvaultplatformserv501.slc.paypal.com&pid=26863\r\n"
|
53
|
-
-> "Content-Type: application/json\r\n"
|
54
|
-
-> "Content-Length: 626\r\n"
|
55
|
-
-> "\r\n"
|
56
|
-
reading 626 bytes...
|
57
|
-
-> "{\"id\":\"CARD-6E9832748Y127633WKTDM73Y\",\"state\":\"ok\",\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"valid_until\":\"2018-01-25T00:00:00Z\",\"create_time\":\"2015-01-26T23:38:23Z\",\"update_time\":\"2015-01-26T23:38:23Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6E9832748Y127633WKTDM73Y\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6E9832748Y127633WKTDM73Y\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6E9832748Y127633WKTDM73Y\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
|
58
|
-
read 626 bytes
|
59
|
-
Conn keep-alive
|
60
|
-
opening connection to api.sandbox.paypal.com:443...
|
61
|
-
opened
|
62
|
-
starting SSL for api.sandbox.paypal.com:443...
|
63
|
-
SSL established
|
64
|
-
<- "DELETE /v1/vault/credit-card/CARD-6E9832748Y127633WKTDM73Y HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015Wzv2g.FBt8R8lMLiC29HZVC3BHrQNHvOJa1fDg9TaIQ\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.0.0 (paypal-sdk-core 0.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"
|
65
|
-
-> "HTTP/1.1 204 No Content\r\n"
|
66
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
67
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=374349\r\n"
|
68
|
-
-> "Paypal-Debug-Id: 9c6c8f0efc077\r\n"
|
69
|
-
-> "Content-Language: *\r\n"
|
70
|
-
-> "Date: Mon, 26 Jan 2015 23:38:23 GMT\r\n"
|
71
|
-
-> "SERVER_INFO: vaultplatformserv:v1.vault.credit-card&CalThreadId=144&TopLevelTxnStartTime=14b289c412f&Host=slcsbvaultplatformserv501.slc.paypal.com&pid=26863\r\n"
|
72
|
-
-> "\r\n"
|
73
|
-
Conn keep-alive
|
74
|
-
opening connection to api.sandbox.paypal.com:443...
|
75
|
-
opened
|
76
|
-
starting SSL for api.sandbox.paypal.com:443...
|
77
|
-
SSL established
|
78
|
-
<- "POST /v1/vault/credit-card HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015Wzv2g.FBt8R8lMLiC29HZVC3BHrQNHvOJa1fDg9TaIQ\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.0.0 (paypal-sdk-core 0.3.1; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: d74311bb-87da-459a-9781-b41a160e0e63\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: 43\r\n\r\n"
|
79
|
-
<- "{\"number\":\"4111111111111111\",\"type\":\"visa\"}"
|
80
|
-
-> "HTTP/1.1 400 Bad Request\r\n"
|
81
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
82
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=370896\r\n"
|
83
|
-
-> "Paypal-Debug-Id: 9b33f301f3b03\r\n"
|
84
|
-
-> "Content-Language: *\r\n"
|
85
|
-
-> "Date: Mon, 26 Jan 2015 23:38:24 GMT\r\n"
|
86
|
-
-> "SERVER_INFO: vaultplatformserv:v1.vault.credit-card&CalThreadId=145&TopLevelTxnStartTime=14b289c436b&Host=slcsbvaultplatformserv501.slc.paypal.com&pid=26863\r\n"
|
87
|
-
-> "Connection: close\r\n"
|
88
|
-
-> "Content-Type: application/json\r\n"
|
89
|
-
-> "Content-Length: 300\r\n"
|
90
|
-
-> "Connection: close\r\n"
|
91
|
-
-> "\r\n"
|
92
|
-
reading 300 bytes...
|
93
|
-
-> "{\"name\":\"VALIDATION_ERROR\",\"details\":[{\"field\":\"expire_year\",\"issue\":\"Required field missing\"},{\"field\":\"expire_month\",\"issue\":\"Required field missing\"}],\"message\":\"Invalid request - see details\",\"information_link\":\"https://developer.paypal.com/docs/api/#VALIDATION_ERROR\",\"debug_id\":\"9b33f301f3b03\"}"
|
94
|
-
read 300 bytes
|
95
|
-
Conn close
|
data/spec/log/rest_http.log
CHANGED
@@ -2,132 +2,40 @@ 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
|
-
<- "{\"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\"}}]}"
|
7
|
-
-> "HTTP/1.1 201 Created\r\n"
|
8
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
9
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=374562\r\n"
|
10
|
-
-> "Paypal-Debug-Id: 99ae834b04c3b\r\n"
|
11
|
-
-> "SERVER_INFO: paymentsplatformserv:v1.payments.payment&CalThreadId=206&TopLevelTxnStartTime=14b27d3184b&Host=slcsbpaymentsplatformserv3001.slc.paypal.com&pid=22725\r\n"
|
12
|
-
-> "Content-Language: *\r\n"
|
13
|
-
-> "Date: Mon, 26 Jan 2015 19:59:05 GMT\r\n"
|
14
|
-
-> "Content-Type: application/json\r\n"
|
15
|
-
-> "Content-Length: 1176\r\n"
|
16
|
-
-> "\r\n"
|
17
|
-
reading 1176 bytes...
|
18
|
-
-> "{\"id\":\"PAY-0HK26041BK876242NKTDJY4A\",\"create_time\":\"2015-01-26T19:58:40Z\",\"update_time\":\"2015-01-26T19:59:05Z\",\"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\":\"99T986810N230144S\",\"create_time\":\"2015-01-26T19:58:40Z\",\"update_time\":\"2015-01-26T19:59:06Z\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-0HK26041BK876242NKTDJY4A\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/99T986810N230144S\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/99T986810N230144S/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-0HK26041BK876242NKTDJY4A\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-0HK26041BK876242NKTDJY4A\",\"rel\":\"self\",\"method\":\"GET\"}]}"
|
19
|
-
read 1176 bytes
|
20
|
-
Conn keep-alive
|
21
|
-
opening connection to api.sandbox.paypal.com:443...
|
22
|
-
opened
|
23
|
-
starting SSL for api.sandbox.paypal.com:443...
|
24
|
-
SSL established
|
25
|
-
<- "GET /v1/payments/payment?count=10 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015sNxcVEuJGuqxbp8gWg5ytHVFjZERr0GRQ7XwNfL5s-c\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.3.1 (paypal-sdk-core 0.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"
|
26
|
-
-> "HTTP/1.1 200 OK\r\n"
|
27
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
28
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=415614\r\n"
|
29
|
-
-> "Paypal-Debug-Id: ca8ee0440630d\r\n"
|
30
|
-
-> "SERVER_INFO: paymentsplatformserv:v1.payments.payment&CalThreadId=3846&TopLevelTxnStartTime=14b27d37d1d&Host=slcsbpaymentsplatformserv3001.slc.paypal.com&pid=22725\r\n"
|
31
|
-
-> "Content-Language: *\r\n"
|
32
|
-
-> "Date: Mon, 26 Jan 2015 19:59:19 GMT\r\n"
|
33
|
-
-> "Content-Type: application/json\r\n"
|
34
|
-
-> "Transfer-Encoding: chunked\r\n"
|
35
|
-
-> "\r\n"
|
36
|
-
-> "2000\r\n"
|
37
|
-
reading 8192 bytes...
|
38
|
-
-> "{\"payments\":[{\"id\":\"PAY-0HK26041BK876242NKTDJY4A\",\"create_time\":\"2015-01-26T19:58:40Z\",\"update_time\":\"2015-01-26T19:59:05Z\",\"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\":\"99T986810N230144S\",\"create_time\":\"2015-01-26T19:58:40Z\",\"update_time\":\"2015-01-26T19:59:06Z\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-0HK26041BK876242NKTDJY4A\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/99T986810N230144S\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/99T986810N230144S/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-0HK26041BK876242NKTDJY4A\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-0HK26041BK876242NKTDJY4A\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-45N073335H301674BKTDJYLQ\",\"create_time\":\"2015-01-26T19:57:34Z\",\"update_time\":\"2015-01-26T19:57:54Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"1\",\"expire_year\":\"2015\",\"first_name\":\"test\",\"last_name\":\"test\"}}]},\"transactions\":[{\"amount\":{\"total\":\"8.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"8.00\"}},\"description\":\"Transaction for South Dakota Tracs Crash Report.\",\"related_resources\":[{\"sale\":{\"id\":\"09C17155GG552854V\",\"create_time\":\"2015-01-26T19:57:34Z\",\"update_time\":\"2015-01-26T19:57:54Z\",\"amount\":{\"total\":\"8.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-45N073335H301674BKTDJYLQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/09C17155GG552854V\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/09C17155GG552854V/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-45N073335H301674BKTDJYLQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-45N073335H301674BKTDJYLQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-92D80148F0212810HKTDI5SY\",\"create_time\":\"2015-01-26T19:00:27Z\",\"update_time\":\"2015-01-26T19:00:52Z\",\"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\":\"7.47\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"7.47\"}},\"description\":\"This is the payment transaction description.\",\"related_resources\":[{\"sale\":{\"id\":\"7LL39319SX4999041\",\"create_time\":\"2015-01-26T19:00:27Z\",\"update_time\":\"2015-01-26T19:00:52Z\",\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"state\":\"refunded\",\"parent_payment\":\"PAY-92D80148F0212810HKTDI5SY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7LL39319SX4999041\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7LL39319SX4999041/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-92D80148F0212810HKTDI5SY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}},{\"refund\":{\"id\":\"7BK01278LV509382W\",\"create_time\":\"2015-01-26T19:00:52Z\",\"update_time\":\"2015-01-26T19:00:52Z\",\"state\":\"completed\",\"amount\":{\"total\":\"-7.47\",\"currency\":\"USD\"},\"sale_id\":\"7LL39319SX4999041\",\"parent_payment\":\"PAY-92D80148F0212810HKTDI5SY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/refund/7BK01278LV509382W\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-92D80148F0212810HKTDI5SY\",\"rel\":\"parent_payment\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7LL39319SX4999041\",\"rel\":\"sale\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-92D80148F0212810HKTDI5SY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-10B69903JH1072821KTDIPCY\",\"create_time\":\"2015-01-26T18:29:31Z\",\"update_time\":\"2015-01-26T18:29:58Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"paypal\",\"status\":\"VERIFIED\",\"payer_info\":{\"email\":\"nmehta6@wellpledge.com\",\"first_name\":\"nachiket\",\"last_name\":\"mehta\",\"payer_id\":\"XWDD75FTGHJLN\",\"shipping_address\":{\"line1\":\"1 Main St\",\"city\":\"San Jose\",\"state\":\"CA\",\"postal_code\":\"95131\",\"country_code\":\"US\",\"recipient_name\":\"nachiket mehta\"}}},\"transactions\":[{\"amount\":{\"total\":\"100.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"100.00\"}},\"description\":\"Pledge\",\"related_resources\":[{\"sale\":{\"id\":\"3W375242JL947521F\",\"create_time\":\"2015-01-26T18:29:31Z\",\"update_time\":\"2015-01-26T18:29:58Z\",\"amount\":{\"total\":\"100.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-10B69903JH1072821KTDIPCY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/3W375242JL947521F\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/3W375242JL947521F/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-10B69903JH1072821KTDIPCY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-10B69903JH1072821KTDIPCY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-41S95619LR639784UKTDIMSQ\",\"create_time\":\"2015-01-26T18:24:10Z\",\"update_time\":\"2015-01-26T18:24:50Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"paypal\",\"status\":\"VERIFIED\",\"payer_info\":{\"email\":\"nmehta6@wellpledge.com\",\"first_name\":\"nachiket\",\"last_name\":\"mehta\",\"payer_id\":\"XWDD75FTGHJLN\",\"shipping_address\":{\"line1\":\"1 Main St\",\"city\":\"San Jose\",\"state\":\"CA\",\"postal_code\":\"95131\",\"country_code\":\"US\",\"recipient_name\":\"nachiket mehta\"}}},\"transactions\":[{\"amount\":{\"total\":\"5.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"5.00\"}},\"description\":\"Pledge\",\"related_resources\":[{\"sale\":{\"id\":\"56V10528UY3057224\",\"create_time\":\"2015-01-26T18:24:10Z\",\"update_time\":\"2015-01-26T18:24:50Z\",\"amount\":{\"total\":\"5.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-41S95619LR639784UKTDIMSQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/56V10528UY3057224\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/56V10528UY3057224/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-41S95619LR639784UKTDIMSQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-41S95619LR639784UKTDIMSQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-50P28946RR561462GKTDHK5Y\",\"create_time\":\"2015-01-26T17:12:23Z\",\"update_time\":\"2015-01-26T17:12:25Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx9693\",\"expire_month\":\"1\",\"expire_year\":\"2019\",\"first_name\":\"Test\",\"last_name\":\"Test\"}}]},\"transactions\":[{\"amount\":{\"total\":\"59.15\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"59.15\"}},\"description\":\"Payment for order No. 76EE2502-B26A-46F1-BD50-8BE396D8BD57\",\"related_resources\":[{\"sale\":{\"id\":\"4J494696UH2097506\",\"create_time\":\"2015-01-26T17:12:23Z\",\"update_time\":\"2015-01-26T17:12:25Z\",\"amount\":{\"total\":\"59.15\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-50P28946RR561462GKTDHK5Y\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4J494696UH2097506\",\"rel\""
|
39
|
-
read 8192 bytes
|
40
|
-
reading 2 bytes...
|
41
|
-
-> "\r\n"
|
42
|
-
read 2 bytes
|
43
|
-
-> "14e6\r\n"
|
44
|
-
reading 5350 bytes...
|
45
|
-
-> ":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/4J494696UH2097506/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-50P28946RR561462GKTDHK5Y\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-50P28"
|
46
|
-
-> "946RR561462GKTDHK5Y\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-38J73169NH225341CKTDHGDQ\",\"create_time\":\"2015-01-26T17:02:06Z\",\"update_time\":\"2015-01-26T17:02:08Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx9693\",\"expire_month\":\"1\",\"expire_year\":\"2023\",\"first_name\":\"Test\",\"last_name\":\"Test\"}}]},\"transactions\":[{\"amount\":{\"total\":\"111.94\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"111.94\"}},\"description\":\"Payment for order No. 2BC9DB90-BE2B-40D4-A774-52D02DAA9947\",\"related_resources\":[{\"sale\":{\"id\":\"2K6603165A1419111\",\"create_time\":\"2015-01-26T17:02:06Z\",\"update_time\":\"2015-01-26T17:02:08Z\",\"amount\":{\"total\":\"111.94\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-38J73169NH225341CKTDHGDQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2K6603165A1419111\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/2K6603165A1419111/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-38J73169NH225341CKTDHGDQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-38J73169NH225341CKTDHGDQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-28K34334W8115331HKTDG7VY\",\"create_time\":\"2015-01-26T16:48:23Z\",\"update_time\":\"2015-01-26T16:48:25Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2709\",\"expire_month\":\"12\",\"expire_year\":\"2018\",\"first_name\":\"Ash\",\"last_name\":\"Williams\"}}]},\"transactions\":[{\"amount\":{\"total\":\"10.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"10.00\"}},\"description\":\"Your Kraken Store Purchase\",\"related_resources\":[{\"sale\":{\"id\":\"07B09156JR787052Y\",\"create_time\":\"2015-01-26T16:48:23Z\",\"update_time\":\"2015-01-26T16:48:25Z\",\"amount\":{\"total\":\"10.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-28K34334W8115331HKTDG7VY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/07B09156JR787052Y\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/07B09156JR787052Y/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-28K34334W8115331HKTDG7VY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-28K34334W8115331HKTDG7VY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-5YC95627DE8872136KTDG3EA\",\"create_time\":\"2015-01-26T16:38:40Z\",\"update_time\":\"2015-01-26T16:38:45Z\",\"state\":\"approved\",\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"amex\",\"number\":\"xxxxxxxxxxx5005\",\"expire_month\":\"8\",\"expire_year\":\"2026\",\"first_name\":\"i\",\"last_name\":\"i\"}}]},\"transactions\":[{\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"description\":\"Validation request.\",\"related_resources\":[{\"authorization\":{\"id\":\"1MA07760937486001\",\"create_time\":\"2015-01-26T16:38:40Z\",\"update_time\":\"2015-01-26T16:38:45Z\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"state\":\"voided\",\"parent_payment\":\"PAY-5YC95627DE8872136KTDG3EA\",\"valid_until\":\"2015-02-24T16:38:40Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/authorization/1MA07760937486001\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YC95627DE8872136KTDG3EA\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YC95627DE8872136KTDG3EA\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-5JX78789RV369420XKTDGY4Q\",\"create_time\":\"2015-01-26T16:33:54Z\",\"update_time\":\"2015-01-26T16:34:14Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"1\",\"expire_year\":\"2015\",\"first_name\":\"test\",\"last_name\":\"test\"}}]},\"transactions\":[{\"amount\":{\"total\":\"8.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"8.00\"}},\"description\":\"Transaction for South Dakota Tracs Crash Report.\",\"related_resources\":[{\"sale\":{\"id\":\"65N64578SJ086052V\",\"create_time\":\"2015-01-26T16:33:54Z\",\"update_time\":\"2015-01-26T16:34:14Z\",\"amount\":{\"total\":\"8.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-5JX78789RV369420XKTDGY4Q\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/65N64578SJ086052V\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/65N64578SJ086052V/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5JX78789RV369420XKTDGY4Q\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5JX78789RV369420XKTDGY4Q\",\"rel\":\"self\",\"method\":\"GET\"}]}],\"count\":10,\"next_id\":\"PAY-10L26665VD0354626KTDGLNI\"}"
|
47
|
-
read 5350 bytes
|
48
|
-
reading 2 bytes...
|
49
|
-
-> "\r\n"
|
50
|
-
read 2 bytes
|
51
|
-
-> "0\r\n"
|
52
|
-
-> "\r\n"
|
53
|
-
Conn keep-alive
|
54
|
-
opening connection to api.sandbox.paypal.com:443...
|
55
|
-
opened
|
56
|
-
starting SSL for api.sandbox.paypal.com:443...
|
57
|
-
SSL established
|
58
|
-
<- "POST /v1/vault/credit-card HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015ATTrEVx4Rv0emNcK5Uh5u-xmHOqmVeQhTfyo1NVtyTQ\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.3.1 (paypal-sdk-core 0.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: 138\r\n\r\n"
|
59
|
-
<- "{\"type\":\"visa\",\"number\":\"4111111111111111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"cvv2\":\"874\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}"
|
60
|
-
-> "HTTP/1.1 201 Created\r\n"
|
61
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
62
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=415614\r\n"
|
63
|
-
-> "Paypal-Debug-Id: 38bef0de09756\r\n"
|
64
|
-
-> "Content-Language: *\r\n"
|
65
|
-
-> "Date: Mon, 26 Jan 2015 19:59:21 GMT\r\n"
|
66
|
-
-> "SERVER_INFO: vaultplatformserv:v1.vault.credit-card&CalThreadId=138&TopLevelTxnStartTime=14b27d3b772&Host=slcsbvaultplatformserv502.slc.paypal.com&pid=10462\r\n"
|
67
|
-
-> "Content-Type: application/json\r\n"
|
68
|
-
-> "Content-Length: 667\r\n"
|
69
|
-
-> "\r\n"
|
70
|
-
reading 667 bytes...
|
71
|
-
-> "{\"id\":\"CARD-6NM00310BP799084BKTDJZGI\",\"state\":\"ok\",\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx1111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\",\"valid_until\":\"2018-01-25T00:00:00Z\",\"create_time\":\"2015-01-26T19:59:21Z\",\"update_time\":\"2015-01-26T19:59:21Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6NM00310BP799084BKTDJZGI\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6NM00310BP799084BKTDJZGI\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6NM00310BP799084BKTDJZGI\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
|
72
|
-
read 667 bytes
|
73
|
-
Conn keep-alive
|
74
|
-
opening connection to api.sandbox.paypal.com:443...
|
75
|
-
opened
|
76
|
-
starting SSL for api.sandbox.paypal.com:443...
|
77
|
-
SSL established
|
78
|
-
<- "GET /v1/vault/credit-card/CARD-6NM00310BP799084BKTDJZGI HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015ATTrEVx4Rv0emNcK5Uh5u-xmHOqmVeQhTfyo1NVtyTQ\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.3.1 (paypal-sdk-core 0.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"
|
79
|
-
-> "HTTP/1.1 200 OK\r\n"
|
80
|
-
-> "Server: Apache-Coyote/1.1\r\n"
|
81
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=415614\r\n"
|
82
|
-
-> "Paypal-Debug-Id: 9639a1aa09943\r\n"
|
83
|
-
-> "Content-Language: *\r\n"
|
84
|
-
-> "Date: Mon, 26 Jan 2015 19:59:21 GMT\r\n"
|
85
|
-
-> "SERVER_INFO: vaultplatformserv:v1.vault.credit-card&CalThreadId=138&TopLevelTxnStartTime=14b27d3b977&Host=slcsbvaultplatformserv502.slc.paypal.com&pid=10462\r\n"
|
86
|
-
-> "Content-Type: application/json\r\n"
|
87
|
-
-> "Content-Length: 667\r\n"
|
88
|
-
-> "\r\n"
|
89
|
-
reading 667 bytes...
|
90
|
-
-> "{\"id\":\"CARD-6NM00310BP799084BKTDJZGI\",\"state\":\"ok\",\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx1111\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\",\"valid_until\":\"2018-01-25T00:00:00Z\",\"create_time\":\"2015-01-26T19:59:21Z\",\"update_time\":\"2015-01-26T19:59:21Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6NM00310BP799084BKTDJZGI\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6NM00310BP799084BKTDJZGI\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-6NM00310BP799084BKTDJZGI\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
|
91
|
-
read 667 bytes
|
92
|
-
Conn keep-alive
|
93
|
-
opening connection to api.sandbox.paypal.com:443...
|
94
|
-
opened
|
95
|
-
starting SSL for api.sandbox.paypal.com:443...
|
96
|
-
SSL established
|
97
|
-
<- "GET /v1/payments/payment/PAY-1234 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015sNxcVEuJGuqxbp8gWg5ytHVFjZERr0GRQ7XwNfL5s-c\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/sdk-core-ruby 0.3.1 (paypal-sdk-core 0.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"
|
5
|
+
<- "GET /v1/payments/payment/PAY-1234 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0151s9G9kwbT-QvgYpDIZWWzsYqAvuryWr-4xXfS8BOxEE\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 1.1.0 (paypal-sdk-core 1.1.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"
|
98
6
|
-> "HTTP/1.1 404 Not Found\r\n"
|
99
7
|
-> "Server: Apache-Coyote/1.1\r\n"
|
100
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=
|
101
|
-
-> "Paypal-Debug-Id:
|
102
|
-
-> "SERVER_INFO: paymentsplatformserv:v1.payments.payment&CalThreadId=
|
8
|
+
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=424385\r\n"
|
9
|
+
-> "Paypal-Debug-Id: 6eb9d00b5fc9c\r\n"
|
10
|
+
-> "SERVER_INFO: paymentsplatformserv:v1.payments.payment&CalThreadId=173&TopLevelTxnStartTime=14b55b24abc&Host=slcsbpaymentsplatformserv3002.slc.paypal.com&pid=15580\r\n"
|
103
11
|
-> "Content-Language: *\r\n"
|
104
|
-
-> "Date:
|
12
|
+
-> "Date: Wed, 04 Feb 2015 17:45:22 GMT\r\n"
|
105
13
|
-> "Content-Type: application/json\r\n"
|
106
14
|
-> "Content-Length: 207\r\n"
|
107
15
|
-> "\r\n"
|
108
16
|
reading 207 bytes...
|
109
|
-
-> "{\"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\":\"
|
17
|
+
-> "{\"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\":\"6eb9d00b5fc9c\"}"
|
110
18
|
read 207 bytes
|
111
19
|
Conn keep-alive
|
112
20
|
opening connection to api.sandbox.paypal.com:443...
|
113
21
|
opened
|
114
22
|
starting SSL for api.sandbox.paypal.com:443...
|
115
23
|
SSL established
|
116
|
-
<- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer
|
24
|
+
<- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0151s9G9kwbT-QvgYpDIZWWzsYqAvuryWr-4xXfS8BOxEE\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/rest-sdk-ruby 1.1.0 (paypal-sdk-core 1.1.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\nContent-Length: 2\r\n\r\n"
|
117
25
|
<- "{}"
|
118
26
|
-> "HTTP/1.1 400 Bad Request\r\n"
|
119
27
|
-> "Server: Apache-Coyote/1.1\r\n"
|
120
|
-
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=
|
121
|
-
-> "Paypal-Debug-Id:
|
122
|
-
-> "SERVER_INFO: paymentsplatformserv:v1.payments.payment&CalThreadId=90&TopLevelTxnStartTime=
|
28
|
+
-> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=370470\r\n"
|
29
|
+
-> "Paypal-Debug-Id: b8c9adce5c2d1\r\n"
|
30
|
+
-> "SERVER_INFO: paymentsplatformserv:v1.payments.payment&CalThreadId=90&TopLevelTxnStartTime=14b55b24c7e&Host=slcsbpaymentsplatformserv3001.slc.paypal.com&pid=22725\r\n"
|
123
31
|
-> "Content-Language: *\r\n"
|
124
|
-
-> "Date:
|
32
|
+
-> "Date: Wed, 04 Feb 2015 17:45:22 GMT\r\n"
|
125
33
|
-> "Connection: close\r\n"
|
126
34
|
-> "Content-Type: application/json\r\n"
|
127
35
|
-> "Content-Length: 306\r\n"
|
128
36
|
-> "Connection: close\r\n"
|
129
37
|
-> "\r\n"
|
130
38
|
reading 306 bytes...
|
131
|
-
-> "{\"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\":\"
|
39
|
+
-> "{\"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\":\"b8c9adce5c2d1\"}"
|
132
40
|
read 306 bytes
|
133
41
|
Conn close
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Payouts", :integration => true do
|
4
|
+
|
5
|
+
PayoutAttributes = {
|
6
|
+
:sender_batch_header => {
|
7
|
+
:sender_batch_id => SecureRandom.hex(8),
|
8
|
+
:email_subject => 'You have a Payout!'
|
9
|
+
},
|
10
|
+
:items => [
|
11
|
+
{
|
12
|
+
:recipient_type => 'EMAIL',
|
13
|
+
:amount => {
|
14
|
+
:value => '1.0',
|
15
|
+
:currency => 'USD'
|
16
|
+
},
|
17
|
+
:note => 'Thanks for your patronage!',
|
18
|
+
:sender_item_id => '2014031400023',
|
19
|
+
:receiver => 'shirt-supplier-one@mail.com'
|
20
|
+
}
|
21
|
+
]
|
22
|
+
}
|
23
|
+
|
24
|
+
it "create payout sync" do
|
25
|
+
$payout = PayPal::SDK::REST::Payout.new(PayoutAttributes)
|
26
|
+
$payout_batch = $payout.create(true)
|
27
|
+
expect($payout_batch).to be_truthy
|
28
|
+
end
|
29
|
+
|
30
|
+
it "get payout batch status" do
|
31
|
+
$result = PayPal::SDK::REST::Payout.get($payout_batch.batch_header.payout_batch_id)
|
32
|
+
expect($result).to be_a PayPal::SDK::REST::PayoutBatch
|
33
|
+
expect($payout_batch.batch_header.payout_batch_id).to eql $result.batch_header.payout_batch_id
|
34
|
+
end
|
35
|
+
|
36
|
+
it "get payout item status" do
|
37
|
+
$payout_item_details= PayoutItem.get($payout_batch.items[0].payout_item_id)
|
38
|
+
expect($payout_item_details).to be_a PayPal::SDK::REST::PayoutItemDetails
|
39
|
+
expect($payout_item_details.payout_item_id).to eql $payout_batch.items[0].payout_item_id
|
40
|
+
end
|
41
|
+
|
42
|
+
it "cancel unclaimed payouts" do
|
43
|
+
$payout_item_details= PayoutItem.cancel($payout_batch.items[0].payout_item_id)
|
44
|
+
expect($payout_item_details).to be_a PayPal::SDK::REST::PayoutItemDetails
|
45
|
+
expect($payout_item_details.payout_item_id).to eql $payout_batch.items[0].payout_item_id
|
46
|
+
expect($payout_item_details.transaction_status).to eql 'RETURNED'
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
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.
|
4
|
+
version: 1.1.0
|
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-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -115,7 +115,6 @@ files:
|
|
115
115
|
- lib/paypal-sdk/rest/api.rb
|
116
116
|
- lib/paypal-sdk/rest/data_types.rb
|
117
117
|
- lib/paypal-sdk/rest/error_hash.rb
|
118
|
-
- lib/paypal-sdk/rest/extended_data_types.rb
|
119
118
|
- lib/paypal-sdk/rest/get_api.rb
|
120
119
|
- lib/paypal-sdk/rest/request_data_type.rb
|
121
120
|
- lib/paypal-sdk/rest/set_api.rb
|
@@ -134,6 +133,7 @@ files:
|
|
134
133
|
- spec/log/http.log
|
135
134
|
- spec/log/rest_http.log
|
136
135
|
- spec/payments_examples_spec.rb
|
136
|
+
- spec/payouts_examples_spec.rb
|
137
137
|
- spec/spec_helper.rb
|
138
138
|
- spec/subscription_examples_spec.rb
|
139
139
|
- spec/support/sample_data.rb
|
@@ -177,6 +177,7 @@ test_files:
|
|
177
177
|
- spec/log/http.log
|
178
178
|
- spec/log/rest_http.log
|
179
179
|
- spec/payments_examples_spec.rb
|
180
|
+
- spec/payouts_examples_spec.rb
|
180
181
|
- spec/spec_helper.rb
|
181
182
|
- spec/subscription_examples_spec.rb
|
182
183
|
- spec/support/sample_data.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module PayPal::SDK
|
2
|
-
module REST
|
3
|
-
module DataTypes
|
4
|
-
class FuturePayment < Payment
|
5
|
-
def self.exch_token(auth_code)
|
6
|
-
if auth_code
|
7
|
-
token = PayPal::SDK::Core::API::REST.new.token(auth_code)
|
8
|
-
token
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def create(correlation_id=nil)
|
13
|
-
path = "v1/payments/payment"
|
14
|
-
if correlation_id != nil
|
15
|
-
header = http_header
|
16
|
-
header = header.merge({
|
17
|
-
"PAYPAL-CLIENT-METADATA-ID" => correlation_id})
|
18
|
-
end
|
19
|
-
response = api.post(path, self.to_hash, http_header)
|
20
|
-
self.merge!(response)
|
21
|
-
success?
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|