From 4b23764120488cac50794b148df7488f91e2881e Mon Sep 17 00:00:00 2001 From: Xiaolei Wheelock Date: Thu, 11 May 2017 11:43:42 -0500 Subject: [PATCH] Delete bank info vault samples, update index.php according and note the deprecated status of BankAccount Status (#849) * Delete bank info vault samples, update index.php according and note the deprecated status of BankAccount Status * Change comments in bankAccount.php file * Change the comment of bankAccount file --- lib/PayPal/Api/BankAccount.php | 3 +- sample/index.php | 33 ------------ sample/vault/CreateBankAccount.php | 83 ------------------------------ sample/vault/DeleteBankAccount.php | 23 --------- sample/vault/GetBankAccount.php | 27 ---------- 5 files changed, 2 insertions(+), 167 deletions(-) delete mode 100644 sample/vault/CreateBankAccount.php delete mode 100644 sample/vault/DeleteBankAccount.php delete mode 100644 sample/vault/GetBankAccount.php diff --git a/lib/PayPal/Api/BankAccount.php b/lib/PayPal/Api/BankAccount.php index 79803f7..1ac63cf 100644 --- a/lib/PayPal/Api/BankAccount.php +++ b/lib/PayPal/Api/BankAccount.php @@ -6,8 +6,9 @@ use PayPal\Common\PayPalModel; /** * Class BankAccount - * + * * A resource representing a bank account that can be used to fund a payment. + * @deprecated Deprecated. It is for internal use only. It may be removed in next major revision. * * @package PayPal\Api * diff --git a/sample/index.php b/sample/index.php index f8f02fc..9bf178f 100644 --- a/sample/index.php +++ b/sample/index.php @@ -925,39 +925,6 @@ if (PHP_SAPI == 'cli') { -
  • -
    -
    Bank Account - Save
    - -
    -
  • -
  • -
    -
    Bank Account - Retrieve
    - -
    -
  • -
  • -
    -
    Bank Account - Delete
    - -
    -
  • diff --git a/sample/vault/CreateBankAccount.php b/sample/vault/CreateBankAccount.php deleted file mode 100644 index d8952aa..0000000 --- a/sample/vault/CreateBankAccount.php +++ /dev/null @@ -1,83 +0,0 @@ -setAccountNumber("4417119669820331") - ->setAccountNumberType("IBAN") - ->setAccountType("SAVINGS") - ->setAccountName("Ramraj") - ->setCheckType("PERSONAL") - ->setAuthType("WEB") - ->setBankName("CITI") - ->setCountryCode("US") - ->setFirstName("Ramraj") - ->setLastName("K") - ->setBirthDate("1987-08-13") - ->setExternalCustomerId(uniqid()); - -$billingAddress = new \PayPal\Api\Address(); -$billingAddress->setLine1("52 N Main St") - ->setCity("Johnstown") - ->setState("OH") - ->setCountryCode("US") - ->setPostalCode("43210") - ->setPhone("408-334-8890"); - -$bankAccount->setBillingAddress($billingAddress); - -// For Sample Purposes Only. -$request = clone $bankAccount; - -// ### Save bank account -// Creates the bank account as a resource -// in the PayPal vault. The response contains -// an 'id' that you can use to refer to it -// in future payments. -// (See bootstrap.php for more on `ApiContext`) -try { - $bankAccount->create($apiContext); -} catch (Exception $ex) { - // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex); - exit(1); -} - -// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount); - -return $bankAccount; diff --git a/sample/vault/DeleteBankAccount.php b/sample/vault/DeleteBankAccount.php deleted file mode 100644 index b4d7914..0000000 --- a/sample/vault/DeleteBankAccount.php +++ /dev/null @@ -1,23 +0,0 @@ -} -// NOTE: HTTP method used here is DELETE - -/** @var \PayPal\Api\BankAccount $card */ -$bankAccount = require 'CreateBankAccount.php'; - -try { - // ### Delete Card - // Lookup and delete a saved credit card. - // (See bootstrap.php for more on `ApiContext`) - $bankAccount->delete($apiContext); -} catch (Exception $ex) { - // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex); - exit(1); -} - -// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null); diff --git a/sample/vault/GetBankAccount.php b/sample/vault/GetBankAccount.php deleted file mode 100644 index a76f51b..0000000 --- a/sample/vault/GetBankAccount.php +++ /dev/null @@ -1,27 +0,0 @@ -getId(), $apiContext); -} catch (Exception $ex) { - // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex); - exit(1); -} - -// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount); - -return $bankAccount;