Ejemplo n.º 1
0
 /**
  * 4.0接口商户响应平台分账退费结果通知(商户到平台,直连网银)检查数据字段合法性并生成签名明文串
  * @param unknown_type $map
  * @return 签名明文串,使用&符号组织签名明文串,如:mer_id=9996&amount=100
  */
 public static function getSplitMerRefundNotifyResDataPlain($map)
 {
     $data = new HashMap();
     $mer_id = StringUtil::trim($map->get("mer_id"));
     if ("" == $mer_id || strlen($mer_id) > 8) {
         die("mer_id为空或者长度超过限制");
     }
     $order_id = StringUtil::trim($map->get("order_id"));
     if ("" == $order_id || strlen($order_id) > 32) {
         die("order_id为空或者长度超过限制");
     }
     $refund_no = StringUtil::trim($map->get("refund_no"));
     if ("" == $refund_no || strlen($refund_no) > 16) {
         die("refund_no为空或者长度超过限制");
     }
     $mer_date = StringUtil::trim($map->get("mer_date"));
     if (!DateUtil::checkData($mer_date)) {
         die("mer_date为空或者长度不符合要求");
     }
     $ret_code = StringUtil::trim($map->get("ret_code"));
     if ("" == $ret_code || strlen($ret_code) != 4) {
         die("ret_code为空或者长度不符合要求");
     }
     $sign_type = StringUtil::trim($map->get("sign_type"));
     if ("" == $sign_type || strlen($sign_type) > 8) {
         die("sign_type为空或者长度不符合要求");
     }
     $version = StringUtil::trim($map->get("version"));
     if ("" == $version || strlen($version) != 3) {
         die("version为空或者长度不符合要求");
     }
     if (!is_null($map->get("ret_msg"))) {
         $ret_msg = StringUtil::trim($map->get("ret_msg"));
         if (strlen($ret_msg) > 128) {
             die("ret_msg长度不符合要求");
         }
         $data->put("ret_msg", $ret_msg);
     }
     $data->put("refund_no", $refund_no);
     $data->put("mer_id", $mer_id);
     $data->put("order_id", $order_id);
     $data->put("mer_date", $mer_date);
     $data->put("ret_code", $ret_code);
     $data->put("sign_type", $sign_type);
     $data->put("version", $version);
     return StringUtil::getPlainSortAndByAnd($map);
 }