Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9272593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:54:31+00:00 2026-06-18T15:54:31+00:00

I’m trying to create a custom payment gateway the redirects to Chase paymentech DPP.

  • 0

I’m trying to create a custom payment gateway the redirects to Chase paymentech DPP. I have the module working up until I reach the gateway when I receieve this error message:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="urn:ws.paymentech.net/PaymentechGateway">
<SOAP-ENV:Body id="_0">
<SOAP-ENV:Fault SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<faultcode>SOAP-ENV:VersionMismatch</faultcode>
<faultstring>SOAP version mismatch or invalid SOAP message</faultstring>
<SOAP-ENV:Code/>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I’m not sure if its to do with formatting the form to post in the correct format i.e XML so would like to ask for some advice on how to post values in the correct format

This is my form named redirect.phtml which redirects to the payment gateway.

<?php 
    $session = Mage::getSingleton('checkout/session');
    $orderIncrementId = $session->getLastRealOrderId();
    $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
    $billingaddress = $order->getBillingAddress();
    $shippingaddress = $order->getShippingAddress();
    $currencyDesc = Mage::app()->getStore()->getCurrentCurrencyCode();
    $totals = number_format($order->getGrandTotal(), 2, '.', ''); 
    $address = $billingaddress->getStreet();
    $address1 = $shippingaddress->getStreet();
    $data = array(
    'api_username' => trim(Mage::getStoreConfig('payment/redirect/api_username')),
    'api_password' => trim(Mage::getStoreConfig('payment/redirect/api_password')),
    'Merchant_ID' => trim(Mage::getStoreConfig('payment/redirect/Merchant_ID')),
    'Terminal_ID' => trim(Mage::getStoreConfig('payment/redirect/Terminal_ID')),
    'BIN_Number' => trim(Mage::getStoreConfig('payment/redirect/BIN_Number')),
    'Amount' => $totals,
    'billing_cust_name' =>$order->getCustomerFirstname(), 
    'billing_last_name'=>$order->getCustomerLastname(),
    'billing_cust_tel_No' => $billingaddress->getTelephone(),
    'billing_cust_email'=>$order->getCustomerEmail(),
    'billing_cust_address'=>$address[0] . ' '.$address[1],
    'billing_cust_city'=>$billingaddress->getCity(),
    'billing_cust_country'=>$billingaddress->getCountryId(),
    'billing_cust_state'=>$billingaddress->getRegion(),
    'billing_cust_zip' =>$billingaddress->getPostcode(),
    'delivery_cust_name' =>$shippingaddress->getCustomerFirstname(),
    'delivery_last_name'=>$shippingaddress->getCustomerLastname(),
    'delivery_cust_tel_No' => $shippingaddress->getTelephone(),
    'delivery_cust_email'=>$shippingaddress->getCustomerEmail(),
    'delivery_cust_address'=>$address1[0] . ' '.$address1[1],
    'delivery_cust_city'=>$shippingaddress->getCity(),
    'delivery_cust_country'=>$shippingaddress->getCountryId(),
    'delivery_cust_state'=>$shippingaddress->getRegion(),
    'delivery_cust_zip' =>$shippingaddress->getPostcode(),
    'Order_Id' => $order->getIncrementId(),
    'TxnType' => 'A',
    'actionID' => 'TXN',
    'Currency' => 'GBP',
    );

?>
<form action="https://wsvar.paymentech.net/PaymentechGateway" method="post" id="chase">
    <?php foreach($data as $key => $value): ?>
        <input type='hidden' name='<?php echo $key?>' value='<?php echo $value;?>' />
    <?php endforeach;?>
    <input type="submit" class="btn btn-success btn-large" value='Complete my order!'/> 
</form>
<?php echo $this->__('If Page Doesn\'t Redirect In 5 Sectonds, Please press Buy button');?>
<script type="text/javascript">
    function myfunc () {
    var frm = document.getElementById("chase");
    frm.submit();
    }
    window.onload = myfunc;
</script>

Standard.php

<?php
class Custom_Gateway_Model_Standard extends Mage_Payment_Model_Method_Abstract {
    protected $_code = 'chase';
    protected $_isInitializeNeeded      = true;
    protected $_canUseInternal          = true;
    protected $_canUseForMultishipping  = false;

    public function getOrderPlaceRedirectUrl() {
    return Mage::getUrl('chase/payment/redirect', array('_secure' => true));
    }

    //create xml and send info to gateway
    private function callApi(Varien_Object $payment, $amount,$type){

    //call your authorize api here, incase of error throw exception.
    //only example code written below to show flow of code

    $order = $payment->getOrder();
    $types = Mage::getSingleton('payment/config')->getCcTypes();
    if (isset($types[$payment->getCcType()])) {
    $type = $types[$payment->getCcType()];
    }
    $billingaddress = $order->getBillingAddress();
    $totals = number_format($amount, 2, '.', '');
    $orderId = $order->getIncrementId();
    $currencyDesc = $order->getBaseCurrencyCode();

    $url = $this->getConfigData('gateway_url');
    $fields = array(
            'api_username'=> $this->getConfigData('api_username'),
            'api_password'=> $this->getConfigData('api_password'),
            'Merchant_ID'=> $this->getConfigData('Merchant_ID'),
            'Terminal_ID'=> $this->getConfigData('Terminal_ID'),
            'BIN_Number'=> $this->getConfigData('BIN_Number'),
            'customer_firstname'=> $billingaddress->getData('firstname'),
            'customer_lastname'=> $billingaddress->getData('lastname'),
            'customer_phone'=> $billingaddress->getData('telephone'),
            'customer_email'=> $billingaddress->getData('email'),
            'customer_ipaddress'=> $_SERVER['REMOTE_ADDR'],
            'bill_firstname'=> $billingaddress->getData('firstname'),
            'bill_lastname'=> $billingaddress->getData('lastname'),
            'Bill_address1'=> $billingaddress->getData('street'),
            'bill_city'=> $billingaddress->getData('city'),
            'bill_country'=> $billingaddress->getData('country_id'),
            'bill_state'=> $billingaddress->getData('region'),
            'bill_zip'=> $billingaddress->getData('postcode'),
            'customer_cc_expmo'=> $payment->getCcExpMonth(),
            'customer_cc_expyr'=> $payment->getCcExpYear(),
            'customer_cc_number'=> $payment->getCcNumber(),
            'customer_cc_type'=> strtoupper($type),
            'customer_cc_cvc'=> $payment->getCcCid(),
            'merchant_ref_number'=> $order->getIncrementId(),
            'currencydesc'=>$currencyDesc,
            'amount'=>$totals
    );

    $fields_string="";
    foreach($fields as $key=>$value) {
    $fields_string .= $key.'='.$value.'&';
    }
    $fields_string = substr($fields_string,0,-1);
    //open connection
    $ch = curl_init($url);
    //set the url, number of POST vars, POST data
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_POST,1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
    curl_setopt($ch, CURLOPT_HEADER ,0); // DO NOT RETURN HTTP HEADERS
    curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120); // Timeout on connect (2 minutes)
    //execute post
    $result = curl_exec($ch);
    curl_close($ch);

    return array('status'=>1,'transaction_id' => time() , 'fraud' => rand(0,1));
  }
}
?>

Authorize.php

 protected function _getTransactionDetails($transactionId)
    {
        $requestBody = sprintf(
            '<?xml version="1.0" encoding="utf-8"?>'
            . '<getTransactionDetailsRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">'
            . '<merchantAuthentication><name>%s</name><transactionKey>%s</transactionKey></merchantAuthentication>'
            . '<transId>%s</transId>'
            . '</getTransactionDetailsRequest>',
            $this->getConfigData('login'),
            $this->getConfigData('trans_key'),
            $transactionId
        );

        $client = new Varien_Http_Client();
        $uri = $this->getConfigData('cgi_url_td');
        $client->setUri($uri ? $uri : self::CGI_URL_TD);
        $client->setConfig(array('timeout'=>45));
        $client->setHeaders(array('Content-Type: text/xml'));
        $client->setMethod(Zend_Http_Client::POST);
        $client->setRawData($requestBody);

        $debugData = array('request' => $requestBody);

        try {
            $responseBody = $client->request()->getBody();
            $debugData['result'] = $responseBody;
            $this->_debug($debugData);
            libxml_use_internal_errors(true);
            $responseXmlDocument = new Varien_Simplexml_Element($responseBody);
            libxml_use_internal_errors(false);
        } catch (Exception $e) {
            Mage::throwException(Mage::helper('paygate')->__('Payment updating error.'));
        }

        $response = new Varien_Object;
        $response
            ->setResponseCode((string)$responseXmlDocument->transaction->responseCode)
            ->setResponseReasonCode((string)$responseXmlDocument->transaction->responseReasonCode)
            ->setTransactionStatus((string)$responseXmlDocument->transaction->transactionStatus)
        ;
        return $response;
    }



Thanks in advance
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:54:32+00:00Added an answer on June 18, 2026 at 3:54 pm

    To my knowledge you should only use one of these method (and not both), because they represent two different type of gateway.

    public function getOrderPlaceRedirectUrl() {
    return Mage::getUrl('chase/payment/redirect', array('_secure' => true));
    }
    
    //create xml and send info to gateway
    private function callApi(Varien_Object $payment, $amount,$type){
    

    What I would recommend is start over (i am not sure what ‘Standard.php’ and ‘Authorize.php’ does) using this example http://www.excellencemagentoblog.com/magento-create-custom-payment-method-api-based and make changes to callApi

    Also take a look of

    protected function _postRequest(Varien_Object $request)

    protected function _buildRequest(Varien_Object $payment)

    In

    /app/code/core/Mage/Paygate/Model/Authorizenet.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.