diff --git a/lib/three_d_secure_repo.rb b/lib/three_d_secure_repo.rb index e66a9dc68f4cea4f9abe40b89f927541248f4c09..c71ebecb990ca3879fe5ab09f9569e14a0a135ba 100644 --- a/lib/three_d_secure_repo.rb +++ b/lib/three_d_secure_repo.rb @@ -3,23 +3,7 @@ class ThreeDSecureRepo class Failed < StandardError; end - def initialize(redis: REDIS) - @redis = redis - end - - def find(customer_id, token) - redis(:hget, customer_id, token) - end - - def put(customer_id, token, authid) - if !authid || authid.empty? - redis(:hdel, customer_id, token) - else - redis(:hset, customer_id, token, authid) - end - end - - def put_from_payment_method(customer_id, method) + def put_from_payment_method(_customer_id, method) return unless method.verification # Already vaulted three_d = method.verification.three_d_secure_info @@ -27,20 +11,5 @@ class ThreeDSecureRepo (three_d.liability_shift_possible && !three_d.liability_shifted) raise Failed, method.token end - - put( - customer_id, method.token, - three_d.three_d_secure_authentication_id - ) - end - -protected - - def redis(action, customer_id, *args) - @redis.public_send( - action, - "jmp_customer_three_d_secure_authentication_id-#{customer_id}", - *args - ) end end