Remove credit card samples (#896)

* removed credit card payment samples
* update docs to reflect sample changes
* update readme to recommend braintree for direct card payments
This commit is contained in:
Randy
2017-08-03 10:32:26 -05:00
committed by GitHub
parent e3aadb48c2
commit 14e814d74b
23 changed files with 81 additions and 756 deletions

View File

@@ -4,7 +4,7 @@
// process a refund on a Captured transaction.
// API used: /v1/payments/capture/{<captureID>}/refund
/** @var Capture $capture */
$capture = require 'AuthorizationCapture.php';
use PayPal\Api\Capture;
use PayPal\Api\Refund;
@@ -14,15 +14,22 @@ use PayPal\Api\RefundRequest;
// Create a refund object indicating
// refund amount and call the refund method
$refundRequest = new RefundRequest();
$refundRequest->setAmount($amt);
// Replace $captureId with any static Id you might already have.
$captureId = "<your authorization id here>";
try {
// Create a new apiContext object so we send a new
// PayPal-Request-Id (idempotency) header for this resource
$apiContext = getApiContext($clientId, $clientSecret);
// ### Retrieve Capture details
$capture = Capture::get($captureId, $apiContext);
// ### Refund the Capture
$captureRefund = $capture->refundCapturedPayment($refundRequest, $apiContext);
} catch (Exception $ex) {
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError("Refund Capture", "Capture", null, $refundRequest, $ex);