lop/lop-opensdk-php

此包的最新版本(dev-master)没有可用的许可证信息。

dev-master 2022-05-01 13:34 UTC

This package is auto-updated.

Last update: 2024-09-15 09:16:15 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();