我有一个 Rails 应用程序,其中包含付款表格。如图所示the official website ,我像这样创建一张新信用卡:
attributes = params[:credit_card]
credit_card = ActiveMerchant::Billing::CreditCard.new(
:number => attributes[:number],
:month => attributes[:month],
:year => attributes[:year],
:first_name => attributes[:first_name],
:last_name => attributes[:last_name],
:verification_value => attributes[:verification_value]
)
它可以工作,但不是很安全,因为它在提交表单后在发布请求中以明文方式传递数据。
保护我的应用程序的最佳方法是什么?我看到this railscast但它不是很适用于 activemerchant。
我可以使用 ssl 但它足够了吗?我正在使用 heroku,所以要使用 ssl,我必须简单地使用 https 而不是 http。
最佳答案
让您的付款电话通过 HTTPS 协议(protocol)是最好的方法。事实上,即使您找到了更好的方法来混淆您发送的数据,如果对方不共享相同的逻辑,它也将毫无用处。
像这样的所有敏感和有风险的数据都应该只存在于 HTTPS 协议(protocol)下。
关于ruby-on-rails - 如何通过 activemerchant 确保付款?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20079065/