"); // use this alternative way for wordpress } else { // An error occurred displayError($resArray); die; } } // ============== Second pass =================== elseif (! isset($_GET['subaction'])) { /* At this point, the buyer has completed in authorizing payment at PayPal. The script will now call PayPal with the details of the authorization, incuding any shipping information of the buyer. Remember, the authorization is not a completed transaction at this state - the buyer still needs an additional step to finalize the transaction */ $token =urlencode( $_REQUEST['token']); /* Build a second API request to PayPal, using the token as the ID to get the details on the payment authorization */ $nvpstr="&TOKEN=".$token; /* Make the API call and store the results in an array. If the call was a success, show the authorization details, and provide an action to complete the payment. If failed, show the error */ $resArray=hash_call("GetExpressCheckoutDetails",$nvpstr); $_SESSION['reshash']=$resArray; $ack = strtoupper($resArray["ACK"]); if($ack=="SUCCESS") { /* Display the API response back to the browser . If the response from PayPal was a success, display the response parameters */ $_SESSION['token']=$_REQUEST['token']; $_SESSION['payer_id'] = $_REQUEST['PayerID']; $_SESSION['totalAmount']=$_REQUEST['totalAmount']; $_SESSION['currCodeType']=$_REQUEST['currencyCodeType']; $_SESSION['paymentType']=$_REQUEST['paymentType']; $resArray=$_SESSION['reshash']; $_SESSION['customer'] = $resArray['SHIPTONAME']; ?>

| localizationDomain); ?>: | =$_REQUEST['currencyCodeType'] ?> =$_REQUEST['totalAmount']?> |
| localizationDomain); ?>: | = $resArray['SHIPTONAME']; ?> |
| localizationDomain); ?>: | |
| localizationDomain); ?>: | =$resArray['SHIPTOSTREET'] ?> =$resArray['SHIPTOSTREET2'] ?> |
| localizationDomain); ?>: | =$resArray['SHIPTOCITY'] ?> |
| localizationDomain); ?>: | =$resArray['SHIPTOZIP'] ?> |
| localizationDomain); ?>: | =$resArray['SHIPTOCOUNTRYNAME'] ?> |
| localizationDomain); ?> | |
| Ack: | = $resArray['ACK'] ?> |
| Correlation ID: | = $resArray['CORRELATIONID'] ?> |
| Version: | = $resArray['VERSION']?> |
| Error Number: | = $errorCode ?> |
| Short Message: | = $shortMessage ?> |
| Long Message: | = $longMessage ?> |