|
@@ -15,13 +15,13 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
parent::__construct($cfgs);
|
|
|
}
|
|
|
|
|
|
- private function req_params(int $phone, int $amount, int $card_type, string $order_sn, $regin_no)
|
|
|
+ private function req_params(int $phone, int $amount, $company_type, string $order_sn, $province, $card_id)
|
|
|
{
|
|
|
$params['szAgentId'] = config::USER_ID;
|
|
|
$params['szOrderId'] = $order_sn;
|
|
|
$params['szPhoneNum'] = $phone;
|
|
|
$params['nMoney'] = $amount;
|
|
|
- $params['nSortType'] = $card_type;
|
|
|
+ $params['nSortType'] = config::operator[$company_type];
|
|
|
$params['nProductClass'] = 1;
|
|
|
$params['nProductType'] = 1;
|
|
|
$params['szProductId'] = config::Product[$amount];
|
|
@@ -29,9 +29,11 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
$params['szNotifyUrl'] = config::NOTIFY_URL;
|
|
|
|
|
|
$data = [
|
|
|
- 'province' => mtopcard\ProvinceList[$regin_no],
|
|
|
- 'area' => mtopcard\ProvinceList[$regin_no],
|
|
|
+ 'province' => mtopcard\ProvinceList[$province]
|
|
|
];
|
|
|
+ if($company_type === 'south') {
|
|
|
+ $data['cardId'] = $card_id;
|
|
|
+ }
|
|
|
$params['params'] = json_encode($data, JSON_UNESCAPED_UNICODE);
|
|
|
return $params;
|
|
|
}
|
|
@@ -39,11 +41,13 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
|
|
|
{
|
|
|
$order_sn = $params['order_sn'];
|
|
|
- $regin_no = $params['regin_no'] ?? -1;
|
|
|
- if($regin_no <= 0) {
|
|
|
+ $company_type = $params['$company_type'];
|
|
|
+ $card_id = $params['card_id'] ?? '';
|
|
|
+ $province = $params['province'] ?? -1;
|
|
|
+ if($province <= 0) {
|
|
|
return [false, '省份获取错误', false];
|
|
|
}
|
|
|
- $params = $this->req_params($card_no, $amount, $card_type, $order_sn, $regin_no);
|
|
|
+ $params = $this->req_params($card_no, $amount, $company_type, $order_sn, $province, $card_id);
|
|
|
|
|
|
$sign = $this->sign($params);
|
|
|
$params['szVerifyString'] = $sign;
|