diff --git a/sample/payments/AuthorizationCapture.php b/sample/payments/AuthorizationCapture.php new file mode 100644 index 0000000..328b518 --- /dev/null +++ b/sample/payments/AuthorizationCapture.php @@ -0,0 +1,48 @@ +setCurrency("USD"); + $amount->setTotal("1.00"); + + +### Capture + +$captur = new Capture(); +$captur->setId('5RA45624N3531924N'); +$captur->setAmount($amount); + +// get the authorization +$authorization = Authorization::get('8UA90289RG279654G', $apiContext); + +// ### Capture Payment +// Capture Payment by posting to the APIService +// using a valid ApiContext (See bootstrap.php for more on `ApiContext`) +// The return object contains the status; +try { + $capt = $authorization->capture($captur, $apiContext); +} catch (\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + +
+ Capture payment: + getId();?> +
+
toArray());?>
+ Back + + diff --git a/sample/payments/GetAuthorization.php b/sample/payments/GetAuthorization.php new file mode 100644 index 0000000..1bf13a0 --- /dev/null +++ b/sample/payments/GetAuthorization.php @@ -0,0 +1,31 @@ + + +require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Authorization; + +// ### GetAuthorization +// GetAuthorization by posting to the APIService +// using a valid ApiContext (See bootstrap.php for more on `ApiContext`) +// The return object contains the status; +try { + $authorization = Authorization::get('1FR49283DF589111P', $apiContext); +} catch (\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + +
+ Get Authorization: + getId();?> +
+
toArray());?>
+ Back + + diff --git a/sample/payments/GetCapture.php b/sample/payments/GetCapture.php new file mode 100644 index 0000000..73a7062 --- /dev/null +++ b/sample/payments/GetCapture.php @@ -0,0 +1,30 @@ + + +require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Capture; + +// ### Get Capture +// Get Capture by posting to the APIService +// using a valid ApiContext (See bootstrap.php for more on `ApiContext`) +// The return object contains the status; +try { + $capture = Capture::get('7BA08426L46375838', $apiContext); +} catch (\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + +
+ Get Capture : + getId();?> +
+
toArray());?>
+ Back + + diff --git a/sample/payments/RefundCapture.php b/sample/payments/RefundCapture.php new file mode 100644 index 0000000..447cd4c --- /dev/null +++ b/sample/payments/RefundCapture.php @@ -0,0 +1,45 @@ +}/refund + + +// ### Refund +// Create a refund object indicating +// refund amount + $amount = new Amount(); + $amount->setCurrency("USD"); + $amount->setTotal("1.00"); + + +$refund = new Refund(); +$refund->setId('7BA08426L46375838'); +$refund->setAmount($amount); + + +$capture = Capture::get('7BA08426L46375838', $apiContext); +try { + // (See bootstrap.php for more on `ApiContext`) + $captureRefund = $capture->refund($refund, $apiContext); +} catch (\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + + +
Refund Capture:
+
+ Back + + + diff --git a/sample/payments/VoidAuthorization.php b/sample/payments/VoidAuthorization.php new file mode 100644 index 0000000..dfeb051 --- /dev/null +++ b/sample/payments/VoidAuthorization.php @@ -0,0 +1,33 @@ +/void" + +require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Authorization; + +$authorization = Authorization::get('87U86133WD4359724', $apiContext); + + +// ### VoidAuthorization +// VoidAuthorization by posting to the APIService +// using a valid ApiContext (See bootstrap.php for more on `ApiContext`) +// The return object contains the status; +try { + $void = $authorization->void($apiContext); +} catch (\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + +
+ Void Authorization: +
+
toArray());?>
+ Back + +