GetTransactionDetails() public method

Service Call: GetTransactionDetails
public GetTransactionDetails ( GetTransactionDetailsReq $getTransactionDetailsReq, mixed $apiCredential = null ) : GetTransactionDetailsResponseType
$getTransactionDetailsReq PayPal\PayPalAPI\GetTransactionDetailsReq
$apiCredential mixed - Optional API credential - can either be a username configured in sdk_config.ini or a ICredential object created dynamically
return PayPal\PayPalAPI\GetTransactionDetailsResponseType
示例#1
0
 * The GetTransactionDetails API operation obtains information about a specific transaction.
*/
$transactionDetails = new GetTransactionDetailsRequestType();
/*
 * Unique identifier of a transaction.
*/
$transactionDetails->TransactionID = $_POST['transID'];
$request = new GetTransactionDetailsReq();
$request->GetTransactionDetailsRequest = $transactionDetails;
/*
 * 	 ## Creating service wrapper object
Creating service wrapper object to make API call and loading
Configuration::getAcctAndConfig() returns array that contains credential and config parameters
*/
$paypalService = new PayPalAPIInterfaceServiceService(Configuration::getAcctAndConfig());
try {
    /* wrap API method calls on the service object with a try catch */
    $transDetailsResponse = $paypalService->GetTransactionDetails($request);
} catch (Exception $ex) {
    include_once "../Error.php";
    exit;
}
if (isset($transDetailsResponse)) {
    echo "<table>";
    echo "<tr><td>Ack :</td><td><div id='Ack'>{$transDetailsResponse->Ack}</div> </td></tr>";
    echo "</table>";
    echo "<pre>";
    print_r($transDetailsResponse);
    echo "</pre>";
}
require_once '../Response.php';