zhaohangyang / lop-opensdk-php
There is no license information available for the latest version (1.0.3) of this package.
1.0.3
2022-10-27 06:47 UTC
Requires
- php: >=5.6
- ext-json: *
- guzzlehttp/guzzle: ^6.5 | ^7.5
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2024-12-20 14:38:30 UTC
README
请求示例
setDomain("{DOMAIN}");//对接方案的编码,应用订购对接方案后可在订阅记录查看 $request->setPath("{PATH}");//api的path,可在API文档查看 $request->setMethod("POST");//只支持POST // 序列化后的JSON字符串 $request->setBody("{BODY}"); // 为请求添加ISV模式过滤器,自动根据算法计算开放平台鉴权及签名信息 $request->addFilter($isvFilter); // 为请求添加日志过滤器,日志将会输出到STDOUT,建议仅在测试时使用 $request->addFilter($loggerFilter); // 为请求添加错误响应解析过滤器,如果不添加需要手动解析错误响应 $request->addFilter($errorResponseFilter); $options = new Options(); $options->setAlgorithm(Options::MD5_SALT); //$options->setAlgorithm(Options::HMAC_MD5); //$options->setAlgorithm(Options::HMAC_SHA1); //$options->setAlgorithm(Options::HMAC_SHA256); //$options->setAlgorithm(Options::HMAC_SHA512); $response = $client->execute($request, $options); echo $response->getBody();