diff --git a/sample/payments/AuthorizationCapture.php b/sample/payments/AuthorizationCapture.php index 328b518..d87474a 100644 --- a/sample/payments/AuthorizationCapture.php +++ b/sample/payments/AuthorizationCapture.php @@ -6,23 +6,28 @@ require __DIR__ . '/../bootstrap.php'; use PayPal\Api\Capture; use PayPal\Api\Authorization; +use PayPal\Api\Address; use PayPal\Api\Amount; +use PayPal\Api\CreditCard; +use PayPal\Api\Payer; +use PayPal\Api\Payment; +use PayPal\Api\FundingInstrument; +use PayPal\Api\Transaction; -### Amount -//Let's you specify a payment amount. - $amount = new Amount(); - $amount->setCurrency("USD"); - $amount->setTotal("1.00"); +// create payment to get authorization Id +$authId = createAuthorization(); +$amt = new Amount(); +$amt->setCurrency("USD"); +$amt->setTotal("1.00"); ### Capture - $captur = new Capture(); -$captur->setId('5RA45624N3531924N'); -$captur->setAmount($amount); +$captur->setId($authId); +$captur->setAmount($amt); // get the authorization -$authorization = Authorization::get('8UA90289RG279654G', $apiContext); +$authorization = Authorization::get($authId, $apiContext); // ### Capture Payment // Capture Payment by posting to the APIService @@ -42,7 +47,56 @@ try { Capture payment: getId();?> -
toArray());?>+
+ toArray());?> +Back