From d24a4afdb61b027cc344f378163f10f367adf835 Mon Sep 17 00:00:00 2001
From: japatel
Date: Mon, 15 Dec 2014 13:52:00 -0600
Subject: [PATCH] Final Webhook Management API Changes
- Updated Samples
- Additional Functional Tests
- Enabled Travis to do functional tests (with allowed failures) on each build
---
.travis.yml | 4 +
release_notes.md | 1 +
sample/README.md | 4 +-
sample/doc/assets/behavior.js | 117 ++++++++++++++++-
.../notifications/SearchWebhookEvents.html | 2 +
sample/doc/notifications/createWebhook.html | 6 +-
.../payments/AuthorizePaymentUsingPayPal.html | 85 +++++++++++++
.../payments/CreatePaymentUsingPayPal.html | 2 +-
sample/doc/payments/GetAuthorization.html | 8 +-
sample/doc/payments/VoidAuthorization.html | 5 +-
sample/header.html | 20 +--
sample/index.php | 37 +++++-
sample/notifications/SearchWebhookEvents.php | 2 +
sample/notifications/createWebhook.php | 4 +
.../payments/AuthorizePaymentUsingPayPal.php | 120 ++++++++++++++++++
sample/payments/CreatePaymentUsingPayPal.php | 2 +-
sample/payments/GetAuthorization.php | 8 +-
sample/payments/VoidAuthorization.php | 5 +-
.../Functional/Api/WebhookFunctionalTest.php | 41 +++++-
.../WebhookFunctionalTest/testGetEvent.json | 4 +-
....json => testGetSubscribedEventTypes.json} | 0
21 files changed, 439 insertions(+), 38 deletions(-)
create mode 100644 sample/doc/payments/AuthorizePaymentUsingPayPal.html
create mode 100644 sample/payments/AuthorizePaymentUsingPayPal.php
rename tests/PayPal/Test/Functional/resources/WebhookFunctionalTest/{webhook_get_subscribed_event_types.json => testGetSubscribedEventTypes.json} (100%)
diff --git a/.travis.yml b/.travis.yml
index 53a172e..43fe4ea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,9 +5,13 @@ php:
- 5.5
- 5.6
- hhvm
+env:
+ - REST_MODE=mock
+ - REST_MODE=sandbox
matrix:
allow_failures:
- php: hhvm
+ - env: REST_MODE=sandbox
fast_finish: true
before_script:
- composer self-update
diff --git a/release_notes.md b/release_notes.md
index 8e0c99f..c9a4989 100644
--- a/release_notes.md
+++ b/release_notes.md
@@ -2,6 +2,7 @@ PayPal PHP SDK release notes
============================
v0.16.0
----
+* Enabled Webhook Management Capabilities
* Enabled Caching Abilities for Access Tokens
v0.15.1
diff --git a/sample/README.md b/sample/README.md
index 2997ce4..ce1e81a 100644
--- a/sample/README.md
+++ b/sample/README.md
@@ -49,8 +49,8 @@ The result would be as shown below:
The sample comes pre-configured with a test account but in case you need to try them against your account, you must
- * Obtain your client id and client secret from the developer portal
- * Update the bootstrap.php file with your new client id and secret.
+ * Obtain your client id and client secret from the [developer portal](https://developer.paypal.com/webapps/developer/applications/myapps)
+ * Update the [bootstrap.php](https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/bootstrap.php#L29) file with your new client id and secret.
#### More Help
diff --git a/sample/doc/assets/behavior.js b/sample/doc/assets/behavior.js
index 7bad080..1145214 100644
--- a/sample/doc/assets/behavior.js
+++ b/sample/doc/assets/behavior.js
@@ -1268,7 +1268,18 @@ 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": "Basic Information",
"slug": "basic-information"
},
- "depth": 1
+ "depth": 1,
+ "children": [
+ {
+ "type": "heading",
+ "data": {
+ "level": 4,
+ "title": "NOTE: Please note that you need an https url for paypal webhooks. You can however override the url with https, and accept",
+ "slug": "note-please-note-that-you-need-an-https-url-for-paypal-webhooks-you-can-however-override-the-url-with-https-and-accept"
+ },
+ "depth": 4
+ }
+ ]
}, {
"type": "heading",
"data": {
@@ -1988,6 +1999,110 @@ 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/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/payments/AuthorizePaymentUsingPayPal.php",
+ "projectPath": "payments/AuthorizePaymentUsingPayPal.php",
+ "targetPath": "payments/AuthorizePaymentUsingPayPal",
+ "pageTitle": "payments/AuthorizePaymentUsingPayPal",
+ "title": "AuthorizePaymentUsingPayPal"
+ },
+ "depth": 2,
+ "outline": [
+ {
+ "type": "heading",
+ "data": {
+ "level": 1,
+ "title": "Authorize Payment using PayPal as payment method",
+ "slug": "authorize-payment-using-paypal-as-payment-method"
+ },
+ "depth": 1,
+ "children": [
+ {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Payer",
+ "slug": "payer"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Itemized information",
+ "slug": "itemized-information"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Additional payment details",
+ "slug": "additional-payment-details"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Amount",
+ "slug": "amount"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Transaction",
+ "slug": "transaction"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Redirect urls",
+ "slug": "redirect-urls"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Payment",
+ "slug": "payment"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Create Payment",
+ "slug": "create-payment"
+ },
+ "depth": 3
+ }, {
+ "type": "heading",
+ "data": {
+ "level": 3,
+ "title": "Get redirect url",
+ "slug": "get-redirect-url"
+ },
+ "depth": 3
+ }
+ ]
+ }
+ ]
}, {
"type": "file",
"data": {
diff --git a/sample/doc/notifications/SearchWebhookEvents.html b/sample/doc/notifications/SearchWebhookEvents.html
index 6fafcca..558332e 100644
--- a/sample/doc/notifications/SearchWebhookEvents.html
+++ b/sample/doc/notifications/SearchWebhookEvents.html
@@ -6,6 +6,7 @@ API used: GET /v1/notifications/webhooks-events
Creating webhook is sample purposes only. In real scenario, you dont need to create a new webhook everytime you want to search
for a webhook events. This is made in a sample just to make sure there is minimum of one webhook to listen to.
$webhook = require __DIR__ . '/../bootstrap.php';
+use PayPal\Api\Authorization;
$params = array(
try {
@@ -17,4 +18,5 @@ for a webhook events. This is made in a sample just to make sure there is minimu
ResultPrinter::printResult("Search Webhook events", "WebhookEventList", null, $params, $output);
+
return $output;
'start_time'=>'2014-12-06T11:00:00Z', 'end_time'=>'2014-12-12T11:00:00Z'