我在日志控制台中收到此错误:
The amount is invalid
我在开发环境中工作,与http://localhost:3000/
我的控制器中有:
def pay
pay_request = PaypalAdaptive::Request.new
data = {
"returnUrl" => user_orders_url(current_user),
"requestEnvelope" => {"errorLanguage" => "en_US"},
"currencyCode" => "USD",
"receiverList" =>
{ "receiver" => [
{"receiver"=> [{"email"=>"email1", "amount"=>"10.00", "primary" => true}, {"email"=>"email2", "amount"=>"9.00", "primary" => false}]}
]},
"cancelUrl" => user_orders_url(current_user),
"actionType" => "PAY",
"ipnNotificationUrl" => ipn_notification_user_orders_url(current_user)
}
pay_response = pay_request.pay(data)
if pay_response.success?
# Send user to paypal
redirect_to pay_response.preapproval_paypal_payment_url
else
puts pay_response.errors.first['message']
redirect_to root_url, alert: "Something went wrong. Please contact support."
end
end
我在做什么坏事?