开发者

rails send parameters to a third party in a post request

I am using a payment gateway in my rails application, how can I redirect to gateway from my controller and pass all the parameters required by the gateway? Basically it's a post re开发者_如何学Goquest.


You probably want to do this not through the ActionController framework, but using a seperate HTTP Client library.

Net::HTTP is an example of such a library, but your payment gateway may provide a ruby gem for interacting with it (like TrustCommerce does) or perhaps some portion of ActiveMerchant will work with your gateway.

Either way, it's probably not best to actually redirect your users directly to your payment gateway (since the payment gateway probably returns xml, and the user would then see this); but rather make a seperate connection to the gateway on your server, then process that call and return the results to your users.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜