class PayCertify::Gateway::CreditCard

Constants

API_ENDPOINT
ATTRIBUTES
SAFE_CARD_REGEX

Public Instance Methods

attributes_to_gateway_format() click to toggle source
# File lib/paycertify/gateway/credit_card.rb, line 25
def attributes_to_gateway_format
  formatted = super
  attribute_mapping = PayCertify::Gateway::AttributeMapping

  formatted.merge! attribute_mapping.expiration_date(self)
  formatted.merge!({'TokenMode' => 'DEFAULT'})

  formatted
end
get_credit_card_id() click to toggle source
# File lib/paycertify/gateway/credit_card.rb, line 35
def get_credit_card_id
  response['response']['ext_data'].match(SAFE_CARD_REGEX)
  credit_card_id = $1
  credit_card_id.presence || response['response']['ext_data']['safe_card_token']
end
save!() click to toggle source
# File lib/paycertify/gateway/credit_card.rb, line 19
def save!
  super
  self.credit_card_id = get_credit_card_id
  self
end
success?() click to toggle source
# File lib/paycertify/gateway/credit_card.rb, line 15
def success?
  super && response['response']['result'] == '0'
end