Merge pull request #178 from lscgzwd/master

增加转帐订单查询
This commit is contained in:
yansongda 2018-10-30 21:59:39 +08:00 committed by GitHub
commit c4dcfce9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,7 @@ class Alipay implements GatewayApplicationInterface
*
* @param string|array $order
* @param bool $refund
* @param bool $transfer
*
* @throws InvalidSignException
* @throws \Yansongda\Pay\Exceptions\GatewayException
@ -181,10 +182,19 @@ class Alipay implements GatewayApplicationInterface
*
* @return Collection
*/
public function find($order, $refund = false): Collection
public function find($order, $refund = false, $transfer = false): Collection
{
$this->payload['method'] = $refund ? 'alipay.trade.fastpay.refund.query' : 'alipay.trade.query';
$this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]);
$method = 'alipay.trade.query';
$requestOrder = is_array($order) ? $order : ['out_trade_no' => $order];
if ($refund) {
$method = 'alipay.trade.fastpay.refund.query';
}
if ($transfer) {
$requestOrder = is_array($order) ? $order : ['out_biz_no' => $order];
$method = 'alipay.fund.trans.order.query';
}
$this->payload['method'] = $method;
$this->payload['biz_content'] = json_encode($requestOrder);
$this->payload['sign'] = Support::generateSign($this->payload);
Log::info('Starting To Find An Alipay Order', [$this->gateway, $this->payload]);