Giter Club home page Giter Club logo

Comments (7)

mantoufan avatar mantoufan commented on June 4, 2024

感谢反馈,我在 Webman 中测试了现金支付,可以正常返回回调地址,如图所示:
image
SDK 本身是兼容 Webman 的,但是示例 0df0a98 不能在 Webman 中运行,因为缺少所需的 $_SERVER['HTTP_HOST']
我更新了 getCurrentUrl() 方法:

function getCurrentUrl()
{
    if ($opt && isset($opt['webman']) && isset($opt['webman']['request'])) {
        $request = $opt['webman']['request'];
        return 'http' . ($request->getLocalPort() === 443 ? 's' : '') . ':' . $request->fullUrl();
    }
}

在 Webman 下,它可以像这样使用:

namespace app\controller;
use support\Request;
class Index
{
    public function index(Request $request)
    {
        $currentUrl = getCurrentUrl(array(
           'webman' => array('request' => $request)
       ));
       // Then new \Mantoufan\AliPayGlobal ……
    }
}

from alipay-global-sdk-php.

xiaoshuai666 avatar xiaoshuai666 commented on June 4, 2024

感谢回答,在支付这里是没问题的,支付成功后,异步回调里因为大量使用了$_SERVER,所以导致抛出异常,我现在是直接使用跳过方法直接使用SignatureTool:verify进行验证的,如果要是用插件里集成的$alipayGlobal->getNotify()该如何进行兼容呢?

from alipay-global-sdk-php.

mantoufan avatar mantoufan commented on June 4, 2024

Hi, 我们更改了 0.0.3 版便于您直接传参:

composer remove mantoufan/alipay-global-sdk-php // 先移除
composer require mantoufan/alipay-global-sdk-php // 再重新安装
  1. $alipayGlobal->getNotify()时传入参数,值调用 Webman 的 $request 的方法
  2. getNotifyResponseWithRSA(),分别得到 headersbody
  3. 用 Webman 的 response 方法发送响应
$notify = $alipayGlobal->getNotify(array(
    'httpMethod' => $request->method(),
    'path' => $request->uri(),
    'clientId' => $request->header('client-id'),
    'rsqTime' => $request->header('request-time'),
    'rsqBody' => $request->rawBody(),
    'signature' => $request->header('signature')
)); 
$notifyResponseWithRSA =  $notify->getNotifyResponseWithRSA();
response($notifyResponseWithRSA['body'], 200, $notifyResponseWithRSA['headers']);

from alipay-global-sdk-php.

xiaoshuai666 avatar xiaoshuai666 commented on June 4, 2024

好的,感谢

from alipay-global-sdk-php.

mantoufan avatar mantoufan commented on June 4, 2024

Hi, 您可以在调用 getNotify 时传入参数,示例已更新到上面,您可以试试,任何情况随时联系

from alipay-global-sdk-php.

xiaoshuai666 avatar xiaoshuai666 commented on June 4, 2024

问题完美解决,感谢作者的付出,点赞!
另外提个不是问题的问题,根据手册上显示,异步通知最后响应支付宝的时候是不需要签名的,文档截图如下
image
另外建议如果可以把查询支付状态和取消支付这两个比较常用的接口一起集成上,就非常完美了

from alipay-global-sdk-php.

xiaoshuai666 avatar xiaoshuai666 commented on June 4, 2024

问题完美解决,感谢作者的付出,点赞!
另外提个不是问题的问题,根据手册上显示,异步通知最后响应支付宝的时候是不需要签名的,文档截图如下
image
另外建议如果可以把查询支付状态和取消支付这两个比较常用的接口一起集成上,就非常完美了

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.