paypal-sdk-rest 1.2.2 → 1.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 372cce56f9c8f39f981163f3c9bb7226f8ee7981
4
- data.tar.gz: dd24faf28703594ac0d39d07026223a427c3474f
3
+ metadata.gz: 1369829fd94d5e5c88efc0b2eb125d831530db5c
4
+ data.tar.gz: 4edb7a761901ad85b11d9f4bb1c088dbefec5a08
5
5
  SHA512:
6
- metadata.gz: 33d095832416300c578b28e6ce58cf9f3c3c6a0f453888bc3709b5f2e8b7057794f0092441d1d5eb4c4d24236c08544e58f4aa7a54074d1bb6411280c945cce0
7
- data.tar.gz: 8ff319e99d3990957b7eac12ee133bfcf354d749c03168b6bd3cccb7625b932f6a419a54a46a730d959fb4928c82be6fa0d6eebba0adcb3b7c9de6f197e859da
6
+ metadata.gz: 3a71e40ce13cca8caed3e4baa7b69f74b3b7c3a86bb642a5bed156674ad8046d8959a5f16c83366f4692beecaccc5a143739df6f5b19c562b41c40719e88d5df
7
+ data.tar.gz: b59fcd91ee22538d89df29297b990286dc89df150fc111864ef55019c2781bcfa7306266848c741dfd52f582d078d6c1faa4960ce9126aae03be7040c1e64fd3
data/README.md CHANGED
@@ -193,6 +193,9 @@ end
193
193
  ## Create Future Payment
194
194
  [Future Payments](https://developer.paypal.com/docs/integration/mobile/make-future-payment/) sample is available [here](https://github.com/paypal/rest-api-sdk-ruby/blob/master/spec/payments_examples_spec.rb#L149)
195
195
 
196
+ ## Webhook event validation
197
+ See [webhook event validation code sample](https://github.com/paypal/PayPal-Ruby-SDK/blob/master/samples/notifications/verify_webhook_event.rb) and [webhook event validation docs](https://developer.paypal.com/docs/integration/direct/rest-webhooks-overview/#event-signature)
198
+
196
199
  ## OpenID Connect
197
200
 
198
201
  ```ruby
@@ -0,0 +1,23 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
3
+ MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
4
+ d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
5
+ ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
6
+ MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
7
+ LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
8
+ RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
9
+ +9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
10
+ PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
11
+ xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
12
+ Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
13
+ hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
14
+ EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
15
+ MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
16
+ FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
17
+ nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
18
+ eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
19
+ hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
20
+ Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
21
+ vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
22
+ +OkuE6N36B9K
23
+ -----END CERTIFICATE-----
@@ -0,0 +1,28 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEtjCCA56gAwIBAgIQDHmpRLCMEZUgkmFf4msdgzANBgkqhkiG9w0BAQsFADBs
3
+ MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
4
+ d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
5
+ ZSBFViBSb290IENBMB4XDTEzMTAyMjEyMDAwMFoXDTI4MTAyMjEyMDAwMFowdTEL
6
+ MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
7
+ LmRpZ2ljZXJ0LmNvbTE0MDIGA1UEAxMrRGlnaUNlcnQgU0hBMiBFeHRlbmRlZCBW
8
+ YWxpZGF0aW9uIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
9
+ ggEBANdTpARR+JmmFkhLZyeqk0nQOe0MsLAAh/FnKIaFjI5j2ryxQDji0/XspQUY
10
+ uD0+xZkXMuwYjPrxDKZkIYXLBxA0sFKIKx9om9KxjxKws9LniB8f7zh3VFNfgHk/
11
+ LhqqqB5LKw2rt2O5Nbd9FLxZS99RStKh4gzikIKHaq7q12TWmFXo/a8aUGxUvBHy
12
+ /Urynbt/DvTVvo4WiRJV2MBxNO723C3sxIclho3YIeSwTQyJ3DkmF93215SF2AQh
13
+ cJ1vb/9cuhnhRctWVyh+HA1BV6q3uCe7seT6Ku8hI3UarS2bhjWMnHe1c63YlC3k
14
+ 8wyd7sFOYn4XwHGeLN7x+RAoGTMCAwEAAaOCAUkwggFFMBIGA1UdEwEB/wQIMAYB
15
+ Af8CAQAwDgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
16
+ BQcDAjA0BggrBgEFBQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRp
17
+ Z2ljZXJ0LmNvbTBLBgNVHR8ERDBCMECgPqA8hjpodHRwOi8vY3JsNC5kaWdpY2Vy
18
+ dC5jb20vRGlnaUNlcnRIaWdoQXNzdXJhbmNlRVZSb290Q0EuY3JsMD0GA1UdIAQ2
19
+ MDQwMgYEVR0gADAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5j
20
+ b20vQ1BTMB0GA1UdDgQWBBQ901Cl1qCt7vNKYApl0yHU+PjWDzAfBgNVHSMEGDAW
21
+ gBSxPsNpA/i/RwHUmCYaCALvY2QrwzANBgkqhkiG9w0BAQsFAAOCAQEAnbbQkIbh
22
+ hgLtxaDwNBx0wY12zIYKqPBKikLWP8ipTa18CK3mtlC4ohpNiAexKSHc59rGPCHg
23
+ 4xFJcKx6HQGkyhE6V6t9VypAdP3THYUYUN9XR3WhfVUgLkc3UHKMf4Ib0mKPLQNa
24
+ 2sPIoc4sUqIAY+tzunHISScjl2SFnjgOrWNoPLpSgVh5oywM395t6zHyuqB8bPEs
25
+ 1OG9d4Q3A84ytciagRpKkk47RpqF/oOi+Z6Mo8wNXrM9zwR4jxQUezKcxwCmXMS1
26
+ oVWNWlZopCJwqjyBcdmdqEU79OX2olHdx3ti6G8MdOu42vi/hw15UJGQmxg7kVkn
27
+ 8TUoE6smftX3eg==
28
+ -----END CERTIFICATE-----
@@ -1,6 +1,9 @@
1
1
  require 'paypal-sdk-core'
2
2
  require 'uuidtools'
3
3
  require 'multi_json'
4
+ require 'open-uri'
5
+ require 'zlib'
6
+ require "base64"
4
7
 
5
8
  module PayPal::SDK
6
9
  module REST
@@ -1085,6 +1088,62 @@ module PayPal::SDK
1085
1088
 
1086
1089
  class << self
1087
1090
 
1091
+ def get_cert(cert_url)
1092
+ data = open(cert_url).read()
1093
+ cert = OpenSSL::X509::Certificate.new data
1094
+ end
1095
+
1096
+ def get_cert_chain()
1097
+ root_cert = "data/DigiCertHighAssuranceEVRootCA.pem"
1098
+ intermediate_cert = "data/DigiCertSHA2ExtendedValidationServerCA.pem"
1099
+
1100
+ cert_store = OpenSSL::X509::Store.new
1101
+ cert_store.add_file(root_cert)
1102
+ cert_store.add_file(intermediate_cert)
1103
+
1104
+ cert_store
1105
+ end
1106
+
1107
+ def get_expected_sig(transmission_id, timestamp, webhook_id, event_body)
1108
+ crc = Zlib::crc32(event_body).to_s
1109
+ transmission_id + "|" + timestamp + "|" + webhook_id + "|" + crc
1110
+ end
1111
+
1112
+ def verify_common_name(cert)
1113
+ common_name = cert.subject.to_a.select{|name, _, _| name == 'CN' }.first[1]
1114
+
1115
+ common_name.start_with?("messageverificationcerts.") && common_name.end_with?("paypal.com")
1116
+ end
1117
+
1118
+ def verify_signature(transmission_id, timestamp, webhook_id, event_body, cert, actual_sig_encoded, algo)
1119
+ expected_sig = get_expected_sig(transmission_id, timestamp, webhook_id, event_body)
1120
+
1121
+ digest = OpenSSL::Digest.new(algo)
1122
+ digest.update(expected_sig)
1123
+ actual_sig = Base64.decode64(actual_sig_encoded).force_encoding('UTF-8')
1124
+
1125
+ cert.public_key.verify(digest, actual_sig, expected_sig)
1126
+ end
1127
+
1128
+ def verify_expiration(cert)
1129
+ cert.not_after >= Time.now
1130
+ end
1131
+
1132
+ def verify_cert_chain(cert_store, cert)
1133
+ cert_store.verify(cert)
1134
+ end
1135
+
1136
+ def verify_cert(cert)
1137
+ cert_store = get_cert_chain()
1138
+
1139
+ verify_cert_chain(cert_store, cert) && verify_common_name(cert) && verify_expiration(cert)
1140
+ end
1141
+
1142
+ def verify(transmission_id, timestamp, webhook_id, event_body, cert_url, sig, algo='sha256')
1143
+ cert = get_cert(cert_url)
1144
+ verify_signature(transmission_id, timestamp, webhook_id, event_body, cert, sig, algo) && verify_cert(cert)
1145
+ end
1146
+
1088
1147
  def get_resource_class(name)
1089
1148
  class_array = PayPal::SDK::REST.constants.select {|c| Class === PayPal::SDK::REST.const_get(c)}
1090
1149
  class_array.each do |classname|
@@ -1,7 +1,7 @@
1
1
  module PayPal
2
2
  module SDK
3
3
  module REST
4
- VERSION = "1.2.2"
4
+ VERSION = "1.3.0"
5
5
  end
6
6
  end
7
7
  end
data/spec/log/http.log CHANGED
@@ -2,512 +2,106 @@ 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
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 6a34969e-003d-4f69-a7b8-b03cff0bbc0d\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: 473\r\n\r\n"
6
- <- "{\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
7
- -> "HTTP/1.1 503 Service Unavailable\r\n"
8
- -> "Date: Wed, 17 Jun 2015 20:09:11 GMT\r\n"
9
- -> "Server: Apache\r\n"
10
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=205618\r\n"
11
- -> "Paypal-Debug-Id: cc3c3ae9bd7e2\r\n"
12
- -> "Connection: close\r\n"
13
- -> "Content-Length: 145\r\n"
14
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D3889398101; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
15
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
16
- -> "Vary: Authorization\r\n"
17
- -> "Content-Type: application/json\r\n"
18
- -> "\r\n"
19
- reading 145 bytes...
20
- -> "{\"name\":\"INTERNAL_SERVICE_ERROR\",\"information_link\":\"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR\",\"debug_id\":\"cc3c3ae9bd7e2\"}"
21
- read 145 bytes
22
- Conn close
23
- opening connection to api.sandbox.paypal.com:443...
24
- opened
25
- starting SSL for api.sandbox.paypal.com:443...
26
- SSL established
27
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: de1e1d88-0425-4dbc-b3e9-3784d5e7f279\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: 473\r\n\r\n"
28
- <- "{\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
29
- -> "HTTP/1.1 503 Service Unavailable\r\n"
30
- -> "Date: Wed, 17 Jun 2015 20:09:41 GMT\r\n"
31
- -> "Server: Apache\r\n"
32
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=1343\r\n"
33
- -> "Paypal-Debug-Id: bfefcb49c5fc9\r\n"
34
- -> "Connection: close\r\n"
35
- -> "Content-Length: 145\r\n"
36
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D97812821; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
37
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
38
- -> "Vary: Authorization\r\n"
39
- -> "Content-Type: application/json\r\n"
40
- -> "\r\n"
41
- reading 145 bytes...
42
- -> "{\"name\":\"INTERNAL_SERVICE_ERROR\",\"information_link\":\"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR\",\"debug_id\":\"bfefcb49c5fc9\"}"
43
- read 145 bytes
44
- Conn close
45
- opening connection to api.sandbox.paypal.com:443...
46
- opened
47
- starting SSL for api.sandbox.paypal.com:443...
48
- SSL established
49
- <- "GET /v1/payments/payment?count=5 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
50
- -> "HTTP/1.1 200 OK\r\n"
51
- -> "Date: Wed, 17 Jun 2015 20:11:17 GMT\r\n"
52
- -> "Server: Apache\r\n"
53
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=143924\r\n"
54
- -> "Paypal-Debug-Id: 8d142c0adc73a\r\n"
55
- -> "Content-Language: *\r\n"
56
- -> "Content-Length: 7531\r\n"
57
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1708425557; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
58
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
59
- -> "Vary: Authorization\r\n"
60
- -> "Connection: close\r\n"
61
- -> "Content-Type: application/json\r\n"
62
- -> "\r\n"
63
- reading 7531 bytes...
64
- -> "{\"payments\":[{\"id\":\"PAY-1L064882YM848125EKWA2KNY\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581a536538b2\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"84X3439975017913M\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-1L064882YM848125EKWA2KNY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-5P879024BL580121AKWA2KLY\",\"create_time\":\"2015-06-17T16:49:51Z\",\"update_time\":\"2015-06-17T16:49:52Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581a52e66f48\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"7139905619919533H\",\"create_time\":\"2015-06-17T16:49:51Z\",\"update_time\":\"2015-06-17T16:49:53Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-5P879024BL580121AKWA2KLY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7139905619919533H\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/7139905619919533H/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5P879024BL580121AKWA2KLY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5P879024BL580121AKWA2KLY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-71588288N5609270KKWA2KDQ\",\"create_time\":\"2015-06-17T16:49:18Z\",\"update_time\":\"2015-06-17T16:49:20Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581a50dc0772\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"11L23280EN666033H\",\"create_time\":\"2015-06-17T16:49:18Z\",\"update_time\":\"2015-06-17T16:49:20Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-71588288N5609270KKWA2KDQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/11L23280EN666033H\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/11L23280EN666033H/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-71588288N5609270KKWA2KDQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-71588288N5609270KKWA2KDQ\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-5JV234464B4587748KWA2KCY\",\"create_time\":\"2015-06-17T16:49:15Z\",\"update_time\":\"2015-06-17T16:49:19Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx7004\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"12.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"12.00\"}},\"description\":\"creating a payment with saved credit card\",\"related_resources\":[{\"sale\":{\"id\":\"0BM42811PC1943402\",\"create_time\":\"2015-06-17T16:49:15Z\",\"update_time\":\"2015-06-17T16:49:19Z\",\"amount\":{\"total\":\"12.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-5JV234464B4587748KWA2KCY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0BM42811PC1943402\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/0BM42811PC1943402/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5JV234464B4587748KWA2KCY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-5JV234464B4587748KWA2KCY\",\"rel\":\"self\",\"method\":\"GET\"}]},{\"id\":\"PAY-8A782675LK9634848KWA2KAQ\",\"create_time\":\"2015-06-17T16:49:06Z\",\"update_time\":\"2015-06-17T16:49:08Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581a50190151\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"26C6249590321562V\",\"create_time\":\"2015-06-17T16:49:06Z\",\"update_time\":\"2015-06-17T16:49:08Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-8A782675LK9634848KWA2KAQ\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/26C6249590321562V\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/26C6249590321562V/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-8A782675LK9634848KWA2KAQ\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-8A782675LK9634848KWA2KAQ\",\"rel\":\"self\",\"method\":\"GET\"}]}],\"count\":5,\"next_id\":\"PAY-9CN47781W2102693AKWA2J2Y\"}"
65
- read 7531 bytes
66
- Conn close
67
- opening connection to api.sandbox.paypal.com:443...
68
- opened
69
- starting SSL for api.sandbox.paypal.com:443...
70
- SSL established
71
- <- "GET /v1/payments/payment?count=1 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
72
- -> "HTTP/1.1 200 OK\r\n"
73
- -> "Date: Wed, 17 Jun 2015 20:11:22 GMT\r\n"
5
+ <- "POST /v1/notifications/webhooks HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 18a117b6-aa14-4705-bf80-d9fe6552a133\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\nContent-Length: 161\r\n\r\n"
6
+ <- "{\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\"}]}"
7
+ -> "HTTP/1.1 201 Created\r\n"
8
+ -> "Date: Mon, 29 Jun 2015 00:16:47 GMT\r\n"
74
9
  -> "Server: Apache\r\n"
75
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=236\r\n"
76
- -> "Paypal-Debug-Id: aa10c6b7dad5c\r\n"
10
+ -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=199\r\n"
11
+ -> "Paypal-Debug-Id: ca3b32418d9db\r\n"
77
12
  -> "Content-Language: *\r\n"
78
- -> "Content-Length: 1622\r\n"
79
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1792311637; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
13
+ -> "Content-Length: 650\r\n"
14
+ -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1871614037; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
80
15
  -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
81
16
  -> "Vary: Authorization\r\n"
82
17
  -> "Connection: close\r\n"
83
18
  -> "Content-Type: application/json\r\n"
84
19
  -> "\r\n"
85
- reading 1622 bytes...
86
- -> "{\"payments\":[{\"id\":\"PAY-1L064882YM848125EKWA2KNY\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581a536538b2\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"84X3439975017913M\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-1L064882YM848125EKWA2KNY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"self\",\"method\":\"GET\"}]}],\"count\":1,\"next_id\":\"PAY-5P879024BL580121AKWA2KLY\"}"
87
- read 1622 bytes
20
+ reading 650 bytes...
21
+ -> "{\"id\":\"50T98599JH617711K\",\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"delete\",\"method\":\"DELETE\"}]}"
22
+ read 650 bytes
88
23
  Conn close
89
24
  opening connection to api.sandbox.paypal.com:443...
90
25
  opened
91
26
  starting SSL for api.sandbox.paypal.com:443...
92
27
  SSL established
93
- <- "GET /v1/payments/payment/PAY-1L064882YM848125EKWA2KNY HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
28
+ <- "GET /v1/notifications/webhooks/50T98599JH617711K HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
94
29
  -> "HTTP/1.1 200 OK\r\n"
95
- -> "Date: Wed, 17 Jun 2015 20:11:26 GMT\r\n"
96
- -> "Server: Apache\r\n"
97
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=45759\r\n"
98
- -> "Paypal-Debug-Id: 4ed852f5da53f\r\n"
99
- -> "Content-Language: *\r\n"
100
- -> "Content-Length: 1556\r\n"
101
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1859420501; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
102
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
103
- -> "Vary: Authorization\r\n"
104
- -> "Connection: close\r\n"
105
- -> "Content-Type: application/json\r\n"
106
- -> "\r\n"
107
- reading 1556 bytes...
108
- -> "{\"id\":\"PAY-1L064882YM848125EKWA2KNY\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581a536538b2\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"84X3439975017913M\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-1L064882YM848125EKWA2KNY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"self\",\"method\":\"GET\"}]}"
109
- read 1556 bytes
110
- Conn close
111
- opening connection to api.sandbox.paypal.com:443...
112
- opened
113
- starting SSL for api.sandbox.paypal.com:443...
114
- SSL established
115
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: de7dec6c-fd77-459d-9a23-c412f995adc2\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"
116
- <- "{}"
117
- -> "HTTP/1.1 400 Bad Request\r\n"
118
- -> "Date: Wed, 17 Jun 2015 20:11:27 GMT\r\n"
119
- -> "Server: Apache\r\n"
120
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=204826\r\n"
121
- -> "Paypal-Debug-Id: fffd0333dbfd5\r\n"
122
- -> "Content-Language: *\r\n"
123
- -> "Connection: close\r\n"
124
- -> "Connection: close\r\n"
125
- -> "Content-Length: 306\r\n"
126
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1876197717; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
127
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
128
- -> "Vary: Authorization\r\n"
129
- -> "Content-Type: application/json\r\n"
130
- -> "\r\n"
131
- reading 306 bytes...
132
- -> "{\"name\":\"VALIDATION_ERROR\",\"details\":[{\"field\":\"intent\",\"issue\":\"Required field missing\"},{\"field\":\"payer\",\"issue\":\"Required field missing\"}],\"message\":\"Invalid request - see details\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR\",\"debug_id\":\"fffd0333dbfd5\"}"
133
- read 306 bytes
134
- Conn close
135
- opening connection to api.sandbox.paypal.com:443...
136
- opened
137
- starting SSL for api.sandbox.paypal.com:443...
138
- SSL established
139
- <- "GET /v1/payments/payment/Invalid HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
140
- -> "HTTP/1.1 404 Not Found\r\n"
141
- -> "Date: Wed, 17 Jun 2015 20:11:29 GMT\r\n"
30
+ -> "Date: Mon, 29 Jun 2015 00:16:47 GMT\r\n"
142
31
  -> "Server: Apache\r\n"
143
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=29889\r\n"
144
- -> "Paypal-Debug-Id: 02b24159db056\r\n"
32
+ -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=528494\r\n"
33
+ -> "Paypal-Debug-Id: 655c05e28d8fa\r\n"
145
34
  -> "Content-Language: *\r\n"
146
- -> "Content-Length: 207\r\n"
147
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1909752149; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
148
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
149
- -> "Vary: Authorization\r\n"
150
- -> "Connection: close\r\n"
151
- -> "Content-Type: application/json\r\n"
152
- -> "\r\n"
153
- reading 207 bytes...
154
- -> "{\"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\":\"02b24159db056\"}"
155
- read 207 bytes
156
- Conn close
157
- opening connection to api.sandbox.paypal.com:443...
158
- opened
159
- starting SSL for api.sandbox.paypal.com:443...
160
- SSL established
161
- <- "GET /v1/payments/payment?count=1 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer ExpiredA015HHkSlZUmJlc4CzvCpL5xjeqPY-KteqkQLrnWoUy7AaY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
162
- -> "HTTP/1.1 401 Unauthorized\r\n"
163
- -> "Date: Wed, 17 Jun 2015 20:11:30 GMT\r\n"
164
- -> "Server: Apache\r\n"
165
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=27110\r\n"
166
- -> "Paypal-Debug-Id: 653102f2db7ab\r\n"
167
- -> "Content-Length: 0\r\n"
168
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1926529365; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
35
+ -> "Content-Length: 650\r\n"
36
+ -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1871614037; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
169
37
  -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
170
38
  -> "Vary: Authorization\r\n"
171
39
  -> "Connection: close\r\n"
172
40
  -> "Content-Type: application/json\r\n"
173
41
  -> "\r\n"
174
- reading 0 bytes...
175
- -> ""
176
- read 0 bytes
42
+ reading 650 bytes...
43
+ -> "{\"id\":\"50T98599JH617711K\",\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"delete\",\"method\":\"DELETE\"}]}"
44
+ read 650 bytes
177
45
  Conn close
178
46
  opening connection to api.sandbox.paypal.com:443...
179
47
  opened
180
48
  starting SSL for api.sandbox.paypal.com:443...
181
49
  SSL established
182
- <- "GET /v1/payments/payment?count=1 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
50
+ <- "GET /v1/notifications/webhooks HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
183
51
  -> "HTTP/1.1 200 OK\r\n"
184
- -> "Date: Wed, 17 Jun 2015 20:11:31 GMT\r\n"
52
+ -> "Date: Mon, 29 Jun 2015 00:16:48 GMT\r\n"
185
53
  -> "Server: Apache\r\n"
186
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=28145\r\n"
187
- -> "Paypal-Debug-Id: 1e434e08d8fab\r\n"
54
+ -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=600\r\n"
55
+ -> "Paypal-Debug-Id: 666c52848db49\r\n"
188
56
  -> "Content-Language: *\r\n"
189
- -> "Content-Length: 1622\r\n"
190
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1943306581; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
57
+ -> "Content-Length: 1311\r\n"
58
+ -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1888391253; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
191
59
  -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
192
60
  -> "Vary: Authorization\r\n"
193
61
  -> "Connection: close\r\n"
194
62
  -> "Content-Type: application/json\r\n"
195
63
  -> "\r\n"
196
- reading 1622 bytes...
197
- -> "{\"payments\":[{\"id\":\"PAY-1L064882YM848125EKWA2KNY\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"state\":\"approved\",\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx2259\",\"expire_month\":\"11\",\"expire_year\":\"2019\",\"first_name\":\"Joe\",\"last_name\":\"Shopper\"}}]},\"transactions\":[{\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"17.50\",\"tax\":\"1.30\",\"shipping\":\"1.20\"}},\"description\":\"Payment description\",\"invoice_number\":\"5581a536538b2\",\"item_list\":{\"items\":[{\"name\":\"Ground Coffee 40 oz\",\"price\":\"7.50\",\"currency\":\"USD\",\"quantity\":\"1\",\"description\":\"Ground Coffee 40 oz\",\"tax\":\"0.30\"},{\"name\":\"Granola bars\",\"price\":\"2.00\",\"currency\":\"USD\",\"quantity\":\"5\",\"description\":\"Granola Bars with Peanuts\",\"tax\":\"0.20\"}]},\"related_resources\":[{\"sale\":{\"id\":\"84X3439975017913M\",\"create_time\":\"2015-06-17T16:49:59Z\",\"update_time\":\"2015-06-17T16:50:01Z\",\"amount\":{\"total\":\"20.00\",\"currency\":\"USD\"},\"state\":\"completed\",\"parent_payment\":\"PAY-1L064882YM848125EKWA2KNY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/sale/84X3439975017913M/refund\",\"rel\":\"refund\",\"method\":\"POST\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}}]}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-1L064882YM848125EKWA2KNY\",\"rel\":\"self\",\"method\":\"GET\"}]}],\"count\":1,\"next_id\":\"PAY-5P879024BL580121AKWA2KLY\"}"
198
- read 1622 bytes
64
+ reading 1311 bytes...
65
+ -> "{\"webhooks\":[{\"id\":\"8VM94926UH399150D\",\"url\":\"https://requestb.in/10ujt3c1?uniqid=558f54001056e\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/8VM94926UH399150D\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/8VM94926UH399150D\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/8VM94926UH399150D\",\"rel\":\"delete\",\"method\":\"DELETE\"}]},{\"id\":\"50T98599JH617711K\",\"url\":\"https://www.yeowza.com/paypal_webhook_f8c3f96af18fb8b7\",\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}],\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"update\",\"method\":\"PATCH\"},{\"href\":\"https://api.sandbox.paypal.com/v1/notifications/webhooks/50T98599JH617711K\",\"rel\":\"delete\",\"method\":\"DELETE\"}]}]}"
66
+ read 1311 bytes
199
67
  Conn close
200
68
  opening connection to api.sandbox.paypal.com:443...
201
69
  opened
202
70
  starting SSL for api.sandbox.paypal.com:443...
203
71
  SSL established
204
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: f9b10630-a591-4144-b2d9-d02b2b4dd0f2\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: 473\r\n\r\n"
205
- <- "{\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
206
- -> "HTTP/1.1 503 Service Unavailable\r\n"
207
- -> "Date: Wed, 17 Jun 2015 20:11:35 GMT\r\n"
208
- -> "Server: Apache\r\n"
209
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=208333\r\n"
210
- -> "Paypal-Debug-Id: 15de632ed9e0c\r\n"
211
- -> "Connection: close\r\n"
212
- -> "Content-Length: 145\r\n"
213
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D2010415445; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
214
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
215
- -> "Vary: Authorization\r\n"
216
- -> "Content-Type: application/json\r\n"
217
- -> "\r\n"
218
- reading 145 bytes...
219
- -> "{\"name\":\"INTERNAL_SERVICE_ERROR\",\"information_link\":\"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR\",\"debug_id\":\"15de632ed9e0c\"}"
220
- read 145 bytes
221
- Conn close
222
- opening connection to api.sandbox.paypal.com:443...
223
- opened
224
- starting SSL for api.sandbox.paypal.com:443...
225
- SSL established
226
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: b403c5b5-0cb1-4249-8995-f293afcec1e7\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: 473\r\n\r\n"
227
- <- "{\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
228
- -> "HTTP/1.1 503 Service Unavailable\r\n"
229
- -> "Date: Wed, 17 Jun 2015 20:12:06 GMT\r\n"
230
- -> "Server: Apache\r\n"
231
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=207623\r\n"
232
- -> "Paypal-Debug-Id: 1e0f54f2e075b\r\n"
233
- -> "Connection: close\r\n"
234
- -> "Content-Length: 145\r\n"
235
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D2530509141; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
236
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
237
- -> "Vary: Authorization\r\n"
238
- -> "Content-Type: application/json\r\n"
239
- -> "\r\n"
240
- reading 145 bytes...
241
- -> "{\"name\":\"INTERNAL_SERVICE_ERROR\",\"information_link\":\"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR\",\"debug_id\":\"1e0f54f2e075b\"}"
242
- read 145 bytes
243
- Conn close
244
- opening connection to api.sandbox.paypal.com:443...
245
- opened
246
- starting SSL for api.sandbox.paypal.com:443...
247
- SSL established
248
- <- "GET /v1/payments/orders/O-2HT09787H36911800 HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
72
+ <- "GET /v1/notifications/webhooks/50T98599JH617711K/event-types HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
249
73
  -> "HTTP/1.1 200 OK\r\n"
250
- -> "Date: Wed, 17 Jun 2015 20:12:37 GMT\r\n"
74
+ -> "Date: Mon, 29 Jun 2015 00:16:49 GMT\r\n"
251
75
  -> "Server: Apache\r\n"
252
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=28130\r\n"
253
- -> "Paypal-Debug-Id: 9d321674e8e8b\r\n"
76
+ -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=526559\r\n"
77
+ -> "Paypal-Debug-Id: 748c1aeb8d5ba\r\n"
254
78
  -> "Content-Language: *\r\n"
255
- -> "Content-Length: 489\r\n"
256
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D3050602837; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
79
+ -> "Content-Length: 201\r\n"
80
+ -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1905168469; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
257
81
  -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
258
82
  -> "Vary: Authorization\r\n"
259
83
  -> "Connection: close\r\n"
260
84
  -> "Content-Type: application/json\r\n"
261
85
  -> "\r\n"
262
- reading 489 bytes...
263
- -> "{\"id\":\"O-2HT09787H36911800\",\"create_time\":\"2014-09-05T15:35:51Z\",\"update_time\":\"2014-09-05T15:36:47Z\",\"state\":\"expired\",\"amount\":{\"total\":\"1.00\",\"currency\":\"USD\",\"details\":{\"subtotal\":\"1.00\"}},\"parent_payment\":\"PAY-9KG19994R2259015YKQE5QVY\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/payments/orders/O-2HT09787H36911800\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/payments/payment/PAY-9KG19994R2259015YKQE5QVY\",\"rel\":\"parent_payment\",\"method\":\"GET\"}]}"
264
- read 489 bytes
86
+ reading 201 bytes...
87
+ -> "{\"event_types\":[{\"name\":\"PAYMENT.AUTHORIZATION.CREATED\",\"description\":\"A payment authorization was created\"},{\"name\":\"PAYMENT.AUTHORIZATION.VOIDED\",\"description\":\"A payment authorization was voided\"}]}"
88
+ read 201 bytes
265
89
  Conn close
266
90
  opening connection to api.sandbox.paypal.com:443...
267
91
  opened
268
92
  starting SSL for api.sandbox.paypal.com:443...
269
93
  SSL established
270
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 1b510dda-5e62-4b99-8042-f1ace7c5078f\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: 478\r\n\r\n"
271
- <- "{\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
272
- -> "HTTP/1.1 503 Service Unavailable\r\n"
273
- -> "Date: Wed, 17 Jun 2015 20:12:37 GMT\r\n"
274
- -> "Server: Apache\r\n"
275
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=29832\r\n"
276
- -> "Paypal-Debug-Id: 30559063e8e98\r\n"
277
- -> "Connection: close\r\n"
278
- -> "Content-Length: 145\r\n"
279
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D3050602837; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
280
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
281
- -> "Vary: Authorization\r\n"
282
- -> "Content-Type: application/json\r\n"
283
- -> "\r\n"
284
- reading 145 bytes...
285
- -> "{\"name\":\"INTERNAL_SERVICE_ERROR\",\"information_link\":\"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR\",\"debug_id\":\"30559063e8e98\"}"
286
- read 145 bytes
287
- Conn close
288
- opening connection to api.sandbox.paypal.com:443...
289
- opened
290
- starting SSL for api.sandbox.paypal.com:443...
291
- SSL established
292
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: fbb23612-c816-466e-b2c0-a4f5743c90a0\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: 478\r\n\r\n"
293
- <- "{\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
294
- -> "HTTP/1.1 503 Service Unavailable\r\n"
295
- -> "Date: Wed, 17 Jun 2015 20:13:08 GMT\r\n"
296
- -> "Server: Apache\r\n"
297
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=56508\r\n"
298
- -> "Paypal-Debug-Id: aaf9158af337f\r\n"
299
- -> "Connection: close\r\n"
300
- -> "Content-Length: 145\r\n"
301
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D3570696533; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
302
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
303
- -> "Vary: Authorization\r\n"
304
- -> "Content-Type: application/json\r\n"
305
- -> "\r\n"
306
- reading 145 bytes...
307
- -> "{\"name\":\"INTERNAL_SERVICE_ERROR\",\"information_link\":\"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR\",\"debug_id\":\"aaf9158af337f\"}"
308
- read 145 bytes
309
- Conn close
310
- opening connection to api.sandbox.paypal.com:443...
311
- opened
312
- starting SSL for api.sandbox.paypal.com:443...
313
- SSL established
314
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 18a4f81f-39ad-4134-88fa-a8b1f716b350\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: 478\r\n\r\n"
315
- <- "{\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
316
- -> "HTTP/1.1 503 Service Unavailable\r\n"
317
- -> "Date: Wed, 17 Jun 2015 20:13:39 GMT\r\n"
318
- -> "Server: Apache\r\n"
319
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=205628\r\n"
320
- -> "Paypal-Debug-Id: fde8c434fba7e\r\n"
321
- -> "Connection: close\r\n"
322
- -> "Content-Length: 145\r\n"
323
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D4090790229; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
324
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
325
- -> "Vary: Authorization\r\n"
326
- -> "Content-Type: application/json\r\n"
327
- -> "\r\n"
328
- reading 145 bytes...
329
- -> "{\"name\":\"INTERNAL_SERVICE_ERROR\",\"information_link\":\"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR\",\"debug_id\":\"fde8c434fba7e\"}"
330
- read 145 bytes
331
- Conn close
332
- opening connection to api.sandbox.paypal.com:443...
333
- opened
334
- starting SSL for api.sandbox.paypal.com:443...
335
- SSL established
336
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 6afb668d-2740-44a9-9f0d-bba5b9dc9311\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: 478\r\n\r\n"
337
- <- "{\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
338
- -> "HTTP/1.1 400 Bad Request\r\n"
339
- -> "Date: Wed, 17 Jun 2015 20:14:10 GMT\r\n"
340
- -> "Server: Apache\r\n"
341
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=27084\r\n"
342
- -> "Paypal-Debug-Id: 7de59c0202387\r\n"
343
- -> "Content-Language: *\r\n"
344
- -> "Connection: close\r\n"
345
- -> "Connection: close\r\n"
346
- -> "Content-Length: 185\r\n"
347
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D315982165; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
348
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
349
- -> "Vary: Authorization\r\n"
350
- -> "Content-Type: application/json\r\n"
351
- -> "\r\n"
352
- reading 185 bytes...
353
- -> "{\"name\":\"UNKNOWN_ERROR\",\"message\":\"An unknown error has occurred\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#UNKNOWN_ERROR\",\"debug_id\":\"7de59c0202387\"}"
354
- read 185 bytes
355
- Conn close
356
- opening connection to api.sandbox.paypal.com:443...
357
- opened
358
- starting SSL for api.sandbox.paypal.com:443...
359
- SSL established
360
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 5a2d0e01-cdf3-4265-826e-b4bb937b6c98\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: 478\r\n\r\n"
361
- <- "{\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
362
- -> "HTTP/1.1 400 Bad Request\r\n"
363
- -> "Date: Wed, 17 Jun 2015 20:14:22 GMT\r\n"
364
- -> "Server: Apache\r\n"
365
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=393\r\n"
366
- -> "Paypal-Debug-Id: 4763000c01268\r\n"
367
- -> "Content-Language: *\r\n"
368
- -> "Connection: close\r\n"
369
- -> "Connection: close\r\n"
370
- -> "Content-Length: 185\r\n"
371
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D517308757; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
372
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
373
- -> "Vary: Authorization\r\n"
374
- -> "Content-Type: application/json\r\n"
375
- -> "\r\n"
376
- reading 185 bytes...
377
- -> "{\"name\":\"UNKNOWN_ERROR\",\"message\":\"An unknown error has occurred\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#UNKNOWN_ERROR\",\"debug_id\":\"4763000c01268\"}"
378
- read 185 bytes
379
- Conn close
380
- opening connection to api.sandbox.paypal.com:443...
381
- opened
382
- starting SSL for api.sandbox.paypal.com:443...
383
- SSL established
384
- <- "POST /v1/payments/payment HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 01d61ec9-50a7-49ef-9bb3-bac4e8c24c4e\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: 478\r\n\r\n"
385
- <- "{\"intent\":\"authorize\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card\":{\"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\"}}}]},\"transactions\":[{\"amount\":{\"currency\":\"USD\",\"total\":\"1.00\"},\"description\":\"This is the payment transaction description.\"}]}"
386
- -> "HTTP/1.1 400 Bad Request\r\n"
387
- -> "Date: Wed, 17 Jun 2015 20:14:34 GMT\r\n"
388
- -> "Server: Apache\r\n"
389
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=205641\r\n"
390
- -> "Paypal-Debug-Id: dde28a5a0c370\r\n"
391
- -> "Content-Language: *\r\n"
392
- -> "Connection: close\r\n"
393
- -> "Connection: close\r\n"
394
- -> "Content-Length: 185\r\n"
395
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D718635349; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
396
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
397
- -> "Vary: Authorization\r\n"
398
- -> "Content-Type: application/json\r\n"
399
- -> "\r\n"
400
- reading 185 bytes...
401
- -> "{\"name\":\"UNKNOWN_ERROR\",\"message\":\"An unknown error has occurred\",\"information_link\":\"https://developer.paypal.com/webapps/developer/docs/api/#UNKNOWN_ERROR\",\"debug_id\":\"dde28a5a0c370\"}"
402
- read 185 bytes
403
- Conn close
404
- opening connection to api.sandbox.paypal.com:443...
405
- opened
406
- starting SSL for api.sandbox.paypal.com:443...
407
- SSL established
408
- <- "POST /v1/vault/credit-cards HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: cef03a78-5511-48cc-988f-14166c952be0\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"
409
- <- "{\"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\"}}"
410
- -> "HTTP/1.1 201 Created\r\n"
411
- -> "Date: Wed, 17 Jun 2015 20:14:47 GMT\r\n"
412
- -> "Server: Apache\r\n"
413
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=14776\r\n"
414
- -> "Paypal-Debug-Id: 17fb99800b284\r\n"
415
- -> "Content-Language: *\r\n"
416
- -> "Content-Length: 787\r\n"
417
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D936739157; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
418
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
419
- -> "Vary: Authorization\r\n"
420
- -> "Connection: close\r\n"
421
- -> "Content-Type: application/json\r\n"
422
- -> "\r\n"
423
- reading 787 bytes...
424
- -> "{\"id\":\"CARD-1CM385517H585641GKWA5KNY\",\"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-06-16T00:00:00Z\",\"create_time\":\"2015-06-17T20:14:47Z\",\"update_time\":\"2015-06-17T20:14:47Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-1CM385517H585641GKWA5KNY\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-1CM385517H585641GKWA5KNY\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-1CM385517H585641GKWA5KNY\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
425
- read 787 bytes
426
- Conn close
427
- opening connection to api.sandbox.paypal.com:443...
428
- opened
429
- starting SSL for api.sandbox.paypal.com:443...
430
- SSL established
431
- <- "GET /v1/vault/credit-cards/CARD-1CM385517H585641GKWA5KNY HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
432
- -> "HTTP/1.1 200 OK\r\n"
433
- -> "Date: Wed, 17 Jun 2015 20:14:47 GMT\r\n"
434
- -> "Server: Apache\r\n"
435
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=27095\r\n"
436
- -> "Paypal-Debug-Id: 235fdf1708f2e\r\n"
437
- -> "Content-Language: *\r\n"
438
- -> "Content-Length: 787\r\n"
439
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D936739157; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
440
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
441
- -> "Vary: Authorization\r\n"
442
- -> "Connection: close\r\n"
443
- -> "Content-Type: application/json\r\n"
444
- -> "\r\n"
445
- reading 787 bytes...
446
- -> "{\"id\":\"CARD-1CM385517H585641GKWA5KNY\",\"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-06-16T00:00:00Z\",\"create_time\":\"2015-06-17T20:14:47Z\",\"update_time\":\"2015-06-17T20:14:47Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-1CM385517H585641GKWA5KNY\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-1CM385517H585641GKWA5KNY\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-1CM385517H585641GKWA5KNY\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
447
- read 787 bytes
448
- Conn close
449
- opening connection to api.sandbox.paypal.com:443...
450
- opened
451
- starting SSL for api.sandbox.paypal.com:443...
452
- SSL established
453
- <- "POST /v1/vault/credit-cards HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 4efb1026-492e-4244-874a-0298f81c841f\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"
454
- <- "{\"number\":\"4417119669820331\",\"type\":\"visa\",\"expire_month\":11,\"expire_year\":2018}"
455
- -> "HTTP/1.1 201 Created\r\n"
456
- -> "Date: Wed, 17 Jun 2015 20:14:48 GMT\r\n"
457
- -> "Server: Apache\r\n"
458
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=29379\r\n"
459
- -> "Paypal-Debug-Id: d224a66908bb0\r\n"
460
- -> "Content-Language: *\r\n"
461
- -> "Content-Length: 629\r\n"
462
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D953516373; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
463
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
464
- -> "Vary: Authorization\r\n"
465
- -> "Connection: close\r\n"
466
- -> "Content-Type: application/json\r\n"
467
- -> "\r\n"
468
- reading 629 bytes...
469
- -> "{\"id\":\"CARD-6XM88206FX669024YKWA5KOA\",\"state\":\"ok\",\"type\":\"visa\",\"number\":\"xxxxxxxxxxxx0331\",\"expire_month\":\"11\",\"expire_year\":\"2018\",\"valid_until\":\"2018-06-16T00:00:00Z\",\"create_time\":\"2015-06-17T20:14:48Z\",\"update_time\":\"2015-06-17T20:14:48Z\",\"links\":[{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-6XM88206FX669024YKWA5KOA\",\"rel\":\"self\",\"method\":\"GET\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-6XM88206FX669024YKWA5KOA\",\"rel\":\"delete\",\"method\":\"DELETE\"},{\"href\":\"https://api.sandbox.paypal.com/v1/vault/credit-cards/CARD-6XM88206FX669024YKWA5KOA\",\"rel\":\"patch\",\"method\":\"PATCH\"}]}"
470
- read 629 bytes
471
- Conn close
472
- opening connection to api.sandbox.paypal.com:443...
473
- opened
474
- starting SSL for api.sandbox.paypal.com:443...
475
- SSL established
476
- <- "DELETE /v1/vault/credit-cards/CARD-6XM88206FX669024YKWA5KOA HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
94
+ <- "DELETE /v1/notifications/webhooks/50T98599JH617711K HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A015utd2WErH9umRC.Jj7PryFIBwmu-2qGw7Evx6gx6P8t0\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.3.0 (paypal-sdk-core 1.3.0; ruby 2.1.2p95-x86_64-darwin13.0)\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nHost: api.sandbox.paypal.com\r\n\r\n"
477
95
  -> "HTTP/1.1 204 No Content\r\n"
478
- -> "Date: Wed, 17 Jun 2015 20:14:49 GMT\r\n"
96
+ -> "Date: Mon, 29 Jun 2015 00:16:49 GMT\r\n"
479
97
  -> "Server: Apache\r\n"
480
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=146447\r\n"
481
- -> "Paypal-Debug-Id: cd52bb520882a\r\n"
98
+ -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3001.slc.paypal.com;threadId=624\r\n"
99
+ -> "Paypal-Debug-Id: 594920158d7fe\r\n"
482
100
  -> "Content-Language: *\r\n"
483
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D970293589; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
101
+ -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D1905168469; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
484
102
  -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
485
103
  -> "Vary: Authorization\r\n"
486
104
  -> "Connection: close\r\n"
487
105
  -> "Content-Type: text/plain; charset=ISO-8859-1\r\n"
488
106
  -> "\r\n"
489
107
  Conn close
490
- opening connection to api.sandbox.paypal.com:443...
491
- opened
492
- starting SSL for api.sandbox.paypal.com:443...
493
- SSL established
494
- <- "POST /v1/vault/credit-cards HTTP/1.1\r\nX-Paypal-Sandbox-Email-Address: Platform.sdk.seller@gmail.com\r\nAuthorization: Bearer A0152gtigi4qv0lFob0S8hbXow3DGalNrlwWUZm4eK5TZuY\r\nContent-Type: application/json\r\nUser-Agent: PayPalSDK/PayPal-Ruby-SDK 1.2.2 (paypal-sdk-core 1.2.2; ruby 2.1.2p95-x86_64-darwin13.0)\r\nPaypal-Request-Id: 2c6472a5-714e-4eb4-984f-d666404c313d\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"
495
- <- "{\"number\":\"4111111111111111\",\"type\":\"visa\"}"
496
- -> "HTTP/1.1 400 Bad Request\r\n"
497
- -> "Date: Wed, 17 Jun 2015 20:14:49 GMT\r\n"
498
- -> "Server: Apache\r\n"
499
- -> "PROXY_SERVER_INFO: host=slcsbplatformapiserv3002.slc.paypal.com;threadId=143967\r\n"
500
- -> "Paypal-Debug-Id: bab11b63084c7\r\n"
501
- -> "Content-Language: *\r\n"
502
- -> "Connection: close\r\n"
503
- -> "Connection: close\r\n"
504
- -> "Content-Length: 300\r\n"
505
- -> "Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.API.1%26silo_version%3D880%26app%3Dplatformapiserv%26TIME%3D970293589; domain=.paypal.com; path=/; Secure; HttpOnly\r\n"
506
- -> "Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT\r\n"
507
- -> "Vary: Authorization\r\n"
508
- -> "Content-Type: application/json\r\n"
509
- -> "\r\n"
510
- reading 300 bytes...
511
- -> "{\"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\":\"bab11b63084c7\"}"
512
- read 300 bytes
513
- Conn close
@@ -15,28 +15,70 @@ describe "Webhooks", :integration => true do
15
15
  ]
16
16
  }
17
17
 
18
- it "create webhook" do
19
- $webhook = PayPal::SDK::REST::Webhook.new(webhookAttributes)
20
- expect($webhook.create).to be_truthy
21
- end
18
+ describe "Notifications" do
19
+ it "create webhook" do
20
+ $webhook = PayPal::SDK::REST::Webhook.new(webhookAttributes)
21
+ expect($webhook.create).to be_truthy
22
+ end
22
23
 
23
- it "get webhook" do
24
- $result = PayPal::SDK::REST::Webhook.get($webhook.id)
25
- expect($result).to be_a PayPal::SDK::REST::Webhook
26
- expect($result.id).to eql $webhook.id
27
- end
24
+ it "get webhook" do
25
+ $result = PayPal::SDK::REST::Webhook.get($webhook.id)
26
+ expect($result).to be_a PayPal::SDK::REST::Webhook
27
+ expect($result.id).to eql $webhook.id
28
+ end
28
29
 
29
- it "get all webhooks" do
30
- $webhooks_list = PayPal::SDK::REST::Webhook.all()
31
- expect($webhooks_list.webhooks.length).not_to be_nil
32
- end
30
+ it "get all webhooks" do
31
+ $webhooks_list = PayPal::SDK::REST::Webhook.all()
32
+ expect($webhooks_list.webhooks.length).not_to be_nil
33
+ end
33
34
 
34
- it "get subscribed webhook event types" do
35
- $webhook_event_types = PayPal::SDK::REST::Webhook.get_event_types($webhook.id)
36
- expect($webhook_event_types.event_types.length).to eql $webhook.event_types.length
35
+ it "get subscribed webhook event types" do
36
+ $webhook_event_types = PayPal::SDK::REST::Webhook.get_event_types($webhook.id)
37
+ expect($webhook_event_types.event_types.length).to eql $webhook.event_types.length
38
+ end
39
+
40
+ it "delete webhook" do
41
+ expect($webhook.delete).to be_truthy
42
+ end
37
43
  end
38
44
 
39
- it "delete webhook" do
40
- expect($webhook.delete).to be_truthy
45
+ describe "Validation" do
46
+
47
+ transmission_id = "dfb3be50-fd74-11e4-8bf3-77339302725b"
48
+ timestamp = "2015-05-18T15:45:13Z"
49
+ webhook_id = "4JH86294D6297924G"
50
+ actual_signature = "thy4/U002quzxFavHPwbfJGcc46E8rc5jzgyeafWm5mICTBdY/8rl7WJpn8JA0GKA+oDTPsSruqusw+XXg5RLAP7ip53Euh9Xu3UbUhQFX7UgwzE2FeYoY6lyRMiiiQLzy9BvHfIzNIVhPad4KnC339dr6y2l+mN8ALgI4GCdIh3/SoJO5wE64Bh/ueWtt8EVuvsvXfda2Le5a2TrOI9vLEzsm9GS79hAR/5oLexNz8UiZr045Mr5ObroH4w4oNfmkTaDk9Rj0G19uvISs5QzgmBpauKr7Nw++JI0pr/v5mFctQkoWJSGfBGzPRXawrvIIVHQ9Wer48GR2g9ZiApWg=="
51
+ event_body = '{"id":"WH-0G2756385H040842W-5Y612302CV158622M","create_time":"2015-05-18T15:45:13Z","resource_type":"sale","event_type":"PAYMENT.SALE.COMPLETED","summary":"Payment completed for $ 20.0 USD","resource":{"id":"4EU7004268015634R","create_time":"2015-05-18T15:44:02Z","update_time":"2015-05-18T15:44:21Z","amount":{"total":"20.00","currency":"USD"},"payment_mode":"INSTANT_TRANSFER","state":"completed","protection_eligibility":"ELIGIBLE","protection_eligibility_type":"ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE","parent_payment":"PAY-86C81811X5228590KKVNARQQ","transaction_fee":{"value":"0.88","currency":"USD"},"links":[{"href":"https://api.sandbox.paypal.com/v1/payments/sale/4EU7004268015634R","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/payments/sale/4EU7004268015634R/refund","rel":"refund","method":"POST"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-86C81811X5228590KKVNARQQ","rel":"parent_payment","method":"GET"}]},"links":[{"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-0G2756385H040842W-5Y612302CV158622M","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-0G2756385H040842W-5Y612302CV158622M/resend","rel":"resend","method":"POST"}]}'
52
+ cert_url = "https://api.sandbox.paypal.com/v1/notifications/certs/CERT-360caa42-fca2a594-a5cafa77"
53
+ cert = PayPal::SDK::REST::WebhookEvent.get_cert(cert_url)
54
+
55
+ it "verify common name" do
56
+ cert = PayPal::SDK::REST::WebhookEvent.get_cert(cert_url)
57
+ valid = PayPal::SDK::REST::WebhookEvent.verify_common_name(cert)
58
+ expect(valid).to be_truthy
59
+ end
60
+
61
+ it "verify get expected signature" do
62
+ expected_sig = PayPal::SDK::REST::WebhookEvent.get_expected_sig(transmission_id, timestamp, webhook_id, event_body)
63
+ expect(expected_sig).eql?("dfb3be50-fd74-11e4-8bf3-77339302725b|2015-05-18T15:45:13Z|4JH86294D6297924G|2771810304")
64
+ end
65
+
66
+ it "verify expiry" do
67
+ valid = PayPal::SDK::REST::WebhookEvent.verify_expiration(cert)
68
+ expect(valid).to be_truthy
69
+ end
70
+
71
+ it "verify cert chain" do
72
+ cert_store = PayPal::SDK::REST::WebhookEvent.get_cert_chain
73
+ valid = PayPal::SDK::REST::WebhookEvent.verify_cert_chain(cert_store, cert)
74
+ expect(valid).to be_truthy
75
+ end
76
+
77
+ it "verify" do
78
+ valid = PayPal::SDK::REST::WebhookEvent.verify(transmission_id, timestamp, webhook_id, event_body, cert_url, actual_signature)
79
+ expect(valid).to be_truthy
80
+ end
41
81
  end
82
+
83
+
42
84
  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.2.2
4
+ version: 1.3.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-06-17 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coveralls
@@ -77,6 +77,8 @@ files:
77
77
  - Gemfile
78
78
  - README.md
79
79
  - Rakefile
80
+ - data/DigiCertHighAssuranceEVRootCA.pem
81
+ - data/DigiCertSHA2ExtendedValidationServerCA.pem
80
82
  - data/paypal.crt
81
83
  - lib/generators/paypal/sdk/USAGE
82
84
  - lib/generators/paypal/sdk/install_generator.rb