three_d_secure_repo.rb

 1# frozen_string_literal: true
 2
 3class ThreeDSecureRepo
 4	class Failed < StandardError; end
 5
 6	def put_from_payment_method(_customer_id, method)
 7		return unless method.verification # Already vaulted
 8
 9		three_d = method.verification.three_d_secure_info
10		if !three_d ||
11		   (three_d.liability_shift_possible && !three_d.liability_shifted)
12			raise Failed, method.token
13		end
14	end
15end