<?php
namespace Payment\Common\Ccb\Data\Charge; use Payment\Common\Ccb\Data\CmbBaseData; use Payment\Common\CcbConfig; use Payment\Common\PayException; use Payment\Config; class ChargeData extends CcbBaseData { protected function checkDataParam() { parent::checkDataParam(); $amount = $this->amount; if (bccomp($amount, Config::PAY_MIN_FEE, 2) === -1) { throw new PayException('支付金额不能低于 ' . Config::PAY_MIN_FEE . ' 元'); } $clientIp = $this->client_ip; if (empty($clientIp)) { $this->client_ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1'; } $timeExpire = $this->timeout_express; if (! empty($timeExpire)) { $express = floor(($timeExpire - strtotime($this->dateTime)) / 60); if ($express > CmbConfig::MAX_EXPIRE_TIME || $express < 0) { $this->timeout_express = CmbConfig::MAX_EXPIRE_TIME; } else { $this->timeout_express = $express; } } } protected function getReqData() { $reqData = [ 'MERCHANTID' => , 'POSID' => , 'BRANCHID' => , 'ORDERID' => $this->order_no, 'PAYMENT' => $this->amount, 'CURCODE' => '01', 'TXCODE' =>, 'REMARK1' =>, 'REMARK2' =>, 'TYPE' => '1', 'GATEWAY' => , 'CLIENTIP' => $this->client_ip, 'REGINFO' => , 'PROINFO' => , 'REFERER' => , 'INSTALLNUM' => 1, 'TIMEOUT' => , 'MAC' => ]; return $reqData; } } 