6994
page-template,page-template-full_width,page-template-full_width-php,page,page-id-6994,theme-onyx,mkd-core-2.0.1,mikado-core-2.0.1,woocommerce-no-js,ajax_fade,page_not_loaded,,onyx child-child-ver-2.0.0,onyx-ver-3.2,vertical_menu_enabled, vertical_menu_left, vertical_menu_width_290,vertical_menu_background_opacity_over_slider vertical_menu_background_opacity_over_slider_on,smooth_scroll,side_menu_slide_from_right,onyx_mikado_set_woocommerce_body_class,wpb-js-composer js-comp-ver-6.0.3,vc_responsive

Online Bill Pay Test

For payment related concerns please call our office and talk to Terri Oleski at (814) 724-1252, extension 8570. We are happy to hear from you.

Please complete the form below and click the Submit Payment button to send the transaction. Thank you.

authCaptureTransaction 0.50

INV-12345
Product Description

456654 192.168.1.1

hostedPaymentIFrameCommunicatorUrl

hostedPaymentButtonOptions
{“text”: “Pay”}

hostedPaymentReturnOptions

hostedPaymentOrderOptions
{“show”: false}

hostedPaymentPaymentOptions
{“cardCodeRequired”: true}

hostedPaymentBillingAddressOptions
{“show”: true, “required”:true}

hostedPaymentShippingAddressOptions
{“show”: false, “required”:false}

hostedPaymentSecurityOptions
{“captcha”: false}

hostedPaymentStyleOptions
{“bgColor”: “green”}

hostedPaymentCustomerOptions
{“showEmail”: true, “requiredEmail”:true}

XML;
$xml = simplexml_load_string($xmlStr, ‘SimpleXMLElement’, LIBXML_NOWARNING);
// $xml = new SimpleXMLElement($xmlStr);
$xml->merchantAuthentication->addChild(‘name’, getenv(‘API_LOGIN_ID’));
$xml->merchantAuthentication->addChild(‘transactionKey’, getenv(‘TRANSACTION_KEY’));

$commUrl = json_encode(array(‘url’ => thisPageURL().”IFrameCommunicator.html” ), JSON_UNESCAPED_SLASHES);
$xml->hostedPaymentSettings->setting[0]->addChild(‘settingValue’, $commUrl);

$retUrl = json_encode(array(“showReceipt” => false , ‘url’ => thisPageURL().”return.html”, “urlText”=>”Continue to site”, “cancelUrl” => thisPageURL().”return.html”, “cancelUrlText” => “Cancel” ), JSON_UNESCAPED_SLASHES);
$xml->hostedPaymentSettings->setting[2]->addChild(‘settingValue’, $retUrl);

$url = “https://apitest.authorize.net/xml/v1/request.api”;

try { //setting the curl parameters.
$ch = curl_init();
if (false === $ch) {
throw new Exception(‘failed to initialize’);
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application/xml’));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml->asXML());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
// The following two curl SSL options are set to “false” for ease of development/debug purposes only.
// Any code used in production should either remove these lines or set them to the appropriate
// values to properly use secure connections for PCI-DSS compliance.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //for production, set value to true or 1
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //for production, set value to 2
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
//curl_setopt($ch, CURLOPT_PROXY, ‘userproxy.visa.com:80’);
$content = curl_exec($ch);
$content = str_replace(‘xmlns=”AnetApi/xml/v1/schema/AnetApiSchema.xsd”‘, ”, $content);

$hostedPaymentResponse = new SimpleXMLElement($content);
if (false === $content) {
throw new Exception(curl_error($ch), curl_errno($ch));
}
curl_close($ch);
} catch (Exception $e) {
trigger_error(sprintf(‘Curl failed with error #%d: %s’, $e->getCode(), $e->getMessage()), E_USER_ERROR);
}

function thisPageURL()
{
$pageURL = ‘http’;
if ($_SERVER[“HTTPS”] == “on”) {
$pageURL .= “s”;
}
$pageURL .= “://”;
if ($_SERVER[“SERVER_PORT”] != “80”) {
$pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$_SERVER[“REQUEST_URI”];
} else {
$pageURL .= $_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”];
}

$pageLocation = str_replace(‘index.php’, ”, $pageURL);

return $pageLocation;
}