Exemple #1
0
         if (Tools::getValue('CountryCode') == '') {
             $nCountryCode = null;
         } else {
             $nCountryCode = (int) Tools::getValue('CountryCode');
         }
     }
     /* email address */
     if (!Tools::isSubmit('EmailAddress')) {
         $szOutputMessage = addStringToStringList($szOutputMessage, 'Expected variable [EmailAddress] not received');
         $boErrorOccurred = true;
     } else {
         $szEmailAddress = Tools::getValue('EmailAddress');
     }
     /* phone number */
     if (!Tools::isSubmit('PhoneNumber')) {
         $szOutputMessage = addStringToStringList($szOutputMessage, 'Expected variable [PhoneNumber] not received');
         $boErrorOccurred = true;
     } else {
         $szPhoneNumber = Tools::getValue('PhoneNumber');
     }
 } catch (Exception $e) {
     $boErrorOccurred = true;
     $szOutputMessage = 'Error';
     if (Tools::isSubmit('Message')) {
         $szOutputMessage = Tools::getValue('Message');
     }
 }
 /* The nOutputProcessedOK should return 0 except if there has been an error talking to the gateway or updating the website order system.
 		Any other process status shown to the gateway will prompt the gateway to send an email to the merchant stating the error.
 		The customer will also be shown a message on the hosted payment form detailing the error and will not return to the merchants website.*/
 $nOutputProcessedOK = 0;
    if (!isset($_POST["State"])) {
        $szOutputMessage = addStringToStringList($szOutputMessage, "Expected variable [State] not received");
        $boErrorOccurred = true;
    } else {
        $szState = $_POST["State"];
    }
    // post code (not necessarily the same as value passed into payment form - as the customer can change it on the form)
    if (!isset($_POST["PostCode"])) {
        $szOutputMessage = addStringToStringList($szOutputMessage, "Expected variable [PostCode] not received");
        $boErrorOccurred = true;
    } else {
        $szPostCode = $_POST["PostCode"];
    }
    // country code (not necessarily the same as value passed into payment form - as the customer can change it on the form)
    if (!isset($_POST["CountryCode"])) {
        $szOutputMessage = addStringToStringList($szOutputMessage, "Expected variable [CountryCode] not received");
        $boErrorOccurred = true;
    } else {
        if ($_POST["CountryCode"] == "") {
            $nCountryCode = null;
        } else {
            $nCountryCode = intval($_POST["CountryCode"]);
        }
    }
} catch (Exception $e) {
    $boErrorOccurred = true;
    $szOutputMessage = "Error";
    if (!isset($_POST["Message"])) {
        $szOutputMessage = $_POST["Message"];
    }
}