gpt4 book ai didi

ruby-on-rails - Heroku 上的 Paypal merchant-sdk-ruby 授权问题

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

我在我的 Rails 应用程序中使用 2 个 PayPal SDK 进行支付

  1. 用于付款的 paypal-sdk-merchant 和
  2. paypal-sdk-rest 用于收款。

    这两个 sdks 使用相同的配置文件。

    Paypal-sdk-rest 工作正常,但是当我通过 paypal-sdk-merchant 初始化支付调用时,它给我一个错误。
[#PayPal::SDK::Merchant::DataTypes::ErrorType:0x007fc0f80c7c70 @ShortMessage="Authentication/Authorization Failed", @LongMessage="You do not have permissions to make this API call", @ErrorCode="10002", @SeverityCode="Error"]

While I tested the same code on my development machine and it worked like a charm.

It appears that Heroku is blocking our call to Paypal Merchant SDK.

Since the code is working fine in our development environment, this can be a configuration issue.I also checked that the Ruby and Paypal SDK version are same in both environments.

require 'paypal-sdk-merchant'
vets_list = []
vets_list << {
:ReceiverEmail => 'someone@example.com',
:Amount => {
:currencyID => "USD",
:value => 1.6
}
}
@api = PayPal::SDK::Merchant::API.new
@mass_pay = @api.build_mass_pay({
:ReceiverType => "EmailAddress",
:MassPayItem => vets_list
})
@mass_pay_response = @api.mass_pay(@mass_pay)

有人能找出我做错了什么吗?

谢谢!

最佳答案

PayPal REST SDK 有 payouts support现在,也许您可​​以选择使用它。

关于ruby-on-rails - Heroku 上的 Paypal merchant-sdk-ruby 授权问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28408194/

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