ActiveMerchant:如何在使用不支持void操作的网关时授权卡?

Bo *_*nes 6 ruby payment ruby-on-rails credit-card payment-gateway

我正在使用ActiveMerchant处理Ruby on Rails应用程序的计费组件.我们选择的支付网关是PaymentExpress.

我看到的代码示例如下所示,使用authorize()void()测试卡的有效性:

def test_card!
  auth_response = gateway.authorize(100, card)
  gateway.void(auth_response.authorization) if auth_response.success?
  raise AuthorizationFailed.new(auth_response) unless auth_response.success?
end
Run Code Online (Sandbox Code Playgroud)

但是,PaymentExpress不支持void操作.有没有其他方法来执行此授权操作,或者可以省略无效操作,考虑到PaymentExpress等网关在7天后过期授权请求?

void在文档或Google中没有提到授权,也没有任何关于它有多重要的迹象.

一些帮助?

Bo *_*nes 2

事实证明,至少对于 PaymentExpress,他们会在卡存储过程中自动执行授权操作。如果授权失败,它不会存储该卡,而是返回“INVALID CARD”。这可以在他们的交易搜索网络应用程序中看到——存储卡时,卡上授权 1.00 美元,并在一周后自动失效。