您好我想使用Mass Pay API。
我正在使用RubyOnRails。这是我的代码:
require 'httpclient'
clnt = HTTPClient.new
credentials = {
'USER' => 'payer_1342623102_biz_api1.gmail.com',
'PWD' => '1342623141',
'SIGNATURE' => 'Ay2zwWYEoiRoHTTVv365EK8U1lNzAESedJw09MPnj0SEIENMKd6jvnKL'
}
data = {
"VERSION" => "2.3",
"METHOD" => "MassPay",
"RECEIVERTYPE" => "EmailAddress",
"L_EMAIL0"=> "denmed_1342691273_biz@gmail.com",
"L_AMT0" => "10",
"L_EMAIL1"=> "second_1344932945_per@gmail.com",
"L_AMT1" => "5",
"currencyCode" => "USD",
"VERSION" => "51.0"}
uri = "https://api-aa.sandbox.paypal.com/2.0/"
res = clnt.post(uri, data)
puts res
puts res.header
puts res.content
我收到错误:
<SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Method not implemented</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envel
奇怪的是,因为我在线“METHOD”中实现了方法=&gt; “MassPay”。
我的问题在哪里?
答案 0 :(得分:0)
我的问题的原因是在PayPal文档不好的情况下。这是代码,工作:
require 'httpclient'
clnt = HTTPClient.new
data = { "METHOD" => "MassPay",
"VERSION" => "90",
'USER' => 'payer_1342623102_biz_api1.gmail.com',
'PWD' => '1342623141',
'SIGNATURE' => 'Ay2zwWYEoiRoHTTVv365EK8U1lNzAESedJw09MPnj0SEIENMKd6jvnKL',
"RECEIVERTYPE" => "EmailAddress",
"CURRENCYCODE" => "USD",
"L_EMAIL0" => 'propro_1344939908_biz@gmail.com',
"L_AMT0" => "1",
"L_EMAIL1" => "denmed_1342691273_biz@gmail.com",
"L_AMT1" => "1"
}
uri = "https://api-3t.sandbox.paypal.com/nvp"
res = clnt.post(uri, data)