doushitang4276 2017-01-12 01:37
浏览 54

将定期付款表单与我的网关集成(wordpress)

Here is my code.

I am stuck trying to figure out how to link up to my payment gateway, and tokenize everything. As well as collect all this info..? Any takers any help much appreciated.

My main problem is just connecting to my gateway.

Bascially just given this guide to figure everything out: http://redfinpos.com/wp-content/uploads/RedFin-Developer-Manual-V.2.07.0415-a.pdf JUST UPDATED CODE to include 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>

</div>
  • 写回答

1条回答 默认 最新

  • douwenpin0428 2017-01-12 01:50
    关注

    I'm not sure if it's a type or not, but you have in your AJAX call:

    data: startPayment,
    

    Is that suppose to be

    data: paymentData,
    

    I would also add an error handler on your AJAX call, so the final call would look like this:

    $.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);
      }
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度