Updates to Sample Code

- Updated UI Presentation on samples
- Fixed Bugs
This commit is contained in:
japatel
2014-11-02 17:06:58 -06:00
parent 4d481ad104
commit 3c02790138
97 changed files with 904 additions and 1249 deletions

View File

@@ -9,7 +9,7 @@
// payments list.
// API used: GET /v1/payments/payments
require __DIR__ . '/../bootstrap.php';
require 'CreatePayment.php';
use PayPal\Api\Payment;
@@ -21,20 +21,13 @@ use PayPal\Api\Payment;
// Refer the method doc for valid values for keys
// (See bootstrap.php for more on `ApiContext`)
try {
$payments = Payment::all(array('count' => 10, 'start_index' => 5), $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception:" . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
exit(1);
$params = array('count' => 10, 'start_index' => 5);
$payments = Payment::all($params, $apiContext);
} catch (Exception $ex) {
ResultPrinter::printError("List Payments", "Payment", null, $params, $ex);
exit(1);
}
?>
<html>
<head>
<title>Lookup payment history</title>
</head>
<body>
<div>Got <?php echo $payments->getCount(); ?> matching payments </div>
<pre><?php echo $payments->toJSON(128);?></pre>
<a href='../index.html'>Back</a>
</body>
</html>
ResultPrinter::printResult("List Payments", "Payment", null, $params, $payments);