GetExpressCheckoutDetailsRequest = $getExpressCheckoutDetailsRequest;
$paypalService = new PayPalAPIInterfaceServiceService();
$getECResponse = $paypalService->GetExpressCheckoutDetails($getExpressCheckoutReq);
//--------------------------------------------------------------------
$orderTotal = new BasicAmountType();
$orderTotal->currencyID = $getECResponse->GetExpressCheckoutDetailsResponseDetails->PaymentDetails[0]->OrderTotal->currencyID;
$orderTotal->value = $getECResponse->GetExpressCheckoutDetailsResponseDetails->PaymentDetails[0]->OrderTotal->value;
$itemDetails = new PaymentDetailsItemType();
$itemDetails->Name = 'sample item';
$itemDetails->Amount = $orderTotal;
$itemDetails->Quantity = '1';
$itemDetails->ItemCategory = 'Digital';
$PaymentDetails= new PaymentDetailsType();
$PaymentDetails->PaymentDetailsItem[0] = $itemDetails;
//$PaymentDetails->ShipToAddress = $address;
$PaymentDetails->OrderTotal = $orderTotal;
$PaymentDetails->PaymentAction = 'Sale';
$PaymentDetails->ItemTotal = $orderTotal;
$DoECRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType();
$DoECRequestDetails->PayerID = $payerId;
$DoECRequestDetails->Token = $token;
$DoECRequestDetails->PaymentDetails[0] = $PaymentDetails;
$DoECRequest = new DoExpressCheckoutPaymentRequestType();
$DoECRequest->DoExpressCheckoutPaymentRequestDetails = $DoECRequestDetails;
$DoECReq = new DoExpressCheckoutPaymentReq();
$DoECReq->DoExpressCheckoutPaymentRequest = $DoECRequest;
$paypalService = new PayPalAPIInterfaceServiceService();
$DoECResponse = $paypalService->DoExpressCheckoutPayment($DoECReq);
//var_dump($DoECResponse);
if($DoECResponse->Ack == 'Success')
{
?>