<?php

$xml 
"

    <txn>
        <ssl_merchant_id>merchant_id</ssl_merchant_id>
        <ssl_user_id>user_id</ssl_user_id>
        <ssl_pin>pin</ssl_pin>
        <ssl_test_mode>true</ssl_test_mode>
        <ssl_transaction_type>ccsale</ssl_transaction_type>
        <ssl_card_number>4111111111111111</ssl_card_number>
        <ssl_exp_date>1215</ssl_exp_date>
        <ssl_amount>1.00</ssl_amount>
        <ssl_cvv2cvc2_indicator>1</ssl_cvv2cvc2_indicator>
        <ssl_cvv2cvc2>123</ssl_cvv2cvc2>
        <ssl_first_name>Test</ssl_first_name>
        <ssl_avs_address>888 Test St.</ssl_avs_address>
        <ssl_avs_zip>44454</ssl_avs_zip>
        <ssl_salestax>0.00</ssl_salestax>
    </txn>

"
;

$url "https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do";

$ch curl_init($url);
curl_setopt ($chCURLOPT_POSTtrue);
curl_setopt ($chCURLOPT_POSTFIELDS"xmldata=".$xml);
curl_setopt($chCURLOPT_SSL_VERIFYHOST0); //testing w/out SSL
curl_setopt($chCURLOPT_SSL_VERIFYPEER0); //testing w/out SSL
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_VERBOSE1);

$response curl_exec($ch);
$rxml simplexml_load_string($response);


$status $rxml->ssl_result_message;
$error $rxml->errorName."<br>".$rxml->errorMessage;

if (
$status == 'APPROVED') {
    echo 
"Transaction Approved"; die;
}

if (
$error && $error != '<br>') {
    echo 
$error; die;
}

?>