使用 activemerchant 的 Authorize.net 参数

发布于 2024-08-21 01:22:22 字数 1141 浏览 7 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

中二柚 2024-08-28 01:22:22

帐单地址变量为: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.

三生路 2024-08-28 01:22:22

安装 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文