0
返品ページのコードは次のとおりです。それは正常に実行され、正常に完了します。私は、ページが成功したので、$ requestParamsの変数がページ上で利用可能であると仮定しています。あなただけのデータは、独自の参照あなたは$ transactionResponseで行った同じことを行うことができますのためにダンプを参照する必要がある場合は$ requestParams返品ページにPaypal変数を表示する方法
<?php
require_once '../library/DPayPal.php'; //Import library
$token=$_GET["token"];//Returned by paypal, you can save this in SESSION too
$paypal = new DPaypal();
$requestParams = array('TOKEN' => $token);
$response = $paypal->GetExpressCheckoutDetails($requestParams);
$payerId=$response["PAYERID"];//Payer id returned by paypal
//Create request for DoExpressCheckoutPayment
$requestParams=array(
"TOKEN"=>$token,
"PAYERID"=>$payerId,
"PAYMENTREQUEST_0_AMT"=>"20",//Payment amount. This value should be sum of of item values, if there are more items in order
"PAYMENTREQUEST_0_CURRENCYCODE"=>"USD",//Payment currency
"PAYMENTREQUEST_0_ITEMAMT"=>"20"//Item amount
);
$transactionResponse=$paypal->DoExpressCheckoutPayment($requestParams);//Execute transaction
if(is_array($transactionResponse) && $transactionResponse["ACK"]=="Success"){//Payment was successfull
echo "Successfull";
// Displays Successfull, but NONE of the following commands display any results
print_r($transactionResponse["PAYMENTREQUEST_0_CURRENCYCODE"]);
echo $transactionResponse["PAYMENTREQUEST_0_CURRENCYCODE"];
print_r($transactionResponse);
echo $transactionResponse;
}
else{
echo "Failed";
}
?>
'$ transactionResponse'と同じように' print_r($ requestParams); 'が成功したためではなく、このページで定義したので利用可能です。 – AbraCadaver
素晴らしいです。ありがとうAbraCadaver –