使用 activemerchant 的 Authorize.net 参数
我在 Rails 应用程序中使用authorize.net 和 activemerchant。
当我进行购买时,authorize.net 会发回一封电子邮件,其中包含有关购买的信息。我应该能够向他们发送帐单和送货地址信息,并在电子邮件中返回这些信息,但它没有返回任何信息,显然我的变量名称错误,有人知道它们应该是什么吗?我一直在翻阅authorize.net api 文档和activemerchant 的文档,但找不到我需要的东西。
我在订单模型上的购买方法如下所示:
def purchase
purchase_options = {
:ip => ip_address,
:first_name => first_name,
:last_name => last_name,
:address => billing_street_address,
:city => billing_city,
:state => billing_state,
:country => "US",
:zip => billing_zip,
:ship_to_first_name => first_name,
:ship_to_last_name => last_name,
:ship_to_address => shipping_street_address,
:ship_to_city => shipping_city,
:ship_to_state => shipping_state,
:ship_to_country => "US",
:ship_to_zip => shipping_zip
}
response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)
# other transaction stuff
response.success?
结束
I'm using authorize.net and activemerchant in a rails app.
When I make a purchase authorize.net sends back an email with information about the purchase. I should be able to send them the billing and shipping address information and have that returned in the email, but it's not returning any of the information, obviously I've got the varable names wrong, anybody know what they should be? I've been pouring over the authorize.net api docs and activemerchant's but can't find what I need.
My purchase method on an orders model looks like this:
def purchase
purchase_options = {
:ip => ip_address,
:first_name => first_name,
:last_name => last_name,
:address => billing_street_address,
:city => billing_city,
:state => billing_state,
:country => "US",
:zip => billing_zip,
:ship_to_first_name => first_name,
:ship_to_last_name => last_name,
:ship_to_address => shipping_street_address,
:ship_to_city => shipping_city,
:ship_to_state => shipping_state,
:ship_to_country => "US",
:ship_to_zip => shipping_zip
}
response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)
# other transaction stuff
response.success?
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
帐单地址变量为:x_first_name、x_last_name、x_company、x_address、x_city、x_state、x_zip、x_country、x_phone、x_fax
送货变量为:x_ship_to_first_name、x_ship_to_last_name、x_ship_to_company、x_ship_to_address、x_ship_to_city、x_ship_to_state、x_ship_to_zip、 _country
您可以省略任何您不想提供,因为它们都是可选的。
您可以在AIM 指南第 21 - 25 页中找到这些内容。
The billing address variables are: x_first_name, x_last_name, x_company, x_address, x_city, x_state, x_zip, x_country, x_phone, x_fax
The shipping variables are: x_ship_to_first_name, x_ship_to_last_name, x_ship_to_company, x_ship_to_address, x_ship_to_city, x_ship_to_state, x_ship_to_zip, x_ship_to_country
You can omit any you do not wish to provide as they are all optional.
You can find these in the AIM Guide on pages 21 - 25.
安装 fiddler 并查看您返回的原始响应。 authorize.net 应该会给你一些关于错误的提示。
Install fiddler and look at the raw response you are getting back. authorize.net should give you some hints on what is wrong.