payment processing system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to send payment information to the Chase Payment gateway. I need to 
send the XML data using UTF-8 encoding. But I am having an error 20400

Here is the sample code:


--------------------------------------------------------------------------------------------------------------------------------------------------------------------

 
$transaction = array  (
                                     'type' => 'sale',
                                     'username' => 'RETAILCA22',
                                     'password' => 'RETAILPA55',
                                     'bin' => '000002',
                                     'merchant_id' => '700000208888',
                                     'terminal_id' => '001',
                                     'ccnumber' => $vals['cc_number'],
                                     'ccexp' => $expires,
                                     'cvv' => $vals['cvv_number'],
                                     'amount' => number_format 
($vals['item_price'], 2, '.',  ''),
                         );
                        
$url =  'https://orbitalvar1.paymentech.net';
$result =  chase_payment($url, $transaction);
 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

function chase_payment($url, $payment_info )
{
    //$url = "https://orbitalvar1.paymentech.net";;

    $post_string = '<?xml version="1.0" encoding="UTF-8"?>
    <Request>
        <NewOrder>
            
<OrbitalConnectionUsername>'.$payment_info['username'].'</OrbitalConnectionUsername>

            
<OrbitalConnectionPassword>'.$payment_info['password'].'</OrbitalConnectionPassword>

            <IndustryType>'.$payment_info[''].'</IndustryType>
            <MessageType>'.$payment_info[''].'</MessageType>
            <BIN>'.$payment_info['bin'].'</BIN>
            <MerchantID>'.$payment_info['merchant_id'].'</MerchantID>
            <TerminalID>'.$payment_info['terminal_id'].'</TerminalID>
            <CardBrand>'.$payment_info[''].'</CardBrand>
            <AccountNum>'.$payment_info['ccnumber'].'</AccountNum>
            <Exp>'.$payment_info['ccexp'].'</Exp>
            <CurrencyCode>'.$payment_info[''].'</CurrencyCode>
            <CurrencyExponent>'.$payment_info[''].'</CurrencyExponent>
            <AVSzip>'.$payment_info[''].'</AVSzip>
            <AVSaddress1>'.$payment_info[''].'</AVSaddress1>
            <AVSaddress2>'.$payment_info[''].'</AVSaddress2>
            <AVScity>'.$payment_info[''].'</AVScity>
            <AVSstate>'.$payment_info[''].'</AVSstate>
            <AVSphoneNum>'.$payment_info[''].'</AVSphoneNum>
            <OrderID>'.$payment_info[''].'</OrderID>
            <Amount>'.$payment_info['amount'].'</Amount>
        </NewOrder>
    </Request>';
    

    $header  = "POST/AUTHORIZE HTTP/1.0 \r\n";
    $header .= "Content-type: application/PTI47 \r\n";
    $header .= "Content-length: ".strlen($post_string)." \r\n";
    $header .= "Content-transfer-encoding: text \r\n";
    
    $header .= "Request-number: 1 \r\n";
    $header .= "Document-type: Request \r\n";
    
    $header .= "Connection: close \r\n\r\n"; 
    $header .= $post_string;

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    
    curl_setopt($ch, CURLOPT_TIMEOUT, 4);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);

    $data = curl_exec($ch); 

    if(curl_errno($ch))
        print curl_error($ch);
    else
        curl_close($ch);


    return $data;
}
---------------------------------------------------------------------------------------------------------------------------------------------


Please help me. I will appreciate your help. 

Tariq


[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux