+ Start a Discussion
Vamshi KrishnaVamshi Krishna 

Conversion of PHP code into APEX

I have and PHP code for integrating with Pay Pal Payflow. Anyone who can give me its APEX alternative or convert the code into apex. Iwill be thankful.

global $environment;
$environment = "sandbox";


echo '<p>Payflow direct credit card processing - basic demo</p>';
if(empty($_POST)) {

<form method="post">
  <br/>Partner: <input type="text" name="PARTNER" value="PayPal"/>
  <br/>Vendor: <input type="text" name="VENDOR" value="goofy2000us"/>
  <br/>User: <input type="text" name="USER" value="PayFlowPro"/>
  <br/>Password: <input type="text" name="PWD" value="test1234"/>
  <br/>Amount:<input type="text" name="AMT" value="1.23"/>
  <br/>Credit card:<input type="text" name="CREDITCARD" value="5105105105105100"/>
  <br/>Expiration date: <input type="text" name="EXPDATE" value="1220"/>
  <br/>Card security code: <input type="text" name="CVV2" value="123"/>
  <br/>CURRENCY: <input type="text" name="CURRENCY" value="USD"/>
  <br/>First name: <input type="text" name="BILLTOFIRSTNAME" value="John"/>
  <br/>Last name: <input type="text" name="BILLTOLASTNAME" value="Doe"/>
  <br/>Address: <input type="text" name="BILLTOSTREET" value="123 Main St."/>
  <br/>City: <input type="text" name="BILLTOCITY" value="San Jose"/>
  <br/>State: <input type="text" name="BILLTOSTATE" value="CA"/>
  <br/>Zip: <input type="text" name="BILLTOZIP" value="95101"/>
  <br/>Country: <input type="text" name="BILLTOCOUNTRY" value="US"/>
  <br/>Silent Tran: <input type="text" name="SILENTTRAN" value="TRUE"/>
  <br/>Secure ID: <input type="text" name="createsecuretoken" value="Y"/>
  <br/><input type="submit" value="Pay Now"/>

} else {
  $request = array(
    "VENDOR" => $_POST['VENDOR'],
    "USER" => $_POST['USER'],
    "PWD" => $_POST['PWD'], 
    "TENDER" => "C",
    "TRXTYPE" => "A",
    "AMT" => $_POST['AMT'],

    "CVV2" => $_POST['CVV2'],



  //Run request and get the response
  $response = run_payflow_call($request);

  pre($request, "Request");
  pre($response, "Response");