diff --git a/wchat/qq/Recharge.php b/wchat/qq/Recharge.php index a1b32ad..8ba5b72 100644 --- a/wchat/qq/Recharge.php +++ b/wchat/qq/Recharge.php @@ -21,8 +21,18 @@ class Recharge extends SmallProgram private $data = []; + private $spbill_create_ip = ''; + private $unifiedorder = 'https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi'; + /** + * @param string $value + */ + public function setSpbillCreateIp(string $value) + { + $this->spbill_create_ip = $value; + } + /** * @param int $money * @param string $orderNo @@ -76,7 +86,7 @@ class Recharge extends SmallProgram 'body' => $this->config->getBody(), 'out_trade_no' => $this->orderNo, 'total_fee' => $this->money, - 'spbill_create_ip' => $_SERVER['REMOTE_ADDR'], + 'spbill_create_ip' => $this->spbill_create_ip, 'notify_url' => $this->config->getNotifyUrl(), 'trade_type' => $this->config->getTradeType(), ];