Skip to content

Commit

Permalink
feat: notify sign
Browse files Browse the repository at this point in the history
  • Loading branch information
myxiaoao committed Apr 28, 2024
1 parent ee98cf8 commit 7534cc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,12 @@ public function sendWapH5PayRequest(

return $this->client->sendRequest('api/pay/waph5pay', $data);
}

/**
* @throws JsonException
*/
public function notifySign(array $data, string $sign): bool
{
return $this->client->notifySign($data, $sign);
}
}
8 changes: 8 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ public function sendRequest(string $endpoint, array $data): array
return $body;
}

/**
* @throws JsonException
*/
public function notifySign(array $data,string $sign): bool
{
return $this->signature->verify($this->toSortedQueryString($data), $sign);
}

/**
* @throws JsonException
*/
Expand Down

0 comments on commit 7534cc8

Please sign in to comment.