Updating sample comments

This commit is contained in:
aydiv
2013-08-26 12:21:29 +05:30
parent b1f1887cec
commit 05a4aef55e
18 changed files with 180 additions and 121 deletions

View File

@@ -1,15 +1,14 @@
<?php
// # Delete CreditCard Sample
// This sample code demonstrate how you can
//delete a saved creditcard
// using the delete API.
// delete a saved credit card.
// API used: /v1/vault/credit-card/{<creditCardId>}
// NOTE: HTTP method used here is DELETE
require __DIR__ . '/../bootstrap.php';
use PayPal\Api\CreditCard;
use PayPal\Api\Address;
// save card for demo
// Store a mock card that can be deleted later.
// ### CreditCard
// A resource representing a credit card that can be
// used to fund a payment.
@@ -25,8 +24,7 @@ $card->setType("visa")
// ### Save card
// Creates the credit card as a resource
// in the PayPal vault. The response contains
// an 'id' that you can use to refer to it
// in the future payments.
// an 'id' that you can use to refer to it later.
// (See bootstrap.php for more on `ApiContext`)
try {
$card = $card->create($apiContext);
@@ -36,19 +34,22 @@ try {
exit(1);
}
$creditCard = CreditCard::get($card->getId(), $apiContext);
try {
// ### Delete Card
// deletes saved credit card
// (See bootstrap.php for more on `ApiContext`)
$creditCard = CreditCard::get($card->getId(), $apiContext);
$creditCard->delete($apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
exit(1);
}
?>
<html>
<head>
<title>Delete a saved credit card</title>
</head>
<body>
<p> Credit Card deleted Successfully</p>
<a href='../index.html'>Back</a>