Ruby on rails 使用Ruby的PayPal支付
我正在尝试使用PayPal API()进行支付 我有我的代币 现在我正在创造我的身体:Ruby on rails 使用Ruby的PayPal支付,ruby-on-rails,ruby,paypal,Ruby On Rails,Ruby,Paypal,我正在尝试使用PayPal API()进行支付 我有我的代币 现在我正在创造我的身体: body = { :sender_batch_header => { :sender_batch_id => SecureRandom.hex(8), :email_subject => 'You have a Payout!' }, :items => [
body = {
:sender_batch_header => {
:sender_batch_id => SecureRandom.hex(8),
:email_subject => 'You have a Payout!'
},
:items => [
{
:recipient_type => 'EMAIL',
:amount => {
:value => '0.01',
:currency => 'EUR'
},
:note => 'Thanks for your patronage!',
:sender_item_id => '2014031400023',
:receiver => 'xxx@gmail.com'
}
]
}
并提出以下要求:
response = HTTParty.post("https://api.sandbox.paypal.com/v1/payments/payouts", :headers => { "Authorization" => "Bearer #{token}"}, :body => body)
但我得到的只是一个普通的回答
{“日期”:[“2019年5月15日星期三02:28:21
GMT“],“服务器”:[“Apache”],“贝宝调试id”:[“eacd2165b90d”,“eacd2165b90d”],“连接”:[“关闭”],“http_x_pp_az_定位器”:[“sandbox.slc”],“设置cookie”:[“x-pp-SILOVER=name%3DSANDBOX3.API.1%26silo_版本%3D1880%26app%3Dapiplatformproxyserv%26TIME%3D1165613916%26HTTP_pp_az定位器%3dbox%3dbox.slc;
Expires=Wed,2019年5月15日02:58:21 GMT;domain=.paypal.com;path=/;
安全;HttpOnly”,“X-PP-SILOVER=;Expires=Thu,1970年1月1日00:00:01
GMT“],“变更”:[“授权”],“内容类型”:[“文本/普通”;
字符集=ISO-8859-1“]}
我想我的身体有问题。我尝试将body.to_json
发送到,我还尝试使用:data
而不是:body
,但没有成功
有什么想法吗?您是如何解决的?前端使用什么?