gpt4 book ai didi

ruby - 错误 100002(安全错误 - 安全 header 无效)

转载 作者:太空宇宙 更新时间:2023-11-03 16:24:59 24 4
gpt4 key购买 nike

我正在为 Rails 使用 paypal/merchant-sdk-ruby。对于沙箱环境,它使用 https://api-3t.sandbox.paypal.com/2.0/作为端点。

发出简单的批量支付请求时出现以下错误:

[#<PayPal::SDK::Merchant::DataTypes::ErrorType:0x007f2ff0ae2280 @ShortMessage="Security error", @LongMessage="Security header is not valid", @ErrorCode="10002", @SeverityCode="Error">]

在验证我的 SOAP API 凭据正确后,我尝试切换到基于证书的凭据但没有成功,撤销了证书凭据,重新颁发了基于签名的凭据,并在我的配置中更新了它们。我仍然遇到同样的错误。

这是我的开发环境配置。我已经验证了 ENV 变量是否正确传递。

# Mode can be 'live' or 'sandbox'
mode: sandbox

# Credentials for Classic APIs
app_id: ENV['api_cred_a']

username: ENV['api_cred_u']
password: ENV['api_cred_p']
signature: ENV['api_cred_s']
sandbox_email_address: ENV['api_cred_e']

同样,我使用了正确的端点,并且使用了我的 PayPal 业务配置文件中列出的相同用户名、密码和签名。我也在使用测试 App ID。

最佳答案

我只是使用了 SDK 附带的默认测试用户名、密码和签名,我不再收到该错误。也许业务配置文件 API 信用仅在实时环境中有效。

来自 pp_MSI_Jenn :

If you are in the sandbox environment, you must use Sandbox account API Signature credentials. If you are pointed to the live environment then you can use your Live PayPal Account API Signature Credentials.

关于ruby - 错误 100002(安全错误 - 安全 header 无效),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36253132/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com