lib/active_merchant/billing/gateways/forte.rb in activemerchant-1.56.0 vs lib/active_merchant/billing/gateways/forte.rb in activemerchant-1.57.0

- old
+ new

@@ -21,10 +21,11 @@ end def purchase(money, payment_method, options={}) post = {} add_amount(post, money, options) + add_invoice(post, options) add_payment_method(post, payment_method) add_billing_address(post, payment_method, options) add_shipping_address(post, options) post[:action] = "sale" @@ -32,30 +33,33 @@ end def authorize(money, payment_method, options={}) post = {} add_amount(post, money, options) + add_invoice(post, options) add_payment_method(post, payment_method) add_billing_address(post, payment_method, options) add_shipping_address(post, options) post[:action] = "authorize" commit(:post, post) end def capture(money, authorization, options={}) post = {} + add_invoice(post, options) post[:transaction_id] = transaction_id_from(authorization) post[:authorization_code] = authorization_code_from(authorization) post[:action] = "capture" commit(:put, post) end def credit(money, payment_method, options={}) post = {} add_amount(post, money, options) + add_invoice(post, options) add_payment_method(post, payment_method) add_billing_address(post, payment_method, options) post[:action] = "disburse" commit(:post, post) @@ -91,9 +95,13 @@ private def add_auth(post) post[:account_id] = "act_#{@options[:account_id]}" post[:location_id] = "loc_#{@options[:location_id]}" + end + + def add_invoice(post, options) + post[:order_number] = options[:order_id] end def add_amount(post, money, options) post[:authorization_amount] = amount(money) end