eee
This commit is contained in:
@@ -73,10 +73,32 @@ trait WxV3PaymentTait
|
|||||||
*/
|
*/
|
||||||
public function searchByOutTradeNo(string $orderNo): array
|
public function searchByOutTradeNo(string $orderNo): array
|
||||||
{
|
{
|
||||||
$config = $this->getPayConfig();
|
return $this->search('/v3/pay/transactions/out-trade-no/' . $orderNo);
|
||||||
$parseUrl = '/v3/pay/transactions/out-trade-no/' . $orderNo;
|
}
|
||||||
$sign = $this->signature('GET', $parseUrl . '?mchid=' . $config->pay->wx->mchId);
|
|
||||||
$client = $this->createClient($sign, '');
|
|
||||||
|
/**
|
||||||
|
* @param string $orderNo
|
||||||
|
* @return array
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function searchByTransactionId(string $orderNo): array
|
||||||
|
{
|
||||||
|
return $this->search('/v3/pay/transactions/id/' . $orderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $parseUrl
|
||||||
|
* @return array
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private function search(string $parseUrl): array
|
||||||
|
{
|
||||||
|
$config = $this->getPayConfig();
|
||||||
|
|
||||||
|
$sign = $this->signature('GET', $parseUrl . '?mchid=' . $config->pay->wx->mchId);
|
||||||
|
$client = $this->createClient($sign, '');
|
||||||
$client->withAddedHeader('Accept', 'application/json');
|
$client->withAddedHeader('Accept', 'application/json');
|
||||||
$client->get($parseUrl, ['mchid' => $config->pay->wx->mchId]);
|
$client->get($parseUrl, ['mchid' => $config->pay->wx->mchId]);
|
||||||
$client->close();
|
$client->close();
|
||||||
@@ -103,8 +125,6 @@ trait WxV3PaymentTait
|
|||||||
|
|
||||||
$sign = $this->openssl_signature($message);
|
$sign = $this->openssl_signature($message);
|
||||||
|
|
||||||
var_dump($sign);
|
|
||||||
|
|
||||||
return sprintf('%s mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"', $payConfig->pay->wx->schema,
|
return sprintf('%s mchid="%s",nonce_str="%s",timestamp="%d",serial_no="%s",signature="%s"', $payConfig->pay->wx->schema,
|
||||||
$payConfig->pay->wx->mchId, $rand, $time, $payConfig->pay->wx->SerialNumber, $sign);
|
$payConfig->pay->wx->mchId, $rand, $time, $payConfig->pay->wx->SerialNumber, $sign);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user