forked from LiveCarta/PayPal-PHP-SDK
Enabled Payment Experience
- Updated Api to enabled Payment Experience - Updated Tests and Samples - Added Json Validator - Ability for PPModel to return array of self objects
This commit is contained in:
28
sample/payment-experience/ListWebProfiles.php
Normal file
28
sample/payment-experience/ListWebProfiles.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
$apiContext = require __DIR__ . '/../bootstrap.php';
|
||||
|
||||
// ### Retrieve List of All Web Profiles
|
||||
// Documentation available at https://developer.paypal.com/webapps/developer/docs/api/#list-web-experience-profiles
|
||||
|
||||
// Retrieve the list of all web profiles by calling the
|
||||
// static `get_list` method on the WebProfile class.
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
try {
|
||||
$list = \PayPal\Api\WebProfile::get_list($apiContext);
|
||||
} catch (\Exception $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . PHP_EOL;
|
||||
if (is_a($ex, '\PayPal\Exception\PPConnectionException')) {
|
||||
/** @var $ex \PayPal\Exception\PPConnectionException */
|
||||
var_dump($ex->getData());
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
$result = '';
|
||||
foreach ($list as $object) {
|
||||
$result .= $object->toJSON(JSON_PRETTY_PRINT) . PHP_EOL;
|
||||
}
|
||||
|
||||
print_result("Get List of All Web Profiles", "Web Profiles", null, $result);
|
||||
|
||||
return $list;
|
||||
Reference in New Issue
Block a user