Code Monkey home page Code Monkey logo

Comments (7)

wi1dcard avatar wi1dcard commented on June 18, 2024 2

试试看将 env('ALIPAY_APP_PRIVATE_KEY')env('ALIPAY_PUBLIC_KEY') 修改为:

base_path(env('ALIPAY_APP_PRIVATE_KEY'));

base_path(env('ALIPAY_PUBLIC_KEY'));

或是尝试使用绝对路径,先确保能够读到 Key 值。

另外,请使用 Markdown 的 Code Block 语法,截图不利于观看,也不利于大家审阅和修改你的代码。

from alipay-sdk-php.

ztqgit avatar ztqgit commented on June 18, 2024 2

部分问题可以到支付宝开放平台查询,alipay_user_id是废弃的
https://open.alipay.com/search/searchDetail.htm?tabType=api&keyword=alipay_user_id

from alipay-sdk-php.

weasiser avatar weasiser commented on June 18, 2024 1

@wi1dcard 绝对路径的确可以读到 key ,非常感谢。
@ztqgit 谢谢提醒

from alipay-sdk-php.

wi1dcard avatar wi1dcard commented on June 18, 2024

不太清楚你所描述的上下文是什么?是哪里多了 alipay_user_id

from alipay-sdk-php.

weasiser avatar weasiser commented on June 18, 2024

image
官方文档只有一个 user_id,没有 alipay_user_id,这个 alipay_user_id 难道是开发者自己的 id ?

from alipay-sdk-php.

wi1dcard avatar wi1dcard commented on June 18, 2024

@weasiser 本 SDK 中,最终获取到的响应数据,是支付宝发回的原始数据直接反序列化后的结果,并没有增加任何参数。如果你对返回结果有疑问,可以使用 AlipayResponse 类的 getRaw() 方法:

https://github.com/wi1dcard/alipay-sdk-php/blob/ecc0516792a2c8a859a469d770f28dc3dc9d7a3b/aop/AlipayResponse.php#L98-L106

获取原始的响应字符串。

from alipay-sdk-php.

weasiser avatar weasiser commented on June 18, 2024

另外,我按照你教程 alipay.system.oauth.token.md ,用你的sdk能得到响应数据,然后放在自己的项目上就出问题(我的是laravel 5.8),生成公钥私钥都是用那个 /bin/genrsa 工具生成的:
image

这是我的一些代码:
image

image

image

image

image

from alipay-sdk-php.

Related Issues (20)

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.