簡體   English   中英

將定期付款表單與我的網關(wordpress)集成

[英]Integrating a recurring payment form with my gateway (wordpress)

這是我的代碼。

我一直在努力弄清楚如何鏈接到我的付款網關,並對所有內容進行標記化。 以及收集所有這些信息..? 任何接受者的幫助都將不勝感激。

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

基本上只是給了本指南以解決所有問題: 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> <td class="frmHeader" background="#dcdcdc" style="border-right: 2px solid white;">Recurring Payments</td> <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> 

我不確定它是否是一種類型,但是您已經在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);
  }
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM