123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\service\byte_dance;
- class ByteDanceQueryOrder implements ByteDanceInterface {
- protected $orderNo;
- /**
- * @param array $body
- */
- public function setOrderNo($body)
- {
- $this->orderNo = $body;
- return $this;
- }
- public function get()
- {
- $params=[
- 'app_id'=>ByteDance::appId(),
- 'out_order_no'=>$this->orderNo,
- ];
- $params['sign']=ByteDance::sign($params);
- $data=ByteDance::httpPost('https://developer.toutiao.com/api/apps/ecpay/v1/query_order',$params,[],false);
- user_log('dyQueryOrderPayed',['orderNo'=>$this->orderNo,'data'=>$data]);
- return $data['err_no']===0;
- }
- public function getWangKa()
- {
- $params=[
- 'app_id'=>ByteDance::appIdTwo(),
- 'out_order_no'=>$this->orderNo,
- ];
- $params['sign']=ByteDance::signWangKa($params);
- $data=ByteDance::httpPost('https://developer.toutiao.com/api/apps/ecpay/v1/query_order',$params,[],false);
- user_log('dyQueryOrderPayed',['orderNo'=>$this->orderNo,'data'=>$data]);
- return $data['err_no']===0;
- }
- public function getHaoYuan()
- {
- $params=[
- 'app_id'=>ByteDance::appIdThree(),
- 'out_order_no'=>$this->orderNo,
- ];
- $params['sign']=ByteDance::signHaoYuan($params);
- $data=ByteDance::httpPost('https://developer.toutiao.com/api/apps/ecpay/v1/query_order',$params,[],false);
- user_log('dyQueryOrderPayed',['orderNo'=>$this->orderNo,'data'=>$data]);
- return $data['err_no']===0;
- }
- }
|