lib/active_merchant/billing/gateways/mastercard.rb in activemerchant-1.133.0 vs lib/active_merchant/billing/gateways/mastercard.rb in activemerchant-1.137.0

- old
+ new

@@ -8,11 +8,11 @@ def purchase(amount, payment_method, options = {}) if options[:pay_mode] post = new_post add_invoice(post, amount, options) - add_reference(post, *new_authorization) + add_reference(post, *new_authorization(options)) add_payment_method(post, payment_method) add_customer_data(post, payment_method, options) add_3dsecure_id(post, options) commit('pay', post) @@ -25,11 +25,11 @@ end def authorize(amount, payment_method, options = {}) post = new_post add_invoice(post, amount, options) - add_reference(post, *new_authorization) + add_reference(post, *new_authorization(options)) add_payment_method(post, payment_method) add_customer_data(post, payment_method, options) add_3dsecure_id(post, options) commit('authorize', post) @@ -262,12 +262,12 @@ def split_authorization(authorization) authorization.split('|') end - def new_authorization + def new_authorization(options) # Must be unique within a merchant id. - orderid = SecureRandom.uuid + orderid = options[:order_id] || SecureRandom.uuid # Must be unique within an order id. transactionid = '1' # New transactions have no previous reference.