mySQLsafe($_GET['edit'])); $results = $db->select($query); $thisPage = currentPage(array("PayPal-Pro"=>0, "form"=>0)); ?>

PayPal Website Payments Pro Functionality

The functions below are specifically for orders purchased with PayPal Express Checkout without the need to login to your PayPal account.

Void Authorization ID: `".$authorizationID."`

Message to customer:

"; return $htmlOut; } function doCaptureForm ($authorizationID, $exampleAmount, $id, $TENDER, $remainder) { global $thisPage,$module; $maxAmount = sprintf("%.2f",$exampleAmount - $remainder); $htmlOut = "

Capture all or part of Authorization ID `".$authorizationID."`

Final Capture:

Capture Amount:

"; if($remainder>0) { $htmlOut .= "(Max: ".$maxAmount.") ".sprintf("%.2f",$remainder)." has already been captured from this transaction."; } $htmlOut .= "

Message to customer:

"; return $htmlOut; } function doReAuthForm ($originalAuthorizationID, $exampleAmount,$id, $TENDER) { global $thisPage; $htmlOut = "

Reauthorize ID `".$originalAuthorizationID."`

Reauthorization Amount:

"; return $htmlOut; } function doAuthForm ($originalAuthorizationID, $exampleAmount,$id, $TENDER) { global $thisPage; $htmlOut = "

Authorize ID `".$originalAuthorizationID."`

Authorization Amount:

"; return $htmlOut; } function doRefundForm ($transactionId,$exampleAmount,$id, $TENDER) { global $thisPage; $htmlOut = "

Refund all or partial amount of transaction ID `".$transactionId."`

Refund Amount:

Message to customer:

"; return $htmlOut; } function doFMF ($transactionID, $id) { global $thisPage; $htmlOut = "
Transaction ID: `".$transactionID."`

Accept Payment:
Deny Payment:

"; return $htmlOut; } ?>
Details Action
Time:
Action:
Transaction Id:
0) { ?>Amount:
Notes:
"; switch ($results[$i]['gateway']) { case "PayPal Website Payments Pro (Authorization)": case "PayPal Website Payments Pro (Order)": if($results[$i]['amount'] > $results[$i]['remainder']) { $links .= "Capture | "; $action = true; // reauth only possible if the initial auth is three days old or more $threeDaysAgo = time()-259200; if($results[$i]['time']<$threeDaysAgo) { $links .= "ReAuthorize | "; } if($results[$i]['gateway']=="PayPal Website Payments Pro (Order)") { $links .= "Authorize | "; } $links .= "Void | "; echo substr($links,0,-2).""; if($_GET['form']=="doCaptureForm".$results[$i]['id'] && !isset($_POST['order_capture'])) { echo "
"; echo doCaptureForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra'], $results[$i]['remainder']); } elseif($_GET['form']=="doVoidForm".$results[$i]['id'] && !isset($_POST['order_void'])) { echo "
"; echo doVoidForm ($results[$i]['trans_id'], $results[$i]['id'], $results[$i]['extra']); } elseif($_GET['form']=="doReAuthForm".$results[$i]['id'] && !isset($_POST['order_auth'])) { echo "
"; echo doReAuthForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } elseif($_GET['form']=="doAuthForm".$results[$i]['id'] && !isset($_POST['order_auth'])) { echo "
"; echo doAuthForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } } break; case "PayPal Website Payments Pro (Sale)": case "PayPal Website Payments Pro (DoCapture)": case "PayPal Website Payments Pro (FMF Accept)": if($results[$i]['amount'] > $results[$i]['remainder']) { echo "
Refund
"; if($_GET['form']=="doRefundForm".$results[$i]['id'] && !isset($_POST['order_refund'])) { echo "
"; echo doRefundForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } $action = true; } break; /* case "PayPal Website Payments Pro (DoRefund)": echo " "; break; */ case "PayPal Website Payments Pro (DoAuthorization)": $action = true; $links .= "Capture | "; $links .= "ReAuthorize | "; $links .= "Void | "; echo substr($links,0,-2).""; if($_GET['form']=="doCaptureForm".$results[$i]['id'] && !isset($_POST['order_capture'])) { echo "
"; echo doCaptureForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra'], $results[$i]['remainder']); } elseif($_GET['form']=="doVoidForm".$results[$i]['id'] && !isset($_POST['order_void'])) { echo "
"; echo doVoidForm ($results[$i]['trans_id'], $results[$i]['id'], $results[$i]['extra']); } elseif($_GET['form']=="doReAuthForm".$results[$i]['id'] && !isset($_POST['order_auth'])) { echo "
"; echo doReAuthForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } break; case "PayPal Website Payments Pro (FMF Review)": $action = true; $links .= "Accept / Deny Payment"; if($_GET['form']=="doFMF".$results[$i]['id'] && !isset($_POST['doFMF'])) { echo doFMF($results[$i]['trans_id'], $results[$i]['id']); } break; /* case "PayPal Website Payments Pro (DoVoid)": echo " "; break; */ } if($action==false) echo "
Complete
"; ?>