mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-02 12:17:38 +08:00
fix #79
This commit is contained in:
parent
89bf5eddef
commit
822a98e2f8
@ -200,6 +200,32 @@ class Alipay implements GatewayApplicationInterface
|
||||
return Support::requestApi($this->payload, $this->config->get('ali_public_key'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Download bill.
|
||||
*
|
||||
* @author yansongda <me@yansongda.cn>
|
||||
*
|
||||
* @param string|array $bill
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function download($bill)
|
||||
{
|
||||
$this->payload['method'] = 'alipay.data.dataservice.bill.downloadurl.query';
|
||||
$this->payload['biz_content'] = json_encode(is_array($bill) ? $bill : ['bill_type' => 'trade', 'bill_date' => $bill]);
|
||||
$this->payload['sign'] = Support::generateSign($this->payload, $this->config->get('private_key'));
|
||||
|
||||
Log::debug('Download Bill:', [$this->gateway, $this->payload]);
|
||||
|
||||
$result = Support::requestApi($this->payload, $this->config->get('ali_public_key'));
|
||||
|
||||
if ($result instanceof Collection) {
|
||||
return $result->bill_download_url;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Reply success to alipay.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user