我已經看到了兩種不同的版本應該如何進行付費電話,我想知道我做錯了什麼,因爲兩個版本都不起作用。貝寶的自適應付款
@result = HTTParty.post('https://svcs.sandbox.paypal.com/AdaptivePayments/Pay',
:body =>
{:actionType => "PAY",
:currencyCode => "USD",
:receiverList => {
:receiver => [
{:amount => "1.00",
:email => "[email protected]"}]
},
:returnUrl => "www.yahoo.com",
:cancelUrl => "google.com",
:requestEnvelope => {
:errorLanguage => "en_US",
:detailLevel => "ReturnAll"}
},
:headers => {
"X-PAYPAL-SECURITY-USERID" => "caller_13124862354_api1.gmail.com",
"X-PAYPAL-SECURITY-PASSWORD" => "1234567890",
"X-PAYPAL-SECURITY-SIGNATURE" => "AbtI7HV1xB428VygBUcIhARzxch4AL78.T19CTeylixNNxDZUu0iO87e",
"X-PAYPAL-APPLICATION-ID" => "APP-81W284485P518643T",
"X-PAYPAL-REQUEST-DATA-FORMAT" => "JSON",
"X-PAYPAL-RESPONSE-DATA-FORMAT" => "JSON"
}
)
和
@result = HTTParty.post('https://svcs.sandbox.paypal.com/AdaptivePayments/Pay',
:body => {
:actionType => "PAY",
:currencyCode => "USD",
"receiverList.receiver(0).email".to_sym => "[email protected]",
"receiverList.receiver(0).amount".to_sym => "1.00",
:returnUrl => "www.yahoo.com",
:cancelUrl => "gizmodo.com",
:requestEnvelope => {
:errorLanguage => "en_US",
:detailLevel => "ReturnAll"}
},
:headers => {
"X-PAYPAL-SECURITY-USERID" => "caller_13124862354_api1.gmail.com",
"X-PAYPAL-SECURITY-PASSWORD" => "1234567890",
"X-PAYPAL-SECURITY-SIGNATURE" => "AbtI7HV1xB428VygBUcIhARzxch5AL65.T18CTeylixNNxDZUu0iO87e",
"X-PAYPAL-APPLICATION-ID" => "APP-81W284485P518643T",
"X-PAYPAL-REQUEST-DATA-FORMAT" => "JSON",
"X-PAYPAL-RESPONSE-DATA-FORMAT" => "JSON"
}
)
這個工作!謝謝! – MichaelScaria