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