diff --git a/lib/PayPal/Api/VerifyWebhookSignature.php b/lib/PayPal/Api/VerifyWebhookSignature.php new file mode 100644 index 0000000..fe2f753 --- /dev/null +++ b/lib/PayPal/Api/VerifyWebhookSignature.php @@ -0,0 +1,213 @@ +auth_algo = $auth_algo; + return $this; + } + + /** + * The algorithm that PayPal uses to generate the signature and that you can use to verify the signature. Extract this value from the `PAYPAL-AUTH-ALGO` response header, which is received with the webhook notification. + * + * @return string + */ + public function getAuthAlgo() + { + return $this->auth_algo; + } + + /** + * The X.509 public key certificate. Download the certificate from this URL and use it to verify the signature. Extract this value from the `PAYPAL-CERT-URL` response header, which is received with the webhook notification. + * + * @param string $cert_url + * @throws \InvalidArgumentException + * @return $this + */ + public function setCertUrl($cert_url) + { + UrlValidator::validate($cert_url, "CertUrl"); + $this->cert_url = $cert_url; + return $this; + } + + /** + * The X.509 public key certificate. Download the certificate from this URL and use it to verify the signature. Extract this value from the `PAYPAL-CERT-URL` response header, which is received with the webhook notification. + * + * @return string + */ + public function getCertUrl() + { + return $this->cert_url; + } + + /** + * The ID of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-ID` header of the notification message. + * + * @param string $transmission_id + * + * @return $this + */ + public function setTransmissionId($transmission_id) + { + $this->transmission_id = $transmission_id; + return $this; + } + + /** + * The ID of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-ID` header of the notification message. + * + * @return string + */ + public function getTransmissionId() + { + return $this->transmission_id; + } + + /** + * The PayPal-generated asymmetric signature. Extract this value from the `PAYPAL-TRANSMISSION-SIG` response header, which is received with the webhook notification. + * + * @param string $transmission_sig + * + * @return $this + */ + public function setTransmissionSig($transmission_sig) + { + $this->transmission_sig = $transmission_sig; + return $this; + } + + /** + * The PayPal-generated asymmetric signature. Extract this value from the `PAYPAL-TRANSMISSION-SIG` response header, which is received with the webhook notification. + * + * @return string + */ + public function getTransmissionSig() + { + return $this->transmission_sig; + } + + /** + * The date and time of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-TIME` header of the notification message. + * + * @param string $transmission_time + * + * @return $this + */ + public function setTransmissionTime($transmission_time) + { + $this->transmission_time = $transmission_time; + return $this; + } + + /** + * The date and time of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-TIME` header of the notification message. + * + * @return string + */ + public function getTransmissionTime() + { + return $this->transmission_time; + } + + /** + * The ID of the webhook as configured in your Developer Portal account. + * + * @param string $webhook_id + * + * @return $this + */ + public function setWebhookId($webhook_id) + { + $this->webhook_id = $webhook_id; + return $this; + } + + /** + * The ID of the webhook as configured in your Developer Portal account. + * + * @return string + */ + public function getWebhookId() + { + return $this->webhook_id; + } + + /** + * The webhook notification, which is the content of the HTTP `POST` request body. + * + * @param \PayPal\Api\WebhookEvent $webhook_event + * + * @return $this + */ + public function setWebhookEvent($webhook_event) + { + $this->webhook_event = $webhook_event; + return $this; + } + + /** + * The webhook notification, which is the content of the HTTP `POST` request body. + * + * @return \PayPal\Api\WebhookEvent + */ + public function getWebhookEvent() + { + return $this->webhook_event; + } + + /** + * Verifies a webhook signature. + * + * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls + * @return VerifyWebhookSignatureResponse + */ + public function post($apiContext = null, $restCall = null) + { + $payLoad = $this->toJSON(); + $json = self::executeCall( + "/v1/notifications/verify-webhook-signature", + "POST", + $payLoad, + null, + $apiContext, + $restCall + ); + $ret = new VerifyWebhookSignatureResponse(); + $ret->fromJson($json); + return $ret; + } + +} diff --git a/lib/PayPal/Api/VerifyWebhookSignatureResponse.php b/lib/PayPal/Api/VerifyWebhookSignatureResponse.php new file mode 100644 index 0000000..75b0845 --- /dev/null +++ b/lib/PayPal/Api/VerifyWebhookSignatureResponse.php @@ -0,0 +1,42 @@ +verification_status = $verification_status; + return $this; + } + + /** + * The status of the signature verification. Value is `SUCCESS` or `FAILURE`. + * + * @return string + */ + public function getVerificationStatus() + { + return $this->verification_status; + } + +} diff --git a/lib/PayPal/Api/Webhook.php b/lib/PayPal/Api/Webhook.php index de02b77..549b588 100644 --- a/lib/PayPal/Api/Webhook.php +++ b/lib/PayPal/Api/Webhook.php @@ -3,15 +3,15 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; +use PayPal\Api\WebhookList; +use PayPal\Rest\ApiContext; use PayPal\Validation\UrlValidator; /** * Class Webhook * - * Represents Webhook resource. + * One or more webhook objects. * * @package PayPal\Api * @@ -22,7 +22,7 @@ use PayPal\Validation\UrlValidator; class Webhook extends PayPalResourceModel { /** - * Identifier of the webhook resource. + * The ID of the webhook. * * @param string $id * @@ -35,7 +35,7 @@ class Webhook extends PayPalResourceModel } /** - * Identifier of the webhook resource. + * The ID of the webhook. * * @return string */ @@ -45,7 +45,7 @@ class Webhook extends PayPalResourceModel } /** - * Webhook notification endpoint url. + * The URL that is configured to listen on `localhost` for incoming `POST` notification messages that contain event information. * * @param string $url * @throws \InvalidArgumentException @@ -59,7 +59,7 @@ class Webhook extends PayPalResourceModel } /** - * Webhook notification endpoint url. + * The URL that is configured to listen on `localhost` for incoming `POST` notification messages that contain event information. * * @return string */ @@ -69,7 +69,7 @@ class Webhook extends PayPalResourceModel } /** - * List of Webhooks event-types. + * A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (`*`) wildcard. To replace the `event_types` array, specify the `*` wildcard. To see all supported events, [list available events](#available-event-type.list). * * @param \PayPal\Api\WebhookEventType[] $event_types * @@ -82,7 +82,7 @@ class Webhook extends PayPalResourceModel } /** - * List of Webhooks event-types. + * A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (`*`) wildcard. To replace the `event_types` array, specify the `*` wildcard. To see all supported events, [list available events](#available-event-type.list). * * @return \PayPal\Api\WebhookEventType[] */ @@ -122,7 +122,7 @@ class Webhook extends PayPalResourceModel } /** - * Creates the Webhook for the application associated with the access token. + * Subscribes your webhook listener to events. A successful call returns a [`webhook`](/docs/api/webhooks/#definition-webhook) object, which includes the webhook ID for later use. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls @@ -144,7 +144,7 @@ class Webhook extends PayPalResourceModel } /** - * Retrieves the Webhook identified by webhook_id for the application associated with access token. + * Shows details for a webhook, by ID. * * @param string $webhookId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -171,15 +171,34 @@ class Webhook extends PayPalResourceModel /** * Retrieves all Webhooks for the application associated with access token. * + * @deprecated Please use Webhook#getAllWithParams instead. + * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return WebhookList */ public static function getAll($apiContext = null, $restCall = null) { + return self::getAllWithParams(array(), $apiContext, $restCall); + } + + /** + * Lists all webhooks for an app. + * + * @param array $params + * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls + * @return WebhookList + */ + public static function getAllWithParams($params = array(), $apiContext = null, $restCall = null) + { + ArgumentValidator::validate($params, 'params'); $payLoad = ""; + $allowedParams = array( + 'anchor_type' => 1, + ); $json = self::executeCall( - "/v1/notifications/webhooks", + "/v1/notifications/webhooks?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, @@ -192,7 +211,7 @@ class Webhook extends PayPalResourceModel } /** - * Updates the Webhook identified by webhook_id for the application associated with access token. + * Replaces webhook fields with new values. Pass a `json_patch` object with `replace` operation and `path`, which is `/url` for a URL or `/event_types` for events. The `value` is either the URL or a list of events. * * @param PatchRequest $patchRequest * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -217,7 +236,7 @@ class Webhook extends PayPalResourceModel } /** - * Deletes the Webhook identified by webhook_id for the application associated with access token. + * Deletes a webhook, by ID. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls diff --git a/lib/PayPal/Api/WebhookEvent.php b/lib/PayPal/Api/WebhookEvent.php index bc9426f..a3ecfb0 100644 --- a/lib/PayPal/Api/WebhookEvent.php +++ b/lib/PayPal/Api/WebhookEvent.php @@ -3,30 +3,31 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Exception\PayPalConnectionException; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; -use PayPal\Validation\JsonValidator; +use PayPal\Api\WebhookEventList; +use PayPal\Rest\ApiContext; /** * Class WebhookEvent * - * Represents a Webhooks event + * A webhook event notification. * * @package PayPal\Api * * @property string id * @property string create_time * @property string resource_type + * @property string event_version * @property string event_type * @property string summary - * @property mixed resource + * @property \PayPal\Common\PayPalModel resource + * @property string status + * @property mixed[] transmissions */ class WebhookEvent extends PayPalResourceModel { /** - * Identifier of the Webhooks event resource. + * The ID of the webhook event notification. * * @param string $id * @@ -39,7 +40,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Identifier of the Webhooks event resource. + * The ID of the webhook event notification. * * @return string */ @@ -49,7 +50,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Time the resource was created. + * The date and time when the webhook event notification was created. * * @param string $create_time * @@ -62,7 +63,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Time the resource was created. + * The date and time when the webhook event notification was created. * * @return string */ @@ -72,7 +73,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Name of the resource contained in resource element. + * The name of the resource related to the webhook notification event. * * @param string $resource_type * @@ -85,7 +86,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Name of the resource contained in resource element. + * The name of the resource related to the webhook notification event. * * @return string */ @@ -95,7 +96,30 @@ class WebhookEvent extends PayPalResourceModel } /** - * Name of the event type that occurred on resource, identified by data_resource element, to trigger the Webhooks event. + * The version of the event. + * + * @param string $event_version + * + * @return $this + */ + public function setEventVersion($event_version) + { + $this->event_version = $event_version; + return $this; + } + + /** + * The version of the event. + * + * @return string + */ + public function getEventVersion() + { + return $this->event_version; + } + + /** + * The event that triggered the webhook event notification. * * @param string $event_type * @@ -108,7 +132,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Name of the event type that occurred on resource, identified by data_resource element, to trigger the Webhooks event. + * The event that triggered the webhook event notification. * * @return string */ @@ -118,7 +142,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * A summary description of the event. E.g. A successful payment authorization was created for $$ + * A summary description for the event notification. For example, `A payment authorization was created.` * * @param string $summary * @@ -131,7 +155,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * A summary description of the event. E.g. A successful payment authorization was created for $$ + * A summary description for the event notification. For example, `A payment authorization was created.` * * @return string */ @@ -141,7 +165,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * This contains the resource that is identified by resource_type element. + * The resource that triggered the webhook event notification. * * @param \PayPal\Common\PayPalModel $resource * @@ -154,7 +178,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * This contains the resource that is identified by resource_type element. + * The resource that triggered the webhook event notification. * * @return \PayPal\Common\PayPalModel */ @@ -171,6 +195,8 @@ class WebhookEvent extends PayPalResourceModel * * NOTE: PLEASE DO NOT USE THE DATA PROVIDED IN WEBHOOK DIRECTLY, AS HACKER COULD PASS IN FAKE DATA. IT IS VERY IMPORTANT THAT YOU RETRIEVE THE ID AND MAKE A SEPARATE CALL TO PAYPAL API. * + * @deprecated todo: add refrence to correct method + * * @param string $body * @param ApiContext $apiContext * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls @@ -227,7 +253,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Resends the Webhooks event resource identified by event_id. + * Resends a webhook event notification, by ID. Any pending notifications are not resent. * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls @@ -250,7 +276,7 @@ class WebhookEvent extends PayPalResourceModel } /** - * Retrieves the list of Webhooks events resources for the application associated with token. The developers can use it to see list of past webhooks events. + * Lists webhook event notifications. Use query parameters to filter the response. * * @param array $params * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -265,6 +291,8 @@ class WebhookEvent extends PayPalResourceModel 'page_size' => 1, 'start_time' => 1, 'end_time' => 1, + 'transaction_id' => 1, + 'event_type' => 1, ); $json = self::executeCall( "/v1/notifications/webhooks-events" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), diff --git a/lib/PayPal/Api/WebhookEventList.php b/lib/PayPal/Api/WebhookEventList.php index 3ad2d8a..8c8c7ed 100644 --- a/lib/PayPal/Api/WebhookEventList.php +++ b/lib/PayPal/Api/WebhookEventList.php @@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel; /** * Class WebhookEventList * - * List of Webhooks event resources + * List of webhooks events. * * @package PayPal\Api * @@ -18,7 +18,7 @@ use PayPal\Common\PayPalModel; class WebhookEventList extends PayPalModel { /** - * A list of Webhooks event resources + * A list of webhooks events. * * @param \PayPal\Api\WebhookEvent[] $events * @@ -31,7 +31,7 @@ class WebhookEventList extends PayPalModel } /** - * A list of Webhooks event resources + * A list of webhooks events. * * @return \PayPal\Api\WebhookEvent[] */ @@ -71,7 +71,7 @@ class WebhookEventList extends PayPalModel } /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. + * The number of items in each range of results. Note that the response might have fewer items than the requested `page_size` value. * * @param int $count * @@ -84,7 +84,7 @@ class WebhookEventList extends PayPalModel } /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. + * The number of items in each range of results. Note that the response might have fewer items than the requested `page_size` value. * * @return int */ diff --git a/lib/PayPal/Api/WebhookEventType.php b/lib/PayPal/Api/WebhookEventType.php index ad3d579..2aedc60 100644 --- a/lib/PayPal/Api/WebhookEventType.php +++ b/lib/PayPal/Api/WebhookEventType.php @@ -3,24 +3,25 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; +use PayPal\Api\WebhookEventTypeList; +use PayPal\Rest\ApiContext; /** * Class WebhookEventType * - * Contains the information for a Webhooks event-type + * A list of events. * * @package PayPal\Api * * @property string name * @property string description + * @property string status */ class WebhookEventType extends PayPalResourceModel { /** - * Unique event-type name. + * The unique event name. * * @param string $name * @@ -33,7 +34,7 @@ class WebhookEventType extends PayPalResourceModel } /** - * Unique event-type name. + * The unique event name. * * @return string */ @@ -43,7 +44,7 @@ class WebhookEventType extends PayPalResourceModel } /** - * Human readable description of the event-type + * A human-readable description of the event. * * @param string $description * @@ -56,7 +57,7 @@ class WebhookEventType extends PayPalResourceModel } /** - * Human readable description of the event-type + * A human-readable description of the event. * * @return string */ @@ -66,7 +67,30 @@ class WebhookEventType extends PayPalResourceModel } /** - * Retrieves the list of events-types subscribed by the given Webhook. + * The status of a webhook event. + * + * @param string $status + * + * @return $this + */ + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + /** + * The status of a webhook event. + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + /** + * Lists event subscriptions for a webhook, by ID. * * @param string $webhookId * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. @@ -91,7 +115,7 @@ class WebhookEventType extends PayPalResourceModel } /** - * Retrieves the master list of available Webhooks events-types resources for any webhook to subscribe to. + * Lists available events to which any webhook can subscribe. For a list of supported events, see [Webhook events](/docs/integration/direct/rest/webhooks/webhook-events/). * * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls diff --git a/lib/PayPal/Api/WebhookEventTypeList.php b/lib/PayPal/Api/WebhookEventTypeList.php index 61c0d65..63fa2c4 100644 --- a/lib/PayPal/Api/WebhookEventTypeList.php +++ b/lib/PayPal/Api/WebhookEventTypeList.php @@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel; /** * Class WebhookEventTypeList * - * List of Webhooks event-types + * List of webhook events. * * @package PayPal\Api * @@ -16,7 +16,7 @@ use PayPal\Common\PayPalModel; class WebhookEventTypeList extends PayPalModel { /** - * A list of Webhooks event-types + * A list of webhook events. * * @param \PayPal\Api\WebhookEventType[] $event_types * @@ -29,7 +29,7 @@ class WebhookEventTypeList extends PayPalModel } /** - * A list of Webhooks event-types + * A list of webhook events. * * @return \PayPal\Api\WebhookEventType[] */ diff --git a/lib/PayPal/Api/WebhookList.php b/lib/PayPal/Api/WebhookList.php index 4bb5148..9ccbb36 100644 --- a/lib/PayPal/Api/WebhookList.php +++ b/lib/PayPal/Api/WebhookList.php @@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel; /** * Class WebhookList * - * List of Webhooks + * List of webhooks. * * @package PayPal\Api * @@ -16,7 +16,7 @@ use PayPal\Common\PayPalModel; class WebhookList extends PayPalModel { /** - * A list of Webhooks + * A list of webhooks. * * @param \PayPal\Api\Webhook[] $webhooks * @@ -29,7 +29,7 @@ class WebhookList extends PayPalModel } /** - * A list of Webhooks + * A list of webhooks. * * @return \PayPal\Api\Webhook[] */ diff --git a/sample/doc/assets/behavior.js b/sample/doc/assets/behavior.js index feb044e..657d111 100644 --- a/sample/doc/assets/behavior.js +++ b/sample/doc/assets/behavior.js @@ -6,6 +6,25 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 tableOfContents = [ { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/index.php", + "projectPath": "index.php", + "targetPath": "index", + "pageTitle": "index", + "title": "index" + }, + "depth": 1, + "outline": [] + }, { "type": "folder", "data": { "path": "billing", @@ -24,7 +43,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/CreateBillingAgreementWithCreditCard.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/CreateBillingAgreementWithCreditCard.php", "projectPath": "billing/CreateBillingAgreementWithCreditCard.php", "targetPath": "billing/CreateBillingAgreementWithCreditCard", "pageTitle": "billing/CreateBillingAgreementWithCreditCard", @@ -64,7 +83,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/CreateBillingAgreementWithPayPal.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/CreateBillingAgreementWithPayPal.php", "projectPath": "billing/CreateBillingAgreementWithPayPal.php", "targetPath": "billing/CreateBillingAgreementWithPayPal", "pageTitle": "billing/CreateBillingAgreementWithPayPal", @@ -112,7 +131,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/CreatePlan.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/CreatePlan.php", "projectPath": "billing/CreatePlan.php", "targetPath": "billing/CreatePlan", "pageTitle": "billing/CreatePlan", @@ -168,7 +187,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/DeletePlan.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/DeletePlan.php", "projectPath": "billing/DeletePlan.php", "targetPath": "billing/DeletePlan", "pageTitle": "billing/DeletePlan", @@ -197,7 +216,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/ExecuteAgreement.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/ExecuteAgreement.php", "projectPath": "billing/ExecuteAgreement.php", "targetPath": "billing/ExecuteAgreement", "pageTitle": "billing/ExecuteAgreement", @@ -253,7 +272,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/GetBillingAgreement.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/GetBillingAgreement.php", "projectPath": "billing/GetBillingAgreement.php", "targetPath": "billing/GetBillingAgreement", "pageTitle": "billing/GetBillingAgreement", @@ -282,7 +301,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/GetPlan.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/GetPlan.php", "projectPath": "billing/GetPlan.php", "targetPath": "billing/GetPlan", "pageTitle": "billing/GetPlan", @@ -311,7 +330,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/ListPlans.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/ListPlans.php", "projectPath": "billing/ListPlans.php", "targetPath": "billing/ListPlans", "pageTitle": "billing/ListPlans", @@ -340,7 +359,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/ReactivateBillingAgreement.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/ReactivateBillingAgreement.php", "projectPath": "billing/ReactivateBillingAgreement.php", "targetPath": "billing/ReactivateBillingAgreement", "pageTitle": "billing/ReactivateBillingAgreement", @@ -369,7 +388,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/SearchBillingTransactions.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/SearchBillingTransactions.php", "projectPath": "billing/SearchBillingTransactions.php", "targetPath": "billing/SearchBillingTransactions", "pageTitle": "billing/SearchBillingTransactions", @@ -398,7 +417,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/SuspendBillingAgreement.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/SuspendBillingAgreement.php", "projectPath": "billing/SuspendBillingAgreement.php", "targetPath": "billing/SuspendBillingAgreement", "pageTitle": "billing/SuspendBillingAgreement", @@ -427,7 +446,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/UpdateBillingAgreement.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/UpdateBillingAgreement.php", "projectPath": "billing/UpdateBillingAgreement.php", "targetPath": "billing/UpdateBillingAgreement", "pageTitle": "billing/UpdateBillingAgreement", @@ -456,7 +475,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/UpdatePlan.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/UpdatePlan.php", "projectPath": "billing/UpdatePlan.php", "targetPath": "billing/UpdatePlan", "pageTitle": "billing/UpdatePlan", @@ -496,7 +515,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/billing/UpdatePlanPaymentDefinitions.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/billing/UpdatePlanPaymentDefinitions.php", "projectPath": "billing/UpdatePlanPaymentDefinitions.php", "targetPath": "billing/UpdatePlanPaymentDefinitions", "pageTitle": "billing/UpdatePlanPaymentDefinitions", @@ -527,6 +546,62 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 ] } ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/bootstrap.php", + "projectPath": "bootstrap.php", + "targetPath": "bootstrap", + "pageTitle": "bootstrap", + "title": "bootstrap" + }, + "depth": 1, + "outline": [ + { + "type": "heading", + "data": { + "level": 4, + "title": "SDK configuration", + "slug": "sdk-configuration" + }, + "depth": 4 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Api context", + "slug": "api-context" + }, + "depth": 3 + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/common.php", + "projectPath": "common.php", + "targetPath": "common", + "pageTitle": "common", + "title": "common" + }, + "depth": 1, + "outline": [] }, { "type": "folder", "data": { @@ -546,7 +621,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/CancelInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/CancelInvoice.php", "projectPath": "invoice/CancelInvoice.php", "targetPath": "invoice/CancelInvoice", "pageTitle": "invoice/CancelInvoice", @@ -594,7 +669,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/CreateInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/CreateInvoice.php", "projectPath": "invoice/CreateInvoice.php", "targetPath": "invoice/CreateInvoice", "pageTitle": "invoice/CreateInvoice", @@ -717,7 +792,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/CreateThirdPartyInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/CreateThirdPartyInvoice.php", "projectPath": "invoice/CreateThirdPartyInvoice.php", "targetPath": "invoice/CreateThirdPartyInvoice", "pageTitle": "invoice/CreateThirdPartyInvoice", @@ -813,7 +888,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/DeleteInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/DeleteInvoice.php", "projectPath": "invoice/DeleteInvoice.php", "targetPath": "invoice/DeleteInvoice", "pageTitle": "invoice/DeleteInvoice", @@ -853,7 +928,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/GetInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/GetInvoice.php", "projectPath": "invoice/GetInvoice.php", "targetPath": "invoice/GetInvoice", "pageTitle": "invoice/GetInvoice", @@ -893,7 +968,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/GetNextInvoiceNumber.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/GetNextInvoiceNumber.php", "projectPath": "invoice/GetNextInvoiceNumber.php", "targetPath": "invoice/GetNextInvoiceNumber", "pageTitle": "invoice/GetNextInvoiceNumber", @@ -933,7 +1008,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/ListInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/ListInvoice.php", "projectPath": "invoice/ListInvoice.php", "targetPath": "invoice/ListInvoice", "pageTitle": "invoice/ListInvoice", @@ -973,7 +1048,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/RecordPayment.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/RecordPayment.php", "projectPath": "invoice/RecordPayment.php", "targetPath": "invoice/RecordPayment", "pageTitle": "invoice/RecordPayment", @@ -1029,7 +1104,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/RecordRefund.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/RecordRefund.php", "projectPath": "invoice/RecordRefund.php", "targetPath": "invoice/RecordRefund", "pageTitle": "invoice/RecordRefund", @@ -1085,7 +1160,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/RemindInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/RemindInvoice.php", "projectPath": "invoice/RemindInvoice.php", "targetPath": "invoice/RemindInvoice", "pageTitle": "invoice/RemindInvoice", @@ -1141,7 +1216,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/RetrieveQRCode.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/RetrieveQRCode.php", "projectPath": "invoice/RetrieveQRCode.php", "targetPath": "invoice/RetrieveQRCode", "pageTitle": "invoice/RetrieveQRCode", @@ -1197,7 +1272,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/SearchInvoices.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/SearchInvoices.php", "projectPath": "invoice/SearchInvoices.php", "targetPath": "invoice/SearchInvoices", "pageTitle": "invoice/SearchInvoices", @@ -1245,7 +1320,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/SendInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/SendInvoice.php", "projectPath": "invoice/SendInvoice.php", "targetPath": "invoice/SendInvoice", "pageTitle": "invoice/SendInvoice", @@ -1293,7 +1368,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/invoice/UpdateInvoice.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/invoice/UpdateInvoice.php", "projectPath": "invoice/UpdateInvoice.php", "targetPath": "invoice/UpdateInvoice", "pageTitle": "invoice/UpdateInvoice", @@ -1367,7 +1442,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/lipp/GenerateAccessTokenFromRefreshToken.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/lipp/GenerateAccessTokenFromRefreshToken.php", "projectPath": "lipp/GenerateAccessTokenFromRefreshToken.php", "targetPath": "lipp/GenerateAccessTokenFromRefreshToken", "pageTitle": "lipp/GenerateAccessTokenFromRefreshToken", @@ -1396,7 +1471,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/lipp/GetUserInfo.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/lipp/GetUserInfo.php", "projectPath": "lipp/GetUserInfo.php", "targetPath": "lipp/GetUserInfo", "pageTitle": "lipp/GetUserInfo", @@ -1425,7 +1500,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/lipp/ObtainUserConsent.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/lipp/ObtainUserConsent.php", "projectPath": "lipp/ObtainUserConsent.php", "targetPath": "lipp/ObtainUserConsent", "pageTitle": "lipp/ObtainUserConsent", @@ -1454,7 +1529,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/lipp/UserConsentRedirect.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/lipp/UserConsentRedirect.php", "projectPath": "lipp/UserConsentRedirect.php", "targetPath": "lipp/UserConsentRedirect", "pageTitle": "lipp/UserConsentRedirect", @@ -1493,7 +1568,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/CreateWebhook.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/CreateWebhook.php", "projectPath": "notifications/CreateWebhook.php", "targetPath": "notifications/CreateWebhook", "pageTitle": "notifications/CreateWebhook", @@ -1560,7 +1635,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/DeleteAllWebhooks.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/DeleteAllWebhooks.php", "projectPath": "notifications/DeleteAllWebhooks.php", "targetPath": "notifications/DeleteAllWebhooks", "pageTitle": "notifications/DeleteAllWebhooks", @@ -1611,7 +1686,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/DeleteWebhook.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/DeleteWebhook.php", "projectPath": "notifications/DeleteWebhook.php", "targetPath": "notifications/DeleteWebhook", "pageTitle": "notifications/DeleteWebhook", @@ -1662,7 +1737,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/GetWebhook.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/GetWebhook.php", "projectPath": "notifications/GetWebhook.php", "targetPath": "notifications/GetWebhook", "pageTitle": "notifications/GetWebhook", @@ -1713,7 +1788,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/ListSubscribedWebhookEventTypes.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/ListSubscribedWebhookEventTypes.php", "projectPath": "notifications/ListSubscribedWebhookEventTypes.php", "targetPath": "notifications/ListSubscribedWebhookEventTypes", "pageTitle": "notifications/ListSubscribedWebhookEventTypes", @@ -1764,7 +1839,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/ListWebhooks.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/ListWebhooks.php", "projectPath": "notifications/ListWebhooks.php", "targetPath": "notifications/ListWebhooks", "pageTitle": "notifications/ListWebhooks", @@ -1815,7 +1890,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/SearchWebhookEvents.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/SearchWebhookEvents.php", "projectPath": "notifications/SearchWebhookEvents.php", "targetPath": "notifications/SearchWebhookEvents", "pageTitle": "notifications/SearchWebhookEvents", @@ -1874,7 +1949,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/UpdateWebhook.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/UpdateWebhook.php", "projectPath": "notifications/UpdateWebhook.php", "targetPath": "notifications/UpdateWebhook", "pageTitle": "notifications/UpdateWebhook", @@ -1925,7 +2000,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/ValidateWebhookEvent.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/ValidateWebhookEvent.php", "projectPath": "notifications/ValidateWebhookEvent.php", "targetPath": "notifications/ValidateWebhookEvent", "pageTitle": "notifications/ValidateWebhookEvent", @@ -1940,29 +2015,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "title": "Validate Webhook", "slug": "validate-webhook" }, - "depth": 1, - "children": [ - { - "type": "heading", - "data": { - "level": 2, - "title": "Received Body from Webhook", - "slug": "received-body-from-webhook" - }, - "depth": 2, - "children": [ - { - "type": "heading", - "data": { - "level": 3, - "title": "Validate Received Event Method", - "slug": "validate-received-event-method" - }, - "depth": 3 - } - ] - } - ] + "depth": 1 } ] }, { @@ -1976,7 +2029,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/notifications/WebhookEventTypesList.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/notifications/WebhookEventTypesList.php", "projectPath": "notifications/WebhookEventTypesList.php", "targetPath": "notifications/WebhookEventTypesList", "pageTitle": "notifications/WebhookEventTypesList", @@ -2026,7 +2079,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payment-experience/CreateWebProfile.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payment-experience/CreateWebProfile.php", "projectPath": "payment-experience/CreateWebProfile.php", "targetPath": "payment-experience/CreateWebProfile", "pageTitle": "payment-experience/CreateWebProfile", @@ -2066,7 +2119,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payment-experience/DeleteWebProfile.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payment-experience/DeleteWebProfile.php", "projectPath": "payment-experience/DeleteWebProfile.php", "targetPath": "payment-experience/DeleteWebProfile", "pageTitle": "payment-experience/DeleteWebProfile", @@ -2095,7 +2148,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payment-experience/GetWebProfile.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payment-experience/GetWebProfile.php", "projectPath": "payment-experience/GetWebProfile.php", "targetPath": "payment-experience/GetWebProfile", "pageTitle": "payment-experience/GetWebProfile", @@ -2124,7 +2177,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payment-experience/ListWebProfiles.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payment-experience/ListWebProfiles.php", "projectPath": "payment-experience/ListWebProfiles.php", "targetPath": "payment-experience/ListWebProfiles", "pageTitle": "payment-experience/ListWebProfiles", @@ -2153,7 +2206,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payment-experience/PartiallyUpdateWebProfile.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payment-experience/PartiallyUpdateWebProfile.php", "projectPath": "payment-experience/PartiallyUpdateWebProfile.php", "targetPath": "payment-experience/PartiallyUpdateWebProfile", "pageTitle": "payment-experience/PartiallyUpdateWebProfile", @@ -2190,7 +2243,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payment-experience/UpdateWebProfile.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payment-experience/UpdateWebProfile.php", "projectPath": "payment-experience/UpdateWebProfile.php", "targetPath": "payment-experience/UpdateWebProfile", "pageTitle": "payment-experience/UpdateWebProfile", @@ -2229,7 +2282,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/AuthorizationCapture.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/AuthorizationCapture.php", "projectPath": "payments/AuthorizationCapture.php", "targetPath": "payments/AuthorizationCapture", "pageTitle": "payments/AuthorizationCapture", @@ -2269,7 +2322,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/AuthorizePayment.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/AuthorizePayment.php", "projectPath": "payments/AuthorizePayment.php", "targetPath": "payments/AuthorizePayment", "pageTitle": "payments/AuthorizePayment", @@ -2309,7 +2362,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/AuthorizePaymentUsingPayPal.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/AuthorizePaymentUsingPayPal.php", "projectPath": "payments/AuthorizePaymentUsingPayPal.php", "targetPath": "payments/AuthorizePaymentUsingPayPal", "pageTitle": "payments/AuthorizePaymentUsingPayPal", @@ -2413,7 +2466,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/CreateFuturePayment.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/CreateFuturePayment.php", "projectPath": "payments/CreateFuturePayment.php", "targetPath": "payments/CreateFuturePayment", "pageTitle": "payments/CreateFuturePayment", @@ -2501,7 +2554,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/CreatePayment.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/CreatePayment.php", "projectPath": "payments/CreatePayment.php", "targetPath": "payments/CreatePayment", "pageTitle": "payments/CreatePayment", @@ -2605,7 +2658,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/CreatePaymentUsingPayPal.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/CreatePaymentUsingPayPal.php", "projectPath": "payments/CreatePaymentUsingPayPal.php", "targetPath": "payments/CreatePaymentUsingPayPal", "pageTitle": "payments/CreatePaymentUsingPayPal", @@ -2709,7 +2762,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/CreatePaymentUsingSavedCard.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/CreatePaymentUsingSavedCard.php", "projectPath": "payments/CreatePaymentUsingSavedCard.php", "targetPath": "payments/CreatePaymentUsingSavedCard", "pageTitle": "payments/CreatePaymentUsingSavedCard", @@ -2813,7 +2866,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/ExecutePayment.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/ExecutePayment.php", "projectPath": "payments/ExecutePayment.php", "targetPath": "payments/ExecutePayment", "pageTitle": "payments/ExecutePayment", @@ -2869,7 +2922,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/GetAuthorization.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/GetAuthorization.php", "projectPath": "payments/GetAuthorization.php", "targetPath": "payments/GetAuthorization", "pageTitle": "payments/GetAuthorization", @@ -2909,7 +2962,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/GetCapture.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/GetCapture.php", "projectPath": "payments/GetCapture.php", "targetPath": "payments/GetCapture", "pageTitle": "payments/GetCapture", @@ -2949,7 +3002,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/GetPayment.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/GetPayment.php", "projectPath": "payments/GetPayment.php", "targetPath": "payments/GetPayment", "pageTitle": "payments/GetPayment", @@ -2989,7 +3042,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/ListPayments.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/ListPayments.php", "projectPath": "payments/ListPayments.php", "targetPath": "payments/ListPayments", "pageTitle": "payments/ListPayments", @@ -3029,7 +3082,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderAuthorize.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderAuthorize.php", "projectPath": "payments/OrderAuthorize.php", "targetPath": "payments/OrderAuthorize", "pageTitle": "payments/OrderAuthorize", @@ -3093,7 +3146,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderCapture.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderCapture.php", "projectPath": "payments/OrderCapture.php", "targetPath": "payments/OrderCapture", "pageTitle": "payments/OrderCapture", @@ -3157,7 +3210,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateForAuthorization.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateForAuthorization.php", "projectPath": "payments/OrderCreateForAuthorization.php", "targetPath": "payments/OrderCreateForAuthorization", "pageTitle": "payments/OrderCreateForAuthorization", @@ -3261,7 +3314,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateForCapture.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateForCapture.php", "projectPath": "payments/OrderCreateForCapture.php", "targetPath": "payments/OrderCreateForCapture", "pageTitle": "payments/OrderCreateForCapture", @@ -3365,7 +3418,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateForVoid.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateForVoid.php", "projectPath": "payments/OrderCreateForVoid.php", "targetPath": "payments/OrderCreateForVoid", "pageTitle": "payments/OrderCreateForVoid", @@ -3469,7 +3522,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateUsingPayPal.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderCreateUsingPayPal.php", "projectPath": "payments/OrderCreateUsingPayPal.php", "targetPath": "payments/OrderCreateUsingPayPal", "pageTitle": "payments/OrderCreateUsingPayPal", @@ -3573,7 +3626,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderDoVoid.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderDoVoid.php", "projectPath": "payments/OrderDoVoid.php", "targetPath": "payments/OrderDoVoid", "pageTitle": "payments/OrderDoVoid", @@ -3629,7 +3682,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/OrderGet.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/OrderGet.php", "projectPath": "payments/OrderGet.php", "targetPath": "payments/OrderGet", "pageTitle": "payments/OrderGet", @@ -3669,7 +3722,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/Reauthorization.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/Reauthorization.php", "projectPath": "payments/Reauthorization.php", "targetPath": "payments/Reauthorization", "pageTitle": "payments/Reauthorization", @@ -3717,7 +3770,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/RefundCapture.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/RefundCapture.php", "projectPath": "payments/RefundCapture.php", "targetPath": "payments/RefundCapture", "pageTitle": "payments/RefundCapture", @@ -3757,7 +3810,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/UpdatePayment.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/UpdatePayment.php", "projectPath": "payments/UpdatePayment.php", "targetPath": "payments/UpdatePayment", "pageTitle": "payments/UpdatePayment", @@ -3832,7 +3885,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payments/VoidAuthorization.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payments/VoidAuthorization.php", "projectPath": "payments/VoidAuthorization.php", "targetPath": "payments/VoidAuthorization", "pageTitle": "payments/VoidAuthorization", @@ -3882,7 +3935,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payouts/CancelPayoutItem.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payouts/CancelPayoutItem.php", "projectPath": "payouts/CancelPayoutItem.php", "targetPath": "payouts/CancelPayoutItem", "pageTitle": "payouts/CancelPayoutItem", @@ -3933,7 +3986,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payouts/CreateBatchPayout.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payouts/CreateBatchPayout.php", "projectPath": "payouts/CreateBatchPayout.php", "targetPath": "payouts/CreateBatchPayout", "pageTitle": "payouts/CreateBatchPayout", @@ -4016,7 +4069,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payouts/CreateSinglePayout.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payouts/CreateSinglePayout.php", "projectPath": "payouts/CreateSinglePayout.php", "targetPath": "payouts/CreateSinglePayout", "pageTitle": "payouts/CreateSinglePayout", @@ -4083,7 +4136,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payouts/GetPayoutBatchStatus.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payouts/GetPayoutBatchStatus.php", "projectPath": "payouts/GetPayoutBatchStatus.php", "targetPath": "payouts/GetPayoutBatchStatus", "pageTitle": "payouts/GetPayoutBatchStatus", @@ -4134,7 +4187,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/payouts/GetPayoutItemStatus.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/payouts/GetPayoutItemStatus.php", "projectPath": "payouts/GetPayoutItemStatus.php", "targetPath": "payouts/GetPayoutItemStatus", "pageTitle": "payouts/GetPayoutItemStatus", @@ -4195,7 +4248,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/sale/GetSale.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/sale/GetSale.php", "projectPath": "sale/GetSale.php", "targetPath": "sale/GetSale", "pageTitle": "sale/GetSale", @@ -4243,7 +4296,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/sale/RefundSale.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/sale/RefundSale.php", "projectPath": "sale/RefundSale.php", "targetPath": "sale/RefundSale", "pageTitle": "sale/RefundSale", @@ -4309,7 +4362,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/tls/TlsCheck.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/tls/TlsCheck.php", "projectPath": "tls/TlsCheck.php", "targetPath": "tls/TlsCheck", "pageTitle": "tls/TlsCheck", @@ -4370,7 +4423,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/CreateBankAccount.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/CreateBankAccount.php", "projectPath": "vault/CreateBankAccount.php", "targetPath": "vault/CreateBankAccount", "pageTitle": "vault/CreateBankAccount", @@ -4418,7 +4471,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/CreateCreditCard.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/CreateCreditCard.php", "projectPath": "vault/CreateCreditCard.php", "targetPath": "vault/CreateCreditCard", "pageTitle": "vault/CreateCreditCard", @@ -4474,7 +4527,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/DeleteBankAccount.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/DeleteBankAccount.php", "projectPath": "vault/DeleteBankAccount.php", "targetPath": "vault/DeleteBankAccount", "pageTitle": "vault/DeleteBankAccount", @@ -4514,7 +4567,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/DeleteCreditCard.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/DeleteCreditCard.php", "projectPath": "vault/DeleteCreditCard.php", "targetPath": "vault/DeleteCreditCard", "pageTitle": "vault/DeleteCreditCard", @@ -4554,7 +4607,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/GetBankAccount.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/GetBankAccount.php", "projectPath": "vault/GetBankAccount.php", "targetPath": "vault/GetBankAccount", "pageTitle": "vault/GetBankAccount", @@ -4583,7 +4636,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/GetCreditCard.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/GetCreditCard.php", "projectPath": "vault/GetCreditCard.php", "targetPath": "vault/GetCreditCard", "pageTitle": "vault/GetCreditCard", @@ -4612,7 +4665,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/ListCreditCards.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/ListCreditCards.php", "projectPath": "vault/ListCreditCards.php", "targetPath": "vault/ListCreditCards", "pageTitle": "vault/ListCreditCards", @@ -4652,7 +4705,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "foldPrefix": "^", "name": "PHP" }, - "sourcePath": "/home/travis/build/paypal/PayPal-PHP-SDK/sample/vault/UpdateCreditCard.php", + "sourcePath": "/Users/scoffey/paypal/PayPal-PHP-SDK/sample/vault/UpdateCreditCard.php", "projectPath": "vault/UpdateCreditCard.php", "targetPath": "vault/UpdateCreditCard", "pageTitle": "vault/UpdateCreditCard", diff --git a/sample/doc/notifications/ValidateWebhookEvent.html b/sample/doc/notifications/ValidateWebhookEvent.html index 0ace721..b5209af 100644 --- a/sample/doc/notifications/ValidateWebhookEvent.html +++ b/sample/doc/notifications/ValidateWebhookEvent.html @@ -1,19 +1,34 @@ notifications/ValidateWebhookEvent
notifications/ValidateWebhookEvent.php
<?php +use \PayPal\Api\VerifyWebhookSignature; +use \PayPal\Api\WebhookEvent; + $apiContext = require __DIR__ . '/../bootstrap.php';

Validate Webhook

PHP Currently does not support certificate chain validation, that is necessary to validate webhook directly, from received data -To resolve that, we need to use alternative, which includes making a GET call to obtain the data directly from PayPal.

Received Body from Webhook

-

Body received from webhook. This would be the data that you receive in the post request that comes from PayPal, to your webhook set URL. -This is a sample data, that represents the webhook event data.

$bodyReceived = '{"id":"WH-36G56432PK518391U-9HW18392D95289106","create_time":"2015-06-01T20:21:13Z","resource_type":"sale","event_type":"PAYMENT.SALE.COMPLETED","summary":"Payment completed for $ 20.0 USD","resource":{"id":"2FY57107YS3937627","create_time":"2015-06-01T20:20:28Z","update_time":"2015-06-01T20:20:46Z","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-2SV945219E505370PKVWL5DA","transaction_fee":{"value":"0.88","currency":"USD"},"links":[{"href":"https://api.sandbox.paypal.com/v1/payments/sale/2FY57107YS3937627","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/payments/sale/2FY57107YS3937627/refund","rel":"refund","method":"POST"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-2SV945219E505370PKVWL5DA","rel":"parent_payment","method":"GET"}]},"links":[{"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-36G56432PK518391U-9HW18392D95289106","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-36G56432PK518391U-9HW18392D95289106/resend","rel":"resend","method":"POST"}]}'; - -/** +To resolve that, we need to use alternative, which makes a call to PayPal's verify-webhook-signature API.

/** * This is one way to receive the entire body that you received from PayPal webhook. This is one of the way to retrieve that information. * Just uncomment the below line to read the data from actual request. */ -/** @var String $bodyReceived */

$bodyReceived = file_get_contents('php://input');

Validate Received Event Method

-

Call the validateReceivedEvent() method with provided body, and apiContext object to validate

try { - /** @var \PayPal\Api\WebhookEvent $output */ - $output = \PayPal\Api\WebhookEvent::validateAndGetReceivedEvent($bodyReceived, $apiContext); -} catch (Exception $ex) {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printError("Validate Received Webhook Event", "WebhookEvent", null, $bodyReceived, $ex); +/** @var String $requestBody */ +$requestBody = '{"id":"WH-9UG43882HX7271132-6E0871324L7949614","event_version":"1.0","create_time":"2016-09-21T22:00:45Z","resource_type":"sale","event_type":"PAYMENT.SALE.COMPLETED","summary":"Payment completed for $ 21.0 USD","resource":{"id":"80F85758S3080410K","state":"completed","amount":{"total":"21.00","currency":"USD","details":{"subtotal":"17.50","tax":"1.30","shipping":"2.20"}},"payment_mode":"INSTANT_TRANSFER","protection_eligibility":"ELIGIBLE","protection_eligibility_type":"ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE","transaction_fee":{"value":"0.91","currency":"USD"},"invoice_number":"57e3028db8d1b","custom":"","parent_payment":"PAY-7F371669SL612941HK7RQFDQ","create_time":"2016-09-21T21:59:02Z","update_time":"2016-09-21T22:00:06Z","links":[{"href":"https://api.sandbox.paypal.com/v1/payments/sale/80F85758S3080410K","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/payments/sale/80F85758S3080410K/refund","rel":"refund","method":"POST"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-7F371669SL612941HK7RQFDQ","rel":"parent_payment","method":"GET"}]},"links":[{"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-9UG43882HX7271132-6E0871324L7949614","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-9UG43882HX7271132-6E0871324L7949614/resend","rel":"resend","method":"POST"}]}'; + +$signatureVerification = new VerifyWebhookSignature(); +$signatureVerification->setAuthAlgo("SHA256withRSA"); +$signatureVerification->setTransmissionId("d938e770-8046-11e6-8103-6b62a8a99ac4"); +$signatureVerification->setCertUrl("https://api.sandbox.paypal.com/v1/notifications/certs/CERT-360caa42-fca2a594-a5cafa77"); // todo: this isn't going to work +$signatureVerification->setWebhookId("9XL90610J3647323C"); +$signatureVerification->setTransmissionSig("eDOnWUj9FXOnr2naQnrdL7bhgejVSTwRbwbJ0kuk5wAtm2ZYkr7w5BSUDO7e5ZOsqLwN3sPn3RV85Jd9pjHuTlpuXDLYk+l5qiViPbaaC0tLV+8C/zbDjg2WCfvtf2NmFT8CHgPPQAByUqiiTY+RJZPPQC5np7j7WuxcegsJLeWStRAofsDLiSKrzYV3CKZYtNoNnRvYmSFMkYp/5vk4xGcQLeYNV1CC2PyqraZj8HGG6Y+KV4trhreV9VZDn+rPtLDZTbzUohie1LpEy31k2dg+1szpWaGYOz+MRb40U04oD7fD69vghCrDTYs5AsuFM2+WZtsMDmYGI0pxLjn2yw=="); +$signatureVerification->setTransmissionTime("2016-09-21T22:00:46Z"); + + +$webhookEvent = new WebhookEvent(); +$webhookEvent->fromJson($requestBody); +$signatureVerification->setWebhookEvent($webhookEvent); +$request = clone $signatureVerification; + +try { + /** @var \PayPal\Api\VerifyWebhookSignatureResponse $output */ + $output = $signatureVerification->post($apiContext); +} catch (Exception $ex) {

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printError("Validate Received Webhook Event", "WebhookEvent", null, $request->toJSON(), $ex); exit(1); -}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getId(), $bodyReceived, $output);
+}

NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY

ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getVerificationStatus(), $request->toJSON(), $output);
\ No newline at end of file diff --git a/sample/index.php b/sample/index.php index bc55caf..cfc3836 100644 --- a/sample/index.php +++ b/sample/index.php @@ -1176,6 +1176,17 @@ if (PHP_SAPI == 'cli') { +
  • +
    +
    Validate Webhook Event
    + +
    +
  • diff --git a/sample/notifications/ValidateWebhookEvent.php b/sample/notifications/ValidateWebhookEvent.php index 3e24a17..8dbb134 100644 --- a/sample/notifications/ValidateWebhookEvent.php +++ b/sample/notifications/ValidateWebhookEvent.php @@ -1,34 +1,42 @@ setAuthAlgo("SHA256withRSA"); +$signatureVerification->setTransmissionId("d938e770-8046-11e6-8103-6b62a8a99ac4"); +$signatureVerification->setCertUrl("https://api.sandbox.paypal.com/v1/notifications/certs/CERT-360caa42-fca2a594-a5cafa77"); // todo: this isn't going to work +$signatureVerification->setWebhookId("9XL90610J3647323C"); +$signatureVerification->setTransmissionSig("eDOnWUj9FXOnr2naQnrdL7bhgejVSTwRbwbJ0kuk5wAtm2ZYkr7w5BSUDO7e5ZOsqLwN3sPn3RV85Jd9pjHuTlpuXDLYk+l5qiViPbaaC0tLV+8C/zbDjg2WCfvtf2NmFT8CHgPPQAByUqiiTY+RJZPPQC5np7j7WuxcegsJLeWStRAofsDLiSKrzYV3CKZYtNoNnRvYmSFMkYp/5vk4xGcQLeYNV1CC2PyqraZj8HGG6Y+KV4trhreV9VZDn+rPtLDZTbzUohie1LpEy31k2dg+1szpWaGYOz+MRb40U04oD7fD69vghCrDTYs5AsuFM2+WZtsMDmYGI0pxLjn2yw=="); +$signatureVerification->setTransmissionTime("2016-09-21T22:00:46Z"); + + +$webhookEvent = new WebhookEvent(); +$webhookEvent->fromJson($requestBody); +$signatureVerification->setWebhookEvent($webhookEvent); +$request = clone $signatureVerification; -// ### Validate Received Event Method -// Call the validateReceivedEvent() method with provided body, and apiContext object to validate try { - /** @var \PayPal\Api\WebhookEvent $output */ - $output = \PayPal\Api\WebhookEvent::validateAndGetReceivedEvent($bodyReceived, $apiContext); + /** @var \PayPal\Api\VerifyWebhookSignatureResponse $output */ + $output = $signatureVerification->post($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Validate Received Webhook Event", "WebhookEvent", null, $bodyReceived, $ex); + ResultPrinter::printError("Validate Received Webhook Event", "WebhookEvent", null, $request->toJSON(), $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY -ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getId(), $bodyReceived, $output); +ResultPrinter::printResult("Validate Received Webhook Event", "WebhookEvent", $output->getVerificationStatus(), $request->toJSON(), $output); diff --git a/tests/PayPal/Test/Api/VerifyWebhookSignatureResponseTest.php b/tests/PayPal/Test/Api/VerifyWebhookSignatureResponseTest.php new file mode 100644 index 0000000..c7560f2 --- /dev/null +++ b/tests/PayPal/Test/Api/VerifyWebhookSignatureResponseTest.php @@ -0,0 +1,56 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getVerificationStatus()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param VerifyWebhookSignatureResponse $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getVerificationStatus(), "TestSample"); + } + +} diff --git a/tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php b/tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php new file mode 100644 index 0000000..48ae40a --- /dev/null +++ b/tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php @@ -0,0 +1,111 @@ +assertNotNull($obj); + $this->assertNotNull($obj->getAuthAlgo()); + $this->assertNotNull($obj->getCertUrl()); + $this->assertNotNull($obj->getTransmissionId()); + $this->assertNotNull($obj->getTransmissionSig()); + $this->assertNotNull($obj->getTransmissionTime()); + $this->assertNotNull($obj->getWebhookId()); + $this->assertNotNull($obj->getWebhookEvent()); + $this->assertEquals(self::getJson(), $obj->toJson()); + return $obj; + } + + /** + * @depends testSerializationDeserialization + * @param VerifyWebhookSignature $obj + */ + public function testGetters($obj) + { + $this->assertEquals($obj->getAuthAlgo(), "TestSample"); + $this->assertEquals($obj->getCertUrl(), "http://www.google.com"); + $this->assertEquals($obj->getTransmissionId(), "TestSample"); + $this->assertEquals($obj->getTransmissionSig(), "TestSample"); + $this->assertEquals($obj->getTransmissionTime(), "TestSample"); + $this->assertEquals($obj->getWebhookId(), "TestSample"); + $this->assertEquals($obj->getWebhookEvent(), WebhookEventTest::getObject()); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage CertUrl is not a fully qualified URL + */ + public function testUrlValidationForCertUrl() + { + $obj = new VerifyWebhookSignature(); + $obj->setCertUrl(null); + } + /** + * @dataProvider mockProvider + * @param VerifyWebhookSignature $obj + */ + public function testPost($obj, $mockApiContext) + { + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + ->disableOriginalConstructor() + ->getMock(); + + $mockPPRestCall->expects($this->any()) + ->method('execute') + ->will($this->returnValue( + VerifyWebhookSignatureResponseTest::getJson() + )); + + $result = $obj->post($mockApiContext, $mockPPRestCall); + $this->assertNotNull($result); + } + + public function mockProvider() + { + $obj = self::getObject(); + $mockApiContext = $this->getMockBuilder('ApiContext') + ->disableOriginalConstructor() + ->getMock(); + return array( + array($obj, $mockApiContext), + array($obj, null) + ); + } +} diff --git a/tests/PayPal/Test/Api/WebhookEventListTest.php b/tests/PayPal/Test/Api/WebhookEventListTest.php index 99063bd..2e47b1f 100644 --- a/tests/PayPal/Test/Api/WebhookEventListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventListTest.php @@ -2,6 +2,7 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalModel; use PayPal\Api\WebhookEventList; /** @@ -55,4 +56,6 @@ class WebhookEventListTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getCount(), 123); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } + + } diff --git a/tests/PayPal/Test/Api/WebhookEventTest.php b/tests/PayPal/Test/Api/WebhookEventTest.php index 001a600..7453dee 100644 --- a/tests/PayPal/Test/Api/WebhookEventTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTest.php @@ -2,9 +2,11 @@ namespace PayPal\Test\Api; -use PayPal\Api\WebhookEvent; -use PayPal\Exception\PayPalConnectionException; +use PayPal\Common\PayPalResourceModel; +use PayPal\Validation\ArgumentValidator; +use PayPal\Api\WebhookEventList; use PayPal\Rest\ApiContext; +use PayPal\Api\WebhookEvent; /** * Class WebhookEvent @@ -19,7 +21,7 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase */ public static function getJson() { - return '{"id":"TestSample","create_time":"TestSample","resource_type":"TestSample","event_type":"TestSample","summary":"TestSample","resource":"TestSampleObject","links":' .LinksTest::getJson() . '}'; + return '{"id":"TestSample","create_time":"TestSample","resource_type":"TestSample","event_version":"TestSample","event_type":"TestSample","summary":"TestSample","resource":"TestSampleObject","status":"TestSample","transmissions":"TestSampleObject","links":' .LinksTest::getJson() . '}'; } /** @@ -43,9 +45,12 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase $this->assertNotNull($obj->getId()); $this->assertNotNull($obj->getCreateTime()); $this->assertNotNull($obj->getResourceType()); + $this->assertNotNull($obj->getEventVersion()); $this->assertNotNull($obj->getEventType()); $this->assertNotNull($obj->getSummary()); $this->assertNotNull($obj->getResource()); + $this->assertNotNull($obj->getStatus()); + $this->assertNotNull($obj->getTransmissions()); $this->assertNotNull($obj->getLinks()); $this->assertEquals(self::getJson(), $obj->toJson()); return $obj; @@ -60,9 +65,12 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getId(), "TestSample"); $this->assertEquals($obj->getCreateTime(), "TestSample"); $this->assertEquals($obj->getResourceType(), "TestSample"); + $this->assertEquals($obj->getEventVersion(), "TestSample"); $this->assertEquals($obj->getEventType(), "TestSample"); $this->assertEquals($obj->getSummary(), "TestSample"); $this->assertEquals($obj->getResource(), "TestSampleObject"); + $this->assertEquals($obj->getStatus(), "TestSample"); + $this->assertEquals($obj->getTransmissions(), "TestSampleObject"); $this->assertEquals($obj->getLinks(), LinksTest::getObject()); } @@ -72,17 +80,17 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookEventTest::getJson() )); - $result = $obj->get("eventId", $mockApiContext, $mockPayPalRestCall); + $result = $obj->get("eventId", $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } /** @@ -91,17 +99,18 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase */ public function testResend($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); + $eventResend = EventResendTest::getObject(); - $result = $obj->resend($mockApiContext, $mockPayPalRestCall); + $result = $obj->resend($eventResend, $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } /** @@ -110,60 +119,18 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase */ public function testList($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookEventListTest::getJson() )); $params = array(); - $result = $obj->all($params, $mockApiContext, $mockPayPalRestCall); - $this->assertNotNull($result); - } - - /** - * @dataProvider mockProvider - * @param WebhookEvent $obj - */ - public function testValidateWebhook($obj, $mockApiContext) - { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') - ->disableOriginalConstructor() - ->getMock(); - - $mockPayPalRestCall->expects($this->any()) - ->method('execute') - ->will($this->returnValue( - WebhookEventTest::getJson() - )); - - $result = WebhookEvent::validateAndGetReceivedEvent('{"id":"123"}', $mockApiContext, $mockPayPalRestCall); - //$result = $obj->get("eventId", $mockApiContext, $mockPayPalRestCall); - $this->assertNotNull($result); - } - - /** - * @dataProvider mockProvider - * @param WebhookEvent $obj - * @param ApiContext $mockApiContext - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Webhook Event Id provided in the data is incorrect. This could happen if anyone other than PayPal is faking the incoming webhook data. - */ - public function testValidateWebhook404($obj, $mockApiContext) - { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') - ->disableOriginalConstructor() - ->getMock(); - - $mockPayPalRestCall->expects($this->any()) - ->method('execute') - ->will($this->throwException(new PayPalConnectionException(null, "404 not found", 404))); - - $result = WebhookEvent::validateAndGetReceivedEvent('{"id":"123"}', $mockApiContext, $mockPayPalRestCall); + $result = $obj->all($params, $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } @@ -178,45 +145,4 @@ class WebhookEventTest extends \PHPUnit_Framework_TestCase array($obj, null) ); } - - /** - * @dataProvider mockProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Body cannot be null or empty - */ - public function testValidateWebhookNull($mockApiContext) - { - WebhookEvent::validateAndGetReceivedEvent(null, $mockApiContext); - } - - /** - * @dataProvider mockProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Body cannot be null or empty - */ - public function testValidateWebhookEmpty($mockApiContext) - { - WebhookEvent::validateAndGetReceivedEvent('', $mockApiContext); - } - - /** - * @dataProvider mockProvider - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Request Body is not a valid JSON. - */ - public function testValidateWebhookInvalid($mockApiContext) - { - WebhookEvent::validateAndGetReceivedEvent('something-invalid', $mockApiContext); - } - - /** - * @dataProvider mockProvider - * @param $mockApiContext ApiContext - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Id attribute not found in JSON. Possible reason could be invalid JSON Object - */ - public function testValidateWebhookValidJSONWithoutId($obj, $mockApiContext) - { - WebhookEvent::validateAndGetReceivedEvent('{"summary":"json"}', $mockApiContext); - } } diff --git a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php index e6d7e83..339e1a3 100644 --- a/tests/PayPal/Test/Api/WebhookEventTypeListTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTypeListTest.php @@ -2,6 +2,7 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalModel; use PayPal\Api\WebhookEventTypeList; /** @@ -51,4 +52,6 @@ class WebhookEventTypeListTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getEventTypes(), WebhookEventTypeTest::getObject()); } + + } diff --git a/tests/PayPal/Test/Api/WebhookEventTypeTest.php b/tests/PayPal/Test/Api/WebhookEventTypeTest.php index 70ec286..801053b 100644 --- a/tests/PayPal/Test/Api/WebhookEventTypeTest.php +++ b/tests/PayPal/Test/Api/WebhookEventTypeTest.php @@ -2,6 +2,10 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalResourceModel; +use PayPal\Validation\ArgumentValidator; +use PayPal\Api\WebhookEventTypeList; +use PayPal\Rest\ApiContext; use PayPal\Api\WebhookEventType; /** @@ -17,7 +21,7 @@ class WebhookEventTypeTest extends \PHPUnit_Framework_TestCase */ public static function getJson() { - return '{"name":"TestSample","description":"TestSample"}'; + return '{"name":"TestSample","description":"TestSample","status":"TestSample"}'; } /** @@ -40,6 +44,7 @@ class WebhookEventTypeTest extends \PHPUnit_Framework_TestCase $this->assertNotNull($obj); $this->assertNotNull($obj->getName()); $this->assertNotNull($obj->getDescription()); + $this->assertNotNull($obj->getStatus()); $this->assertEquals(self::getJson(), $obj->toJson()); return $obj; } @@ -52,6 +57,7 @@ class WebhookEventTypeTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getName(), "TestSample"); $this->assertEquals($obj->getDescription(), "TestSample"); + $this->assertEquals($obj->getStatus(), "TestSample"); } /** @@ -60,17 +66,17 @@ class WebhookEventTypeTest extends \PHPUnit_Framework_TestCase */ public function testSubscribedEventTypes($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookEventTypeListTest::getJson() )); - $result = $obj->subscribedEventTypes("webhookId", $mockApiContext, $mockPayPalRestCall); + $result = $obj->subscribedEventTypes("webhookId", $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } /** @@ -79,17 +85,17 @@ class WebhookEventTypeTest extends \PHPUnit_Framework_TestCase */ public function testAvailableEventTypes($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( - WebhookEventTypeListTest::getJson() + WebhookEventTypeListTest::getJson() )); - $result = $obj->availableEventTypes($mockApiContext, $mockPayPalRestCall); + $result = $obj->availableEventTypes($mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } diff --git a/tests/PayPal/Test/Api/WebhookListTest.php b/tests/PayPal/Test/Api/WebhookListTest.php index c638a6f..6a16917 100644 --- a/tests/PayPal/Test/Api/WebhookListTest.php +++ b/tests/PayPal/Test/Api/WebhookListTest.php @@ -2,6 +2,7 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalModel; use PayPal\Api\WebhookList; /** @@ -51,4 +52,6 @@ class WebhookListTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getWebhooks(), WebhookTest::getObject()); } + + } diff --git a/tests/PayPal/Test/Api/WebhookTest.php b/tests/PayPal/Test/Api/WebhookTest.php index 4198261..e94678e 100644 --- a/tests/PayPal/Test/Api/WebhookTest.php +++ b/tests/PayPal/Test/Api/WebhookTest.php @@ -2,6 +2,10 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalResourceModel; +use PayPal\Validation\ArgumentValidator; +use PayPal\Api\WebhookList; +use PayPal\Rest\ApiContext; use PayPal\Api\Webhook; /** @@ -67,24 +71,23 @@ class WebhookTest extends \PHPUnit_Framework_TestCase $obj = new Webhook(); $obj->setUrl(null); } - /** * @dataProvider mockProvider * @param Webhook $obj */ public function testCreate($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); - $result = $obj->create($mockApiContext, $mockPayPalRestCall); + $result = $obj->create($mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } /** @@ -93,17 +96,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testGet($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookTest::getJson() )); - $result = $obj->get("webhookId", $mockApiContext, $mockPayPalRestCall); + $result = $obj->get("webhookId", $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } /** @@ -112,17 +115,18 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testGetAll($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( WebhookListTest::getJson() )); + $params = array(); - $result = $obj->getAll($mockApiContext, $mockPayPalRestCall); + $result = $obj->getAllWithParams($params, $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } /** @@ -131,18 +135,18 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testUpdate($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( self::getJson() )); $patchRequest = PatchRequestTest::getObject(); - $result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall); + $result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); } /** @@ -151,17 +155,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase */ public function testDelete($obj, $mockApiContext) { - $mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') + $mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall') ->disableOriginalConstructor() ->getMock(); - $mockPayPalRestCall->expects($this->any()) + $mockPPRestCall->expects($this->any()) ->method('execute') ->will($this->returnValue( true )); - $result = $obj->delete($mockApiContext, $mockPayPalRestCall); + $result = $obj->delete($mockApiContext, $mockPPRestCall); $this->assertNotNull($result); }