lib/active_merchant/billing/gateways/pay_junction.rb in activemerchant-1.44.1 vs lib/active_merchant/billing/gateways/pay_junction.rb in activemerchant-1.45.0
- old
+ new
@@ -295,14 +295,18 @@
end
end
# add fields for credit card
def add_creditcard(params, creditcard)
- params[:name] = creditcard.name
- params[:number] = creditcard.number
- params[:expiration_month] = creditcard.month
- params[:expiration_year] = creditcard.year
- params[:verification_number] = creditcard.verification_value if creditcard.verification_value?
+ if creditcard.respond_to?(:track_data) && creditcard.track_data.present?
+ params[:track] = creditcard.track_data
+ else
+ params[:name] = creditcard.name
+ params[:number] = creditcard.number
+ params[:expiration_month] = creditcard.month
+ params[:expiration_year] = creditcard.year
+ params[:verification_number] = creditcard.verification_value if creditcard.verification_value?
+ end
end
# add field for "instant" transaction, using previous transaction id
def add_billing_id(params, billingid)
params[:transaction_id] = billingid