【发布时间】:2016-07-15 04:03:01
【问题描述】:
我正在为 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 业务资料中列出的相同用户名、密码和签名。我也在使用测试应用 ID。
【问题讨论】:
标签: ruby paypal paypal-sandbox