Module: SolidusNexio::CreditCardDecorator

Defined in:
app/decorators/models/solidus_nexio/credit_card_decorator.rb

Instance Method Summary collapse

Instance Method Details

#clean_nexio_cvvObject



16
17
18
# File 'app/decorators/models/solidus_nexio/credit_card_decorator.rb', line 16

def clean_nexio_cvv
  update_column(:gateway_customer_profile_id, nil) if gateway_customer_profile_id
end

#encrypt_nexio_cvvObject

CVV stored encrypted till payment is made, after that #clean_nexio_cvv is called



4
5
6
7
8
# File 'app/decorators/models/solidus_nexio/credit_card_decorator.rb', line 4

def encrypt_nexio_cvv
  return unless verification_value

  update_column(:gateway_customer_profile_id, ::SolidusNexio::EncryptionService.encrypt(last_digits, verification_value))
end

#nexio_cvvObject



10
11
12
13
14
# File 'app/decorators/models/solidus_nexio/credit_card_decorator.rb', line 10

def nexio_cvv
  return unless gateway_customer_profile_id.present?

  ::SolidusNexio::EncryptionService.decrypt(last_digits, gateway_customer_profile_id)
end