Giter Club home page Giter Club logo

Comments (2)

jenchih avatar jenchih commented on May 24, 2024

index.php?s=/index/index/index
这种获取 回调地址,一直提示签名失败,如果是 /index/index/index 这种路由,就可以签名校验成功

from alipay-global-sdk-php.

mantoufan avatar mantoufan commented on May 24, 2024

@jenchih 您好,$_SERVER['REQUEST_URI'] 只有在支持 path_info 的 Web 服务器上,才会打印出完整的带参数的 URL。
在使用前端路由,或者配置了 rewrite 伪静态的情况下,这个值可能与业务实际接收通知的 URL 不一致。
可以先打印 $_SERVER['REQUEST_URI'] 的值,看是否与您的预期一致,如果不一致,可以打印 $_SERVER 从中寻找合适的变量。或者用这些变量拼接出实际接收通知的 URL。

$notify = $alipayGlobal->getNotify(array(
  'httpMethod' => $_SERVER['REQUEST_METHOD'],
  'path' => $_SERVER['REQUEST_URI'], // 请打印 $_SERVER['REQUEST_URI'] 是否与预期一致
   'clientId' => $_SERVER['HTTP_CLIENT_ID'],
   'rsqTime' => $_SERVER['HTTP_REQUEST_TIME'],
  'rsqBody' => file_get_contents('php://input'),
  'signature' => $_SERVER['HTTP_SIGNATURE']
  ));

from alipay-global-sdk-php.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.