~singpolyma/jmp-pay

ref: fdedfcb0838f1f360b097e5fa4cba30122378987 jmp-pay/lib/three_d_secure_repo.rb -rw-r--r-- 380 bytes
fdedfcb0Stephen Paul Weber Stop storing 3DS ID 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class ThreeDSecureRepo
	class Failed < StandardError; end

	def put_from_payment_method(_customer_id, method)
		return unless method.verification # Already vaulted

		three_d = method.verification.three_d_secure_info
		if !three_d ||
		   (three_d.liability_shift_possible && !three_d.liability_shifted)
			raise Failed, method.token
		end
	end
end