레일과 함께 매우 간단한 페이팔 맞춤형 통합을 만들려고합니다. 나는이 주제에 대해 Ryan Bates Railscast #141을 따르고 있으며, 그것을 더 단순화했습니다. 당신은 슈퍼 간단한 페이팔 통합 경험이 있다면, 어떤 조언을 부탁드립니다!레일스 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) %>
페이팔은 오류를 발견 : "귀하의 쇼핑 카트가 비어이다"내 모델에서 통과 모든 것을 볼 수 있기 때문에 이상하다 URL :
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