【问题标题】:Authorize.net Parameters with activemerchant使用 activemerchant 授权.net 参数
【发布时间】:2011-01-13 08:01:00
【问题描述】:

我在 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?

结束

【问题讨论】:

    标签: ruby-on-rails activemerchant authorize.net


    【解决方案1】:

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

    您可以省略任何您不想提供的内容,因为它们都是可选的。

    您可以在第 21 - 25 页的AIM Guide 中找到这些信息。

    【讨论】:

    • 我正在尝试 x_recurring,但无法看到响应,甚至交易也没有显示在重复中。你能帮我解决这个问题吗?
    【解决方案2】:

    安装 fiddler 并查看您得到的原始响应。 authorize.net 应该会给你一些错误提示。

    【讨论】:

      猜你喜欢
      • 2021-03-05
      • 2012-05-11
      • 1970-01-01
      • 2010-11-27
      • 2016-05-10
      • 2014-04-08
      • 2010-10-03
      • 2021-03-05
      • 1970-01-01
      相关资源
      最近更新 更多