~singpolyma/jmp-pay

4ecd14b8715400f677dc9ecdc35a70e8a2ecabdb — Stephen Paul Weber 8 months ago 5109bd7
Get method token from transaction as well
1 files changed, 9 insertions(+), 1 deletions(-)

M lib/three_d_secure_repo.rb
M lib/three_d_secure_repo.rb => lib/three_d_secure_repo.rb +9 -1
@@ 14,7 14,15 @@ class ThreeDSecureRepo

		if !three_d ||
		   (three_d.liability_shift_possible && !three_d.liability_shifted)
			raise Failed, method.token
			raise Failed, method_token(result)
		end
	end

	def method_token(result)
		if result.payment_method
			result.payment_method.token
		else
			result.transaction.credit_card_details.token
		end
	end
end