More Webhook API Changes

- Updated API Models with Fixes
- Updated Samples
- Additional Functional Tests
This commit is contained in:
japatel
2014-12-12 17:00:33 -06:00
parent d6575b49ae
commit fb9584ba66
30 changed files with 1454 additions and 73 deletions

View File

@@ -0,0 +1,75 @@
{
"description":"Create a webhook",
"title":"Create a webhook",
"runnable":true,
"operationId":"webhooks.create",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks",
"method":"POST",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
},
"body":{
"url":"https://requestb.in/10ujt3c1",
"event_types":[
{
"name":"PAYMENT.AUTHORIZATION.CREATED"
},
{
"name":"PAYMENT.AUTHORIZATION.VOIDED"
}
]
}
},
"response":{
"status":"201",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"id":"0EH40505U7160970P",
"url":"https://requestb.in/10ujt3c1",
"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.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"update",
"method":"PATCH"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"delete",
"method":"DELETE"
}
]
}
}
}

View File

@@ -0,0 +1,33 @@
{
"description":"Delete a webhook",
"title":"Delete a webhook",
"runnable":true,
"operationId":"webhooks.delete",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks/5GP028458E2496506",
"method":"DELETE",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"204",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
}
}
}

View File

@@ -0,0 +1,89 @@
{
"description":"Resend a webhook event",
"title":"Resend a webhook event",
"runnable":true,
"operationId":"event.resend",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks-events/8PT597110X687430LKGECATA/resend",
"method":"GET",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"202",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"id":"8PT597110X687430LKGECATA",
"create_time":"2013-06-25T21:41:28Z",
"resource_type":"authorization",
"trigger_event":"PAYMENT.AUTHORIZATION.CREATED",
"summary":"A payment authorization was created",
"resource":{
"id":"2DC87612EK520411B",
"create_time":"2013-06-25T21:39:15Z",
"update_time":"2013-06-25T21:39:17Z",
"state":"authorized",
"amount":{
"total":"7.47",
"currency":"USD",
"details":{
"subtotal":"7.47"
}
},
"parent_payment":"PAY-36246664YD343335CKHFA4AY",
"valid_until":"2013-07-24T21:39:15Z",
"links":[
{
"href":"https://api.paypal.com/v1/payments/authorization/2DC87612EK520411B",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/payments/authorization/2DC87612EK520411B/capture",
"rel":"capture",
"method":"POST"
},
{
"href":"https://api.paypal.com/v1/payments/authorization/2DC87612EK520411B/void",
"rel":"void",
"method":"POST"
},
{
"href":"https://api.paypal.com/v1/payments/payment/PAY-36246664YD343335CKHFA4AY",
"rel":"parent_payment",
"method":"GET"
}
]
},
"links":[
{
"href":"https://api.paypal.com/v1/notfications/webhooks-events/8PT597110X687430LKGECATA",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/notfications/webhooks-events/8PT597110X687430LKGECATA/resend",
"rel":"resend",
"method":"POST"
}
]
}
}
}

View File

@@ -0,0 +1,162 @@
{
"description":"Get list of webhook events",
"title":"Get list of webhook events",
"runnable":true,
"operationId":"event.list",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks-events",
"method":"GET",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"200",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"events": [
{
"id": "8PT597110X687430LKGECATA",
"create_time": "2013-06-25T21:41:28Z",
"resource_type": "authorization",
"event_type": "PAYMENT.AUTHORIZATION.CREATED",
"summary": "A payment authorization was created",
"resource": {
"id": "2DC87612EK520411B",
"create_time": "2013-06-25T21:39:15Z",
"update_time": "2013-06-25T21:39:17Z",
"state": "authorized",
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"subtotal": "7.47"
}
},
"parent_payment": "PAY-36246664YD343335CKHFA4AY",
"valid_until": "2013-07-24T21:39:15Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B/capture",
"rel": "capture",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/authorization/2DC87612EK520411B/void",
"rel": "void",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-36246664YD343335CKHFA4AY",
"rel": "parent_payment",
"method": "GET"
}
]
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/notfications/webhooks-events/8PT597110X687430LKGECATA",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/notfications/webhooks-events/8PT597110X687430LKGECATA/resend",
"rel": "resend",
"method": "POST"
}
]
},
{
"id": "HTSPGS710X687430LKGECATA",
"create_time": "2013-06-25T21:41:28Z",
"resource_type": "authorization",
"event_type": "PAYMENT.AUTHORIZATION.CREATED",
"summary": "A payment authorization was created",
"resource": {
"id": "HATH7S72EK520411B",
"create_time": "2013-06-25T21:39:15Z",
"update_time": "2013-06-25T21:39:17Z",
"state": "authorized",
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"subtotal": "7.47"
}
},
"parent_payment": "PAY-ALDSFJ64YD343335CKHFA4AY",
"valid_until": "2013-07-24T21:39:15Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/authorization/HATH7S72EK520411B",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/authorization/HATH7S72EK520411B/capture",
"rel": "capture",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/authorization/HATH7S72EK520411B/void",
"rel": "void",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-HATH7S72EK520411B",
"rel": "parent_payment",
"method": "GET"
}
]
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/notfications/webhooks-events/HTSPGS710X687430LKGECATA",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/notfications/webhooks-events/HTSPGS710X687430LKGECATA/resend",
"rel": "resend",
"method": "POST"
}
]
}
],
"count": 2,
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/?start_time=2014-08-04T12:46:47-07:00&end_time=2014-09-18T12:46:47-07:00&page_size=2&move_to=next&index_time=2014-09-17T23:07:35Z&index_id=3",
"rel": "next",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/?start_time=2014-08-04T12:46:47-07:00&end_time=2014-09-18T12:46:47-07:00&page_size=2&move_to=previous&index_time=2014-09-17T23:07:35Z&index_id=0",
"rel": "previous",
"method": "GET"
}
]
}
}
}

View File

@@ -0,0 +1,64 @@
{
"description":"Get a webhook",
"title":"Get a webhook",
"runnable":true,
"operationId":"webhooks.get",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks/0EH40505U7160970P",
"method":"GET",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"200",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"id":"0EH40505U7160970P",
"url":"https://requestb.in/10ujt3c1",
"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.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"update",
"method":"PATCH"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"delete",
"method":"DELETE"
}
]
}
}
}

View File

@@ -0,0 +1,99 @@
{
"description":"Get all webhooks",
"title":"Get all webhook",
"runnable":true,
"operationId":"webhooks.get-all",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks",
"method":"GET",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"200",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"webhooks":[
{
"id":"40Y916089Y8324740",
"url":"http://www.ebay.com/paypal_webhook",
"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.paypal.com/v1/notifications/webhooks/40Y916089Y8324740",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/40Y916089Y8324740",
"rel":"update",
"method":"PATCH"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/40Y916089Y8324740",
"rel":"delete",
"method":"DELETE"
}
]
},
{
"id":"0EH40505U7160970P",
"url":"http://www.ebay.com/another_paypal_webhook",
"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.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"update",
"method":"PATCH"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"delete",
"method":"DELETE"
}
]
}
]
}
}
}

View File

@@ -0,0 +1,89 @@
{
"description":"Get a webhook event",
"title":"Get a webhook event",
"runnable":true,
"operationId":"event.get",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks-events/8PT597110X687430LKGECATA",
"method":"GET",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"200",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"id":"8PT597110X687430LKGECATA",
"create_time":"2013-06-25T21:41:28Z",
"resource_type":"authorization",
"trigger_event":"PAYMENT.AUTHORIZATION.CREATED",
"summary":"A payment authorization was created",
"resource":{
"id":"2DC87612EK520411B",
"create_time":"2013-06-25T21:39:15Z",
"update_time":"2013-06-25T21:39:17Z",
"state":"authorized",
"amount":{
"total":"7.47",
"currency":"USD",
"details":{
"subtotal":"7.47"
}
},
"parent_payment":"PAY-36246664YD343335CKHFA4AY",
"valid_until":"2013-07-24T21:39:15Z",
"links":[
{
"href":"https://api.paypal.com/v1/payments/authorization/2DC87612EK520411B",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/payments/authorization/2DC87612EK520411B/capture",
"rel":"capture",
"method":"POST"
},
{
"href":"https://api.paypal.com/v1/payments/authorization/2DC87612EK520411B/void",
"rel":"void",
"method":"POST"
},
{
"href":"https://api.paypal.com/v1/payments/payment/PAY-36246664YD343335CKHFA4AY",
"rel":"parent_payment",
"method":"GET"
}
]
},
"links":[
{
"href":"https://api.paypal.com/v1/notfications/webhooks-events/8PT597110X687430LKGECATA",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/notfications/webhooks-events/8PT597110X687430LKGECATA/resend",
"rel":"resend",
"method":"POST"
}
]
}
}
}

View File

@@ -0,0 +1,76 @@
{
"description":"Update a webhook",
"title":"Updated a webhook",
"runnable":true,
"operationId":"webhooks.update",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks/0EH40505U7160970P",
"method":"PATCH",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
},
"body":[
{
"op":"replace",
"path":"/url",
"value":"https://requestb.in/10ujt3c1"
},
{
"op":"replace",
"path":"/event_types",
"value":[
{
"name":"PAYMENT.SALE.REFUNDED"
}
]
}
]
},
"response":{
"status":"200",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"id":"0EH40505U7160970P",
"url":"https://requestb.in/10ujt3c1",
"event_types":[
{
"name":"PAYMENT.SALE.REFUNDED",
"description":"A sale payment was refunded"
}
],
"links":[
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"self",
"method":"GET"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"update",
"method":"PATCH"
},
{
"href":"https://api.paypal.com/v1/notifications/webhooks/0EH40505U7160970P",
"rel":"delete",
"method":"DELETE"
}
]
}
}
}

View File

@@ -0,0 +1,56 @@
{
"description":"List of supported webhook events",
"title":"List of supported webhook events",
"runnable":true,
"operationId":"available-event-type.list",
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks-event-types",
"method":"GET",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"200",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"event_types":[
{
"name":"PAYMENT.AUTHORIZATION.CREATED",
"description":"A payment authorization was created"
},
{
"name":"PAYMENT.AUTHORIZATION.VOIDED",
"description":"A payment authorization was voided"
},
{
"name":"PAYMENT.CAPTURE.COMPLETED",
"description":"A capture payment was completed"
},
{
"name":"PAYMENT.CAPTURE.REFUNDED",
"description":"A capture payment was refunded"
},
{
"name":"PAYMENT.SALE.COMPLETED",
"description":"A sale payment was completed"
},
{
"name":"PAYMENT.SALE.REFUNDED",
"description":"A sale payment was refunded"
}
]
}
}
}

View File

@@ -0,0 +1,45 @@
{
"description":"Events subscribed for a webhook",
"title":"Events subscribed for a webhook",
"runnable":true,
"operationId":"webhook.subscribed-event-types.list",
"user":{
"scopes":[
"https://uri.paypal.com/services/applications/webhooks"
]
},
"credentials":{
"oauth":{
"path":"/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request":{
"path":"v1/notifications/webhooks/0EH40505U7160970P/event-types",
"method":"GET",
"headers":{
"Content-Type":"application/json",
"Authorization":"Bearer ECvJ_yBNz_UfMmCvWEbT_2ZWXdzbFFQZ-1Y5K2NGgeHn"
}
},
"response":{
"status":"200",
"headers":{
"Content-Type":"application/json",
"Paypal-Debug-id":"0c444abc1d12d"
},
"body":{
"event_types":[
{
"name":"PAYMENT.AUTHORIZATION.CREATED",
"description":"A payment authorization was created"
},
{
"name":"PAYMENT.AUTHORIZATION.VOIDED",
"description":"A payment authorization was voided"
}
]
}
}
}