2017-01-12 64 views
0

這是我的代碼。集成定期付款表格與我的網關(wordpress)

我被困在試圖找出如何鏈接到我的支付網關,並標記一切。以及收集所有這些信息..?任何接受者的任何幫助非常感激。

我的主要問題是連接到我的網關。

Bascially剛剛給本指南的所有問題:http://redfinpos.com/wp-content/uploads/RedFin-Developer-Manual-V.2.07.0415-a.pdf 剛剛更新代碼,包括AJAX

<script 
 
    src="https://code.jquery.com/jquery-3.1.1.js" 
 
    integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA=" 
 
    crossorigin="anonymous"></script> 
 

 
<script type="text/javascript"> 
 
    function startPayment(){ 
 
    var paymentData = { 
 
     username : $('#Username').val(), 
 
     password : $('#Password').val(), 
 
     vendor : $('#Vendor').val(), 
 
     customerID: $('#CustomerID').val(), 
 
     contractID: $('#ContractID').val(), 
 
     billAmt : $('#BillAmt').val(), 
 
     taxAmt : $('#TaxAmt').val(), 
 
     totalAmt : $('#TotalAmt').val(), 
 
     startDate : $('#StartDate').val(), 
 
     billingPeriod:$('#BillingPeriod').val(), 
 
     billingInterval:$('#BillingInterval').val(), 
 
     ccAccountNum:$('#AaAccountNum').val(), 
 
     ccExpDate : $('#CcExpDate').val(), 
 
     ccNameOnCard:$('#CcNameOnCard').val(), 
 
     ccStreet :$('#CcStreet').val(), 
 
     ccZip  :$('#CcZip').val() 
 

 
    } 
 

 
    $.ajax({ 
 
     type : "POST", 
 
     url : 'http://www.secure.redfinnet.com/admin/ws/recurring.asmx/AddRecurringCreditCard', 
 
     data: startPayment, 
 
     dataType: "jsonp", 
 
     success: function(obj){console.log(obj)} 
 

 
    }) 
 

 

 
    // alert(JSON.stringify(paymentData)) 
 
    } 
 
</script> 
 

 
<form>       
 
    <table cellspacing="0" cellpadding="4" frame="box" bordercolor="#dcdcdc" rules="none" style="border-collapse: collapse;"> 
 
    <tbody><tr> 
 
\t <td class="frmHeader" background="#dcdcdc" style="border-right: 2px solid white;">Recurring Payments</td> 
 
\t <td class="frmHeader" background="#dcdcdc">Recurring Payments</td> 
 
</tr> 
 

 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">Username:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="Username"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">Password:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="Password"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">Vendor:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="Vendor"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">CustomerID:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="CustomerID"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">ContractID:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="ContractID"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">BillAmt:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="BillAmt"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">TaxAmt:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="TaxAmt"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">TotalAmt:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="TotalAmt"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">StartDate:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="StartDate"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">BillingPeriod:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="BillingPeriod"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">BillingInterval:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="BillingInterval"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">CcAccountNum:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="CcAccountNum"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">CcExpDate:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="CcExpDate"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">CcNameOnCard:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="CcNameOnCard"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">CcStreet:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="CcStreet"></td> 
 
          </tr> 
 
         
 
          <tr> 
 
          <td class="frmText" style="color: #000000; font-weight: normal;">CcZip:</td> 
 
          <td><input class="frmInput" type="text" size="50" id="CcZip"></td> 
 
          </tr> 
 
         
 
         <tr> 
 
          <td></td> 
 
          <td align="center"> <input type="submit" onClick="startPayment()" value="Submit" class="button"></td> 
 
         </tr> 
 
         </tbody></table> 
 
         
 

 
        </form>

回答

0

我不知道這是否是一個類型或沒有,但你有在您的AJAX呼叫中:

data: startPayment, 

這是否應該是

data: paymentData, 

我還要對你的AJAX調用添加一個錯誤處理程序,所以最終調用是這樣的:

$.ajax({ 
    type : "POST", 
    url : 'http://www.secure.redfinnet.com/admin/ws/recurring.asmx/AddRecurringCreditCard', 
    data: paymentData, 
    dataType: "jsonp", 
    success: function(obj){console.log(obj);}, 
    error: function(jqXHR, textStatus, errorThrown) { 
    console.log(errorThrown); 
    console.log(jqXHR); 
    } 
});