|
@@ -14,13 +14,13 @@ class RefillPhone extends refill\IRefillPhone
|
|
parent::__construct($cfgs);
|
|
parent::__construct($cfgs);
|
|
}
|
|
}
|
|
|
|
|
|
- private function req_params(int $phone, int $amount, string $order_sn)
|
|
|
|
|
|
+ private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
|
|
{
|
|
{
|
|
$data['ChargeAccount'] = $phone;
|
|
$data['ChargeAccount'] = $phone;
|
|
$data['SupBuyNum'] = 1;
|
|
$data['SupBuyNum'] = 1;
|
|
$data['ChargeValue'] = $amount;
|
|
$data['ChargeValue'] = $amount;
|
|
$data['OrderType'] = 1;
|
|
$data['OrderType'] = 1;
|
|
- $data['ChargeType'] = 2;
|
|
|
|
|
|
+ $data['ChargeType'] = config::operator[$card_type];
|
|
$data['Id'] = $order_sn;
|
|
$data['Id'] = $order_sn;
|
|
|
|
|
|
$params['mchid'] = config::MCH_ID;
|
|
$params['mchid'] = config::MCH_ID;
|
|
@@ -31,7 +31,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
|
|
public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
|
|
{
|
|
{
|
|
- $params = $this->req_params($card_no, $amount, $params['order_sn']);
|
|
|
|
|
|
+ $params = $this->req_params($card_no, $card_type, $amount, $params['order_sn']);
|
|
|
|
|
|
$resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
|
|
$resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
|
|
|
|
|