Updating samples to use fluent setters + doc fixes

This commit is contained in:
aydiv
2013-08-22 17:24:04 +05:30
parent 14b9a13f8a
commit f4d687b52b
27 changed files with 422 additions and 893 deletions

View File

@@ -1,33 +1,33 @@
<?php
// # Get Credit Card Sample
// The CreditCard resource allows you to
// retrieve previously saved CreditCards,
// by sending a GET request to the URI
// '/v1/vault/credit-card'
// The following code takes you through
// the process of retrieving a saved CreditCard
require __DIR__ . '/../bootstrap.php';
use PayPal\Api\CreditCard;
// The cardId can be obtained from a previous save credit
// card operation. Use $card->getId()
$cardId = "CARD-5AR29593TC404090HKIKN77Q";
/// ### Retrieve card
// (See bootstrap.php for more on `ApiContext`)
try {
$card = CreditCard::get($cardId, $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
exit(1);
}
?>
<html>
<body>
<div>Retrieving credit card: <?php echo $cardId;?></div>
<pre><?php var_dump($card);?></pre>
<a href='../index.html'>Back</a>
</body>
</html>
<?php
// # Get Credit Card Sample
// The CreditCard resource allows you to
// retrieve previously saved CreditCards,
// by sending a GET request to the URI
// '/v1/vault/credit-card'
// The following code takes you through
// the process of retrieving a saved CreditCard
require __DIR__ . '/../bootstrap.php';
use PayPal\Api\CreditCard;
// The cardId can be obtained from a previous save credit
// card operation. Use $card->getId()
$cardId = "CARD-5AR29593TC404090HKIKN77Q";
/// ### Retrieve card
// (See bootstrap.php for more on `ApiContext`)
try {
$card = CreditCard::get($cardId, $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
var_dump($ex->getData());
exit(1);
}
?>
<html>
<body>
<div>Retrieving credit card: <?php echo $cardId;?></div>
<pre><?php var_dump($card);?></pre>
<a href='../index.html'>Back</a>
</body>
</html>