我正嘗試使用rails創建一個超簡單的paypal自定義集成。我正在關注這個主題的Ryan Bates Railscast #141,我已經進一步簡化了它。如果您有超級簡單的PayPal集成經驗,任何意見將不勝感激!Rails PayPal概念驗證
我試圖通過我的賬戶模式通過所有東西。概念驗證。
def paypal_url(return_url)
values = {
:business => '[email protected]',
:cmd => '_cart',
:upload => 1,
:return => return_url,
:invoice => 2,
:amount => 7,
:item_name => 'Membership',
:item_number => 1,
:quantity => 1
}
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
end
,當然我創建一個鏈接:
<%= link_to "Checkout", @account.paypal_url(accounts_path) %>
支付寶檢測到錯誤:「您的購物車是空的」,這很奇怪,因爲我可以看到我的模型經過的一切網址:
https://www.sandbox.paypal.com/cgi-bin/webscr?amount=7&[email protected]&cmd=_cart&invoice=&item_name=Barcoden+Membership&item_number=1&quantity=1&return=/accounts&upload=1