diff --git a/lib/PayPal/Cache/AuthorizationCache.php b/lib/PayPal/Cache/AuthorizationCache.php new file mode 100644 index 00000000..e69de29b diff --git a/lib/PayPal/Core/PPConstants.php b/lib/PayPal/Core/PPConstants.php index 194bcf74..19ca9f51 100644 --- a/lib/PayPal/Core/PPConstants.php +++ b/lib/PayPal/Core/PPConstants.php @@ -12,7 +12,7 @@ class PPConstants { const SDK_NAME = 'PayPal-PHP-SDK'; - const SDK_VERSION = '0.15.0'; + const SDK_VERSION = '0.15.1'; const REST_SANDBOX_ENDPOINT = "https://api.sandbox.paypal.com/"; const OPENID_REDIRECT_SANDBOX_URL = "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect"; diff --git a/release_notes.md b/release_notes.md index 8ef8d718..d1dcde39 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,10 @@ PayPal PHP SDK release notes ============================ +v0.15.1 +---- +* Enabled Deleting Billing Plans +* Updated Samples + v0.15.0 ---- * Extended Invoicing Capabilities diff --git a/sample/billing/DeletePlan.php b/sample/billing/DeletePlan.php index 33901f4b..9a150f5a 100644 --- a/sample/billing/DeletePlan.php +++ b/sample/billing/DeletePlan.php @@ -15,10 +15,10 @@ try { $result = $createdPlan->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Deleted a Plan", "Plan", $plan->getId(), null, $ex); + ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $ex); exit(1); } -ResultPrinter::printResult("Deleted a Plan", "Plan", $plan->getId(), null, null); +ResultPrinter::printResult("Deleted a Plan", "Plan", $createdPlan->getId(), null, null); -return $plan; +return $createdPlan; diff --git a/sample/billing/ExecuteAgreement.php b/sample/billing/ExecuteAgreement.php index 351e97b3..c0fad7f4 100644 --- a/sample/billing/ExecuteAgreement.php +++ b/sample/billing/ExecuteAgreement.php @@ -1,14 +1,19 @@ execute($token, $apiContext); } catch (Exception $ex) { ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex); diff --git a/sample/doc/assets/behavior.js b/sample/doc/assets/behavior.js index ddd38721..1047527f 100644 --- a/sample/doc/assets/behavior.js +++ b/sample/doc/assets/behavior.js @@ -204,7 +204,36 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "title": "ExecuteAgreement" }, "depth": 2, - "outline": [] + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Execute Agreement", + "slug": "execute-agreement" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 2, + "title": "Approval Status", + "slug": "approval-status" + }, + "depth": 2 + }, { + "type": "heading", + "data": { + "level": 2, + "title": "Execute Agreement", + "slug": "execute-agreement" + }, + "depth": 2 + } + ] + } + ] }, { "type": "file", "data": { @@ -1914,7 +1943,26 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "title": "Execute Payment Sample", "slug": "execute-payment-sample" }, - "depth": 1 + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Approval Status", + "slug": "approval-status" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Payment Execute", + "slug": "payment-execute" + }, + "depth": 3 + } + ] } ] }, { @@ -2330,6 +2378,54 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 "depth": 1, "children": [ { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/vault/CreateBankAccount.php", + "projectPath": "vault/CreateBankAccount.php", + "targetPath": "vault/CreateBankAccount", + "pageTitle": "vault/CreateBankAccount", + "title": "CreateBankAccount" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Create Bank Account Sample", + "slug": "create-bank-account-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Bank Account", + "slug": "bank-account" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Save bank account", + "slug": "save-bank-account" + }, + "depth": 3 + } + ] + } + ] + }, { "type": "file", "data": { "language": { @@ -2377,6 +2473,46 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 ] } ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/vault/DeleteBankAccount.php", + "projectPath": "vault/DeleteBankAccount.php", + "targetPath": "vault/DeleteBankAccount", + "pageTitle": "vault/DeleteBankAccount", + "title": "DeleteBankAccount" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Delete Bank Account Sample", + "slug": "delete-bank-account-sample" + }, + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Delete Card", + "slug": "delete-card" + }, + "depth": 3 + } + ] + } + ] }, { "type": "file", "data": { @@ -2417,6 +2553,35 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 ] } ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample/vault/GetBankAccount.php", + "projectPath": "vault/GetBankAccount.php", + "targetPath": "vault/GetBankAccount", + "pageTitle": "vault/GetBankAccount", + "title": "GetBankAccount" + }, + "depth": 2, + "outline": [ + { + "type": "heading", + "data": { + "level": 1, + "title": "Get Bank Account Sample", + "slug": "get-bank-account-sample" + }, + "depth": 1 + } + ] }, { "type": "file", "data": { diff --git a/sample/doc/billing/DeletePlan.html b/sample/doc/billing/DeletePlan.html index 171c90eb..b76de2df 100644 --- a/sample/doc/billing/DeletePlan.html +++ b/sample/doc/billing/DeletePlan.html @@ -9,10 +9,10 @@ try { $result = $createdPlan->delete($apiContext); } catch (Exception $ex) { - ResultPrinter::printError("Deleted a Plan", "Plan", $plan->getId(), null, $ex); + ResultPrinter::printError("Deleted a Plan", "Plan", $createdPlan->getId(), null, $ex); exit(1); } -ResultPrinter::printResult("Deleted a Plan", "Plan", $plan->getId(), null, null); +ResultPrinter::printResult("Deleted a Plan", "Plan", $createdPlan->getId(), null, null); -return $plan; \ No newline at end of file +return $createdPlan; \ No newline at end of file diff --git a/sample/doc/billing/ExecuteAgreement.html b/sample/doc/billing/ExecuteAgreement.html index 3a0bc3d9..956bfd5e 100644 --- a/sample/doc/billing/ExecuteAgreement.html +++ b/sample/doc/billing/ExecuteAgreement.html @@ -1,15 +1,12 @@ -billing/ExecuteAgreement
billing/ExecuteAgreement.php
<?php - -require __DIR__ . '/../bootstrap.php'; -session_start(); -if (isset($_GET['success']) && $_GET['success'] == 'true') { +billing/ExecuteAgreement
billing/ExecuteAgreement.php
<?php

Execute Agreement

+

This is the second part of CreateAgreement Sample. +Use this call to execute an agreement after the buyer approves it

require __DIR__ . '/../bootstrap.php';

Approval Status

+

Determine if the user accepted or denied the request

if (isset($_GET['success']) && $_GET['success'] == 'true') { $token = $_GET['token']; - $agreement = new \PayPal\Api\Agreement(); - - try { - $agreement->execute($token, $apiContext); + try {

Execute Agreement

+

Execute the agreement by passing in the token

$agreement->execute($token, $apiContext); } catch (Exception $ex) { ResultPrinter::printError("Executed an Agreement", "Agreement", $agreement->getId(), $_GET['token'], $ex); exit(1); diff --git a/sample/doc/billing/GetBillingAgreement.html b/sample/doc/billing/GetBillingAgreement.html index e4897f6e..b456c1ab 100644 --- a/sample/doc/billing/GetBillingAgreement.html +++ b/sample/doc/billing/GetBillingAgreement.html @@ -7,7 +7,7 @@ use PayPal\Api\Agreement; try { - $agreement = Agreement::get('I-NH3BT1XF0G93', $apiContext); + $agreement = Agreement::get($createdAgreement->getId(), $apiContext); } catch (Exception $ex) { ResultPrinter::printError("Retrieved an Agreement", "Agreement", $agreement->getId(), $createdAgreement->getId(), $ex); exit(1); diff --git a/sample/doc/payments/ExecutePayment.html b/sample/doc/payments/ExecutePayment.html index 406850a2..9693d748 100644 --- a/sample/doc/payments/ExecutePayment.html +++ b/sample/doc/payments/ExecutePayment.html @@ -1,24 +1,26 @@ payments/ExecutePayment
payments/ExecutePayment.php
<?php

Execute Payment Sample

-

This sample shows how you can complete -a payment that has been approved by +

This is the second step required to complete +PayPal checkout. Once user completes the payment, paypal +redirects the browser to "redirectUrl" provided in the request. +This sample will show you how to execute the payment +that has been approved by the buyer by logging into paypal site. You can optionally update transaction information by passing in one or more transactions. API used: POST '/v1/payments/payment//execute'.

require __DIR__ . '/../bootstrap.php'; use PayPal\Api\ExecutePayment; use PayPal\Api\Payment; -use PayPal\Api\PaymentExecution; - -if (isset($_GET['success']) && $_GET['success'] == 'true') {

Get the payment Object by passing paymentId +use PayPal\Api\PaymentExecution;

Approval Status

+

Determine if the user approved the payment or not

if (isset($_GET['success']) && $_GET['success'] == 'true') {

Get the payment Object by passing paymentId payment id was previously stored in session in CreatePaymentUsingPayPal.php

$paymentId = $_GET['paymentId']; - $payment = Payment::get($paymentId, $apiContext);

PaymentExecution object includes information necessary + $payment = Payment::get($paymentId, $apiContext);

Payment Execute

+

PaymentExecution object includes information necessary to execute a PayPal account payment. The payer_id is added to the request query parameters when the user is redirected from paypal back to your site

$execution = new PaymentExecution(); - $execution->setPayerId($_GET['PayerID']); - - //Execute the payment

(See bootstrap.php for more on ApiContext)

$result = $payment->execute($execution, $apiContext); + $execution->setPayerId($_GET['PayerID']);

Execute the payment +(See bootstrap.php for more on ApiContext)

$result = $payment->execute($execution, $apiContext); ResultPrinter::printResult("Executed Payment", "Payment", $payment->getId(), $execution, $result); diff --git a/sample/doc/vault/CreateBankAccount.html b/sample/doc/vault/CreateBankAccount.html new file mode 100644 index 00000000..5c929b29 --- /dev/null +++ b/sample/doc/vault/CreateBankAccount.html @@ -0,0 +1,68 @@ +vault/CreateBankAccount
vault/CreateBankAccount.php
<?php

Create Bank Account Sample

+

You can store credit card details securely +with PayPal. You can then use the returned +Bank Account id to process future payments. +API used: POST /v1/vault/bank-accounts

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\BankAccount;

Bank Account

+

A resource representing a bank account that is +to be stored with PayPal.

/* + { + "account_number": "4417119669820331", + "account_number_type": "IBAN", + "account_type": "SAVINGS", + "account_name": "Ramraj", + "check_type": "PERSONAL", + "auth_type": "WEB", + "bank_name": "CITI", + "country_code": "US", + "first_name": "Ramraj", + "last_name": "K", + "birth_date": "1987-08-13", + "billing_address": { + "line1": "52 N Main ST", + "city": "Johnstown", + "country_code": "US", + "postal_code": "43210", + "state": "OH", + "phone": "408-334-8890" + }, + "external_customer_id": "external_id" + } +*/ +$bankAccount = new BankAccount(); +$bankAccount->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) { + ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex); + exit(1); +} + +ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount); + +return $bankAccount;
\ No newline at end of file diff --git a/sample/doc/vault/DeleteBankAccount.html b/sample/doc/vault/DeleteBankAccount.html new file mode 100644 index 00000000..e069afd7 --- /dev/null +++ b/sample/doc/vault/DeleteBankAccount.html @@ -0,0 +1,16 @@ +vault/DeleteBankAccount
vault/DeleteBankAccount.php
<?php

Delete Bank Account Sample

+

This sample code demonstrate how you can +delete a saved bank account +API used: /v1/vault/bank-accounts/{} +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) { + ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex); + exit(1); +} + +ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null);
\ No newline at end of file diff --git a/sample/doc/vault/DeleteCreditCard.html b/sample/doc/vault/DeleteCreditCard.html index 62b7dcaf..7539a14e 100644 --- a/sample/doc/vault/DeleteCreditCard.html +++ b/sample/doc/vault/DeleteCreditCard.html @@ -8,12 +8,10 @@ try {

Delete Card

Lookup and delete a saved credit card. -(See bootstrap.php for more on ApiContext)

$creditCard = CreditCard::get($card->getId(), $apiContext); - - $creditCard->delete($apiContext); +(See bootstrap.php for more on ApiContext)

$card->delete($apiContext); } catch (Exception $ex) { ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $ex); exit(1); } -ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, $creditCard);
\ No newline at end of file +ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null);
\ No newline at end of file diff --git a/sample/doc/vault/GetBankAccount.html b/sample/doc/vault/GetBankAccount.html new file mode 100644 index 00000000..d9aef944 --- /dev/null +++ b/sample/doc/vault/GetBankAccount.html @@ -0,0 +1,17 @@ +vault/GetBankAccount
vault/GetBankAccount.php
<?php

Get Bank Account Sample

+

The Bank Account resource allows you to +retrieve previously saved Bank Accounts. +API called: '/v1/vault/bank-accounts'

The following code takes you through +the process of retrieving a saved Bank Account

/** @var \PayPal\Api\BankAccount $bankAccount */ +$bankAccount = require 'CreateBankAccount.php'; + +/// ### Retrieve Bank Account

(See bootstrap.php for more on ApiContext)

try { + $bankAccount = \PayPal\Api\BankAccount::get($bankAccount->getId(), $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex); + exit(1); +} + +ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount); + +return $bankAccount;
\ No newline at end of file diff --git a/sample/doc/vault/GetCreditCard.html b/sample/doc/vault/GetCreditCard.html index 3777777b..105f134f 100644 --- a/sample/doc/vault/GetCreditCard.html +++ b/sample/doc/vault/GetCreditCard.html @@ -5,6 +5,7 @@ The following code takes you through the process of retrieving a saved CreditCard

/** @var CreditCard $card */ $card = require 'CreateCreditCard.php'; +$id = $card->getId(); use PayPal\Api\CreditCard; diff --git a/sample/index.php b/sample/index.php index db3858f3..1ec1c84f 100644 --- a/sample/index.php +++ b/sample/index.php @@ -203,31 +203,46 @@ class="fa fa-exclamation-triangle"> Report Issues
  • -
    Direct credit card payments
    +
    PayPal Payments - similar to Express Checkout in Classic APIs
    +
    +
    +
    +
    +
    Step II: Execute after Success + (required step after user approval)
    +
    +
  • -
    PayPal account payments
    +
    Payments using credit card information
  • -
    Stored credit card payments
    +
    Payments using saved credit card (using Vault APIs)
    +
    +
    +
    Step II: Execute after Success + (required step after user approval)
    +
    + +
  • @@ -568,7 +596,7 @@ class="fa fa-file-code-o">
    • -
      Save a credit card
      +
      Credit Card - Save
      Try It @@ -579,7 +607,7 @@ class="fa fa-file-code-o">
    • -
      Retrieve saved credit card
      +
      Credit Card - Retrieve
      Try It @@ -590,7 +618,7 @@ class="fa fa-file-code-o">
    • -
      Delete saved credit card
      +
      Credit Card - Delete
      Try It @@ -599,6 +627,39 @@ class="fa fa-file-code-o">
    • +
    • +
      +
      Bank Account - Save
      + +
      +
    • +
    • +
      +
      Bank Account - Retrieve
      + +
      +
    • +
    • +
      +
      Bank Account - Delete
      + +
      +
    diff --git a/sample/payments/ExecutePayment.php b/sample/payments/ExecutePayment.php index 67080a18..4f6d478d 100644 --- a/sample/payments/ExecutePayment.php +++ b/sample/payments/ExecutePayment.php @@ -1,7 +1,10 @@ setPayerId($_GET['PayerID']); - //Execute the payment + // Execute the payment // (See bootstrap.php for more on `ApiContext`) $result = $payment->execute($execution, $apiContext); diff --git a/sample/vault/CreateBankAccount.php b/sample/vault/CreateBankAccount.php new file mode 100644 index 00000000..607028b4 --- /dev/null +++ b/sample/vault/CreateBankAccount.php @@ -0,0 +1,81 @@ +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) { + ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex); + exit(1); +} + +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 new file mode 100644 index 00000000..743a606e --- /dev/null +++ b/sample/vault/DeleteBankAccount.php @@ -0,0 +1,21 @@ +} +// 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) { + ResultPrinter::printError("Delete Bank Account", "Bank Account", null, null, $ex); + exit(1); +} + +ResultPrinter::printResult("Delete Bank Account", "Bank Account", $bankAccount->getId(), null, null); diff --git a/sample/vault/DeleteCreditCard.php b/sample/vault/DeleteCreditCard.php index fd007b97..9110daad 100644 --- a/sample/vault/DeleteCreditCard.php +++ b/sample/vault/DeleteCreditCard.php @@ -13,12 +13,10 @@ // ### Delete Card // Lookup and delete a saved credit card. // (See bootstrap.php for more on `ApiContext`) - $creditCard = CreditCard::get($card->getId(), $apiContext); - - $creditCard->delete($apiContext); + $card->delete($apiContext); } catch (Exception $ex) { ResultPrinter::printError("Delete Credit Card", "Credit Card", null, null, $ex); exit(1); } -ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, $creditCard); +ResultPrinter::printResult("Delete Credit Card", "Credit Card", $card->getId(), null, null); diff --git a/sample/vault/GetBankAccount.php b/sample/vault/GetBankAccount.php new file mode 100644 index 00000000..c93256d7 --- /dev/null +++ b/sample/vault/GetBankAccount.php @@ -0,0 +1,25 @@ +getId(), $apiContext); +} catch (Exception $ex) { + ResultPrinter::printError("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $ex); + exit(1); +} + +ResultPrinter::printResult("Get Bank Account", "Bank Account", $bankAccount->getId(), null, $bankAccount); + +return $bankAccount; diff --git a/sample/vault/GetCreditCard.php b/sample/vault/GetCreditCard.php index 6afe828c..fb9ade83 100644 --- a/sample/vault/GetCreditCard.php +++ b/sample/vault/GetCreditCard.php @@ -8,6 +8,7 @@ // the process of retrieving a saved CreditCard /** @var CreditCard $card */ $card = require 'CreateCreditCard.php'; +$id = $card->getId(); use PayPal\Api\CreditCard;