2015-11-28 18 views
0

我有一個現有的這個類處理訂閱信用卡的實現,但我現在需要添加設施接受eche支付,但我不確定如何更改這部分驗證碼:使用約翰孔德的AuthnetXML類Auth.net eCheck實現

 'payment' => array(
      'creditCard' => array(
       'cardNumber' => '4111111111111111', 
       'expirationDate' => '2016-08' 
      ) 
     ), 

我已經拿出從引用AIM指南PDF以下和AIM指南XML的PDF

 'payment' => array(
      'bankAccount' => array( // x_method equivalent ? 
       'routingNumber' => '', // x_bank_aba_code equivalent ? 
       'accountNumber' => '', // x_bank_acct_num equivalent ? 
       'nameOnAccount' => '', // x_bank_acct_name equivalent ? 
       'bankName' => '',  // x_bank_name equivalent ? 
       'echeckType' => 'WEB' // x_echeck_type equivalent 
       /* 
       x_bank_acct_type has no equivalent ? 
       */ 
      ) 
     ), 

但似乎是必填字段之間存在一些差異?

在我開始之前的任何指針將不勝感激。

回答

3

望着Authorize.Net's documentation這應該工作:

'payment' => array(
     'bankAccount' => array(  
      'accountType' => '', // 'checking' 
      'routingNumber' => '', 
      'accountNumber' => '', 
      'nameOnAccount' => '' 
     ) 
    ), 
+0

謝謝約翰,非常感謝我會修改我的測試文件,並給它一個去。 –

1

從約翰的回答下面這個是我用來解決這個任何人通過谷歌搜索找到這個完整代碼:

$xml->ARBCreateSubscriptionRequest(array(
'subscription' => array(
    'name' => 'SubscriptionName', 
    'paymentSchedule' => array(
     'interval' => array(
      'length' => '1', 
      'unit' => 'months' 
     ), 
     'startDate' => date('Y-m-d', time()), // Format: YYYY-MM-DD 
     'totalOccurrences' => '9999' // To submit a subscription with no end date (an ongoing subscription), this field must be submitted with a value of 9999 
    ), 
    'amount' => $eCart1->GrandTotal(), // total monthly subscription 
    'payment' => array(
     'bankAccount' => array( 
      'accountType'  => ((isset($_POST["accountType"]))?$_POST["accountType"]:""),  // options available are checking or businessChecking in this instance 
      'routingNumber' => ((isset($_POST["routingNumber"]))?$_POST["routingNumber"]:""),  
      'accountNumber' => ((isset($_POST["accountNumber"]))?$_POST["accountNumber"]:""), 
      'nameOnAccount' => ((isset($_POST["nameOnAccount"]))?$_POST["nameOnAccount"]:""), 
      'echeckType'  => ((isset($_POST["echeckType"]))?$_POST["echeckType"]:"")   // if businessChecking is chosen then 'CCD' else 'WEB' 
     ) 
    ), 
    'customer' => array(
     'id' => "'".$_SESSION['clientID']."'", 
     'email' => "'".((isset($_POST["email"]))?$_POST["email"]:"")."'" 
    ), 
    'billTo' => array(
     'firstName' => "'".((isset($_POST["firstname"]))?$_POST["firstname"]:"")."'", 
     'lastName' => "'".((isset($_POST["lastname"]))?$_POST["lastname"]:"")."'", 
     'company' => "'".((isset($_POST["company"]))?$_POST["company"]:"")."'", 
     'address' => "'".((isset($_POST["street1"]))?$_POST["street1"]:"")."'", 
     'city' => "'".((isset($_POST["city"]))?$_POST["city"]:"")."'", 
     'state' => "'".((isset($_POST["state_province"]))?$_POST["state_province"]:"")."'", 
     'zip' => "'".((isset($_POST["postcode"]))?$_POST["postcode"]:"")."'"    
    ) 
) 

) );