douliang6563 2014-12-03 06:35
浏览 55
已采纳

从帖子信息中剪切“数组”

following issue, we just started to develop a payment gateway and unfortunately the documentation of the targeted api is almost not existent and the support of the bank is also awful.

In the documentation, under Message Format AUTHORIZATION REQUEST, we find this example:

mid=12345&terminal=1234&version=3.1&command=CRAUTH&ref_no=3421_14120348_14120348&ref_date=20141203061048&service_id=11&cust_id=1&cur_abbr=THB&amount=300.00&backURL=https://www.yourshopreturnurl.com/

So we have created the gateway (WooCommerce) and used this form to pass our array value:

$scb_args_array = array();
            foreach($ccavenue_args as $param => $value) { $scb_args_array[] = "$param=$value"; }
$paramsJoinedNew = implode('&', $scb_args_array); 

            return '<form action="'.$live_url.'" method="post" id="ewire_payment_form">
                    <input type="hidden" name="bank_Values" value="'. $paramsJoinedNew .'" />
                    <input type="submit" class="button-alt" id="submit_ewire_payment_form" value="'.__('Pay via bank', 'woothemes').'" /> <a class="button cancel" href="'.$order->get_cancel_order_url().'">'.__('Cancel order &amp; restore cart', 'woothemes').'</a>
                    </form>';}    

The result of this form is:

Array ( [bank_Values] => mid=12345&terminal=1234&version=3.1&command=CRAUTH&ref_no=3421_14120348_14120348&ref_date=20141203061048&service_id=11&cust_id=1&cur_abbr=THB&amount=300.00&backURL=https://www.yourshopreturnurl.com/  )    

Submitting this to the bank, results in a blank page of the bank without any debug information.

We assume that ARRAY ( [bank_Values] => is the problem, is there any way to strip that part out of the post information, so it only sends the raw value as in their example?

Also maybe someone has another idea what could solve the problem.

Thank you for your help!

  • 写回答

1条回答 默认 最新

  • douchuituo3032 2014-12-03 06:43
    关注

    If you want to send raw data then for every data create a separate input field like below

      <input type="hidden" name="mid" value="12345" />
      <input type="hidden" name="version" value="3.1" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波