I need to integrate the Authorize.net (Echeck.net) payment method for my magento site.I have googled but i dont find Please suggest if there is any extensions for the payment method or else can we achieve this by coding.I am using magento 1.7.0.2.

Thanks in Advance!

有帮助吗?

解决方案

The Official Beta release from authorize.net is available on Magento market(Magento Connect). This module is tested only in sandbox and currently in Beta status and probably compateble with 1.4 and 1.6. have not tried with 1.7 yet. you can try it if works. Please find the module at following link

http://www.magentocommerce.com/magento-connect/echeck-payment-method-authorize-net.html

If you need to customise the extention feel free to contact at contact@sgssandhu.com or http://oxosolutions.com/ Thanks

其他提示

Hi here is working example of ECHECK through curl request & parsing of Response with delimiter:

public function curlProcessECHECK(){


$query = "";
// Login Information
$query .= "x_login=" . urlencode($this->credentials->username) . "&";
$query .= "x_tran_key=" . urlencode($this->credentials->password) . "&";
$query .= "x_version=" . "3.1" . "&";
$query .= "x_delim_data=" . "TRUE" . "&";
$query .= "x_delim_char=" . "|" . "&";
$query .= "x_relay_response=" . "FALSE" . "&";
$query .= "x_amount=" . urlencode(number_format($data['orderTotalAmt'], 2, ".", "")) . "&";

// ECHECk payments..... code to check ECHECK request
switch ($data['bank_acct_type'])
{
    case 'checking':
    $echecktype = 'PPD';
    break;
    case 'businessChecking':
    $echecktype = 'CCD';
    break;
    case 'savings':
    $echecktype = 'PPD';
    break;
    default:
    $echecktype = 'PPD';
    break;
}
$query .= "x_method=ECHECK&";

$query .= "x_bank_name=" . urlencode($data['bank_name']) . "&";
$query .= "x_echeck_type=" . urlencode($echecktype) . "&";  //CCD, PPD, TEL ---[ARC, BOC]- bank_check_number ll be required, [WEB] recurring_billing ll be required.
$query .= "x_bank_acct_type=" . urlencode($data['bank_acct_type']) . "&";
$query .= "x_bank_acct_num=" . urlencode($data['bank_acct_num']) . "&";
$query .= "x_bank_aba_code=" . urlencode($data['bank_aba_code']) . "&";  // aba code should be valid get from google US based banks
$query .= "x_bank_acct_name=" . urlencode($data['bank_acct_name']) . "&";
$query .= "x_description=" . (isset($data['orderDescription']) ? urlencode($data['orderDescription']) : "") . "&";
$query .= "x_first_name=" . (isset($data['billingFirstName']) ? urlencode($data['billingFirstName']) : $data['firstName']) . "&";
$query .= "x_last_name=" . (isset($data['billingLastName']) ? urlencode($data['billingLastName']) : $data['lastName']) . "&";
$query .= "x_address=" . (isset($data['billingAddress1']) ? urlencode($data['billingAddress1']) : "") . "&";
$query .= "x_state=" . (isset($data['billingState']) ? urlencode($data['billingState']) : "") . "&";
$query .= "x_zip=" . (isset($data['billingZip']) ? urlencode($data['billingZip']) : "") . "&";

if($this->env == 1) {
$query .= "x_test_request=TRUE&";
}

$query .= "x_type=AUTH_CAPTURE";

$output = array();


$url = 'https://test.authorize.net/gateway/transact.dll';// TestMode
$ch_response = null;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
//   curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
$ch_response = curl_exec($ch);


// Check that a connection was made
if (curl_error($ch)) {
    // If it wasn't...
    $output['status'] = "Failure";
    $output['response']['code'] = '-1';
    $output['data'] = null;
    $output['response']['responseMsg'] = curl_error($ch);
    $output['response']['gateway_response_code'] ='000';
    $output['response']['responsetext']= " No response from gateway";
    $output['response']['transactionid'] = '';
    $output['response']['init'] ="no";
    $output['response']['response_code']='000';
} else {
    $output['status'] = 'Success';
    $output['data'] = $ch_response;

    $output = $this->processResponse($output);
}

echo '<pre>';print_r($output);die;

}

Now parse the result

public function processResponse($output){

$response_array=$output;
if ($response_array) {

    // Split Array

    $encap_char = "|";
    $response_array = explode($encap_char, $response_array['data']);
    //echo"<pre>";print_r($response_array);die;
    /**
    * If AuthorizeNet doesn't return a delimited response.
    */
    if (count($response_array) < 10) {
        $approved = false;
        $error = true;
        $error_message = "Unrecognized response from AuthorizeNet: ";
        return;
    }

    // Set all fields
    $response_code = $response_array[0];
    $response_subcode = $response_array[1];
    $response_reason_code = $response_array[2];
    $response_reason_text = $response_array[3];
    $authorization_code = $response_array[4];
    $avs_response = $response_array[5];
    $transaction_id = $response_array[6];
    $invoice_number = $response_array[7];
    $description = $response_array[8];
    $amount = $response_array[9];
    $method = $response_array[10];
    $transaction_type = $response_array[11];
    $customer_id = $response_array[12];
    $first_name = $response_array[13];
    $last_name = $response_array[14];
    $company = $response_array[15];
    $address = $response_array[16];
    $city = $response_array[17];
    $state = $response_array[18];
    $zip_code = $response_array[19];
    $country = $response_array[20];
    $phone = $response_array[21];
    $fax = $response_array[22];
    $email_address = $response_array[23];
    $ship_to_first_name = $response_array[24];
    $ship_to_last_name = $response_array[25];
    $ship_to_company = $response_array[26];
    $ship_to_address = $response_array[27];
    $ship_to_city = $response_array[28];
    $ship_to_state = $response_array[29];
    $ship_to_zip_code = $response_array[30];
    $ship_to_country = $response_array[31];
    $tax = $response_array[32];
    $duty = $response_array[33];
    $freight = $response_array[34];
    $tax_exempt = $response_array[35];
    $purchase_order_number = $response_array[36];
    $md5_hash = $response_array[37];
    $card_code_response = $response_array[38];
    $cavv_response = $response_array[39];
    $account_number = $response_array[50];
    $card_type = $response_array[51];
    $split_tender_id = $response_array[52];
    $requested_amount = $response_array[53];
    $balance_on_card = $response_array[54];

    //                    $approved = ($response_code == self::APPROVED);
    //                    $declined = ($response_code == self::DECLINED);
    //                    $error    = ($response_code == self::ERROR);
    //                    $held     = ($response_code == self::HELD);
    $approved = "";
    $declined = "";
    $error = "";
    $held = "";
    if ($response_code == 1) {
        $result['response']['response_code'] = 100;
        $result['response']['gateway_response_code'] = 100;
        $result['response']['responsetext'] = "Success";
        $result['status'] = 'success';

    } elseif ($response_code == 2) {
        $result['response']['response_code'] = 800;
        $result['response']['gateway_response_code'] = 800;
        $result['response']['responsetext'] = "Declined";
        $result['status'] = $response_reason_text;
    } else {
        $result['response']['response_code'] = $response_code;
        $result['response']['gateway_response_code'] = $response_code;
        $result['response']['responsetext'] = $response_reason_text;
        $result['status'] = $response_reason_text;
    }

    $result['method'] = $method;
    $result['md5_hash'] = $md5_hash;
    $result['card_type'] = $card_type;
    $result['account_number'] = $account_number;
    $result['response']['transactionid'] = $transaction_id;
    $result['response']['processor_id'] = "";
    $result['response']['cvvresponse'] = $cavv_response;
    $result['response']['avsresponse'] = $avs_response;
    $result['response']['authcode'] = $authorization_code;
    $result['response']['type'] = "Sale";
    $result['response']['init'] = "no";


    return $result;

}

}

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top