Class: Minfraud::Components::CreditCard

Inherits:
Base
  • Object
show all
Defined in:
lib/minfraud/components/credit_card.rb

Overview

CreditCard corresponds to the credit_card object of a minFraud request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_json

Constructor Details

#initialize(params = {}) ⇒ CreditCard

Returns a new instance of CreditCard.

Parameters:

  • params (Hash) (defaults to: {})

    Hash of parameters. Each key/value should correspond to one of the available attributes.



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/minfraud/components/credit_card.rb', line 67

def initialize(params = {})
  @bank_phone_country_code = params[:bank_phone_country_code]
  @issuer_id_number        = params[:issuer_id_number]
  @last_4_digits           = params[:last_4_digits]
  @bank_name               = params[:bank_name]
  @bank_phone_number       = params[:bank_phone_number]
  @avs_result              = params[:avs_result]
  @cvv_result              = params[:cvv_result]
  @token                   = params[:token]

  validate
end

Instance Attribute Details

#avs_resultString?

The address verification system (AVS) check result, as returned to you by the credit card processor. The minFraud service supports the standard AVS codes.

Returns:

  • (String, nil)


57
58
59
# File 'lib/minfraud/components/credit_card.rb', line 57

def avs_result
  @avs_result
end

#bank_nameString?

The name of the issuing bank as provided by the end user.

Returns:

  • (String, nil)


25
26
27
# File 'lib/minfraud/components/credit_card.rb', line 25

def bank_name
  @bank_name
end

#bank_phone_country_codeString?

The phone country code for the issuing bank as provided by the end user. If you provide this information then you must provide at least one digit.

Returns:

  • (String, nil)


32
33
34
# File 'lib/minfraud/components/credit_card.rb', line 32

def bank_phone_country_code
  @bank_phone_country_code
end

#bank_phone_numberString?

The phone number, without the country code, for the issuing bank as provided by the end user. Punctuation characters will be stripped. After stripping punctuation characters, the number must contain only digits.

Returns:

  • (String, nil)


40
41
42
# File 'lib/minfraud/components/credit_card.rb', line 40

def bank_phone_number
  @bank_phone_number
end

#cvv_resultString?

The card verification value (CVV) code as provided by the payment processor.

Returns:

  • (String, nil)


63
64
65
# File 'lib/minfraud/components/credit_card.rb', line 63

def cvv_result
  @cvv_result
end

#issuer_id_numberString?

The issuer ID number for the credit card. This is the first 6 digits of the credit card number. It identifies the issuing bank.

Returns:

  • (String, nil)


15
16
17
# File 'lib/minfraud/components/credit_card.rb', line 15

def issuer_id_number
  @issuer_id_number
end

#last_4_digitsString?

The last four digits of the credit card number.

Returns:

  • (String, nil)


20
21
22
# File 'lib/minfraud/components/credit_card.rb', line 20

def last_4_digits
  @last_4_digits
end

#tokenString?

A token uniquely identifying the card. The token should consist of non-space printable ASCII characters. If the token is all digits, it must be more than 19 characters long. The token must not be a primary account number (PAN) or a simple transformation of it. If you have a valid token that looks like a PAN but is not one, you may prefix that token with a fixed string, e.g., token-.

Returns:

  • (String, nil)


50
51
52
# File 'lib/minfraud/components/credit_card.rb', line 50

def token
  @token
end