Ruby on rails 如何在PayPal计费后使用POST返回?

Ruby on rails 如何在PayPal计费后使用POST返回?,ruby-on-rails,paypal,Ruby On Rails,Paypal,我创建了下一个表单: <form name="_xclick" action="https://www.sandbox.paypal.com/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="team@team.com"> <input type="hidden"

我创建了下一个表单:

<form name="_xclick" action="https://www.sandbox.paypal.com/webscr" method="post">
  <input type="hidden" name="cmd" value="_xclick">
  <input type="hidden" name="business" value="team@team.com">
  <input type="hidden" name="currency_code" value="USD">
  <input type="hidden" name="item_name" value="Subscription">
  <input type="hidden" name="return" value="http://www.my_website.com/<%= params[:locale] %>/success">
  <input type="hidden" name="amount" value="1">
  <input type="image" src="http://www.paypal.com/en_US/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
那么,如何更改我的第一个代码,使其在计费后执行POST重定向?

您能检查一下吗“”


和解决方案的“rm”变量。还可以为paypal付款提交设置隐藏字段值。

为什么要重定向到post?而不是在重定向页面上,您可以编写隐藏表单并通过javascript自动提交。
<form action="https://www.sandbox.paypal.com/webscr" method="post" target="_top">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="SOME_VALUE">
  <input type="image" src="https://www.paypalobjects.com/en_US/IL/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
PayPal cannot process this transaction because of a problem with the seller's website. Please contact the seller directly to resolve this problem.