贝宝沙盒错误 580022

Paypal Sandox Error 580022

我正在使用 Paypal 自适应帐户 gem (paypal-sdk-adaptivepayments) 在我的沙盒测试中使用 GetVerifiedStatus 操作进行 rails (4.0.2) 应用程序,但出现此错误:

 Error: [#<PayPal::SDK::AdaptiveAccounts::DataTypes::ErrorData:0x007fcd60e15bb0 
 @errorId=580022, @domain="PLATFORM", @subdomain="Application", @severity="Error", 
 @category="Application", @message="Invalid request parameter: emailAddress", 
 @parameter=[#PayPal::SDK::AdaptiveAccounts::DataTypes::ErrorParameter:0x007fcd60e15408 
 @value="emailAddress">]>]

我正在打的电话是:

@api = PayPal::SDK::AdaptiveAccounts::API.new( :device_ipaddress => "127.0.0.1" )
@get_verified_status = @api.build_get_verified_status({
    :emailAddress => usuario.mail,
    :firstName => usuario.nombre,
    :lastName => usuario.apellido1,
    :matchCriteria => "NAME" })

# Make API call & get response
@get_verified_status_response = @api.get_verified_status(@get_verified_status)

从上周开始,在我的硬盘说再见之前,这个应用程序运行良好,我必须恢复备份。我想我已经很好地配置了应用程序,但我不确定。我的 rails 应用有这个配置:

PayPal::SDK.configure(
  username: ENV["PAYPAL_CLASSIC_USERNAME"],
  password: ENV["PAYPAL_CLASSIC_PASSWORD"],
  signature: ENV["PAYPAL_CLASSIC_SIGNATURE"],
  app_id: ENV["PAYPAL_CLASSIC_APP_ID"],
  http_timeout: 30,
  mode: ENV["PAYPAL_CLASSIC_MODE"]
)

打印环境 | grep 贝宝 |排序

PAYPAL_CLASSIC_APP_ID:           APP-80W284485P519543T
PAYPAL_CLASSIC_MAIL:             my@email.com
PAYPAL_CLASSIC_MODE:             sandbox
PAYPAL_CLASSIC_PASSWORD:         [my-sandbox-password]
PAYPAL_CLASSIC_SIGNATURE:        [api-signature]
PAYPAL_CLASSIC_USERNAME:         *****

最后,我要说的是部署在 Heroku / Paypal 沙盒中的相同应用程序(并使用相同的沙盒帐户)正在运行。

我错过了什么?

来自paypal客服:

Error 580022 is typically returned when there is invalid values in the request. - https://developer.paypal.com/docs/classic/api/adaptive-accounts/GetVerifiedStatus_API_Operation/?mark=580022 From your request, I see you have:*

:emailAddress => usuario.mail,
:firstName => usuario.nombre,
:lastName => usuario.apellido1,
:matchCriteria => "NAME" })

The message says "Invalid request parameter: emailAddress"

Please verify that actual values are being sent through and let me know if still having issues.

在我的例子中,emailAddress 在电子邮件前有一个白色的 space。现在正在使用 .squish