Class: Minfraud::Components::CreditCard
- Defined in:
- lib/minfraud/components/credit_card.rb
Overview
CreditCard corresponds to the credit_card object of a minFraud request.
Instance Attribute Summary collapse
-
#avs_result ⇒ String?
The address verification system (AVS) check result, as returned to you by the credit card processor.
-
#bank_name ⇒ String?
The name of the issuing bank as provided by the end user.
-
#bank_phone_country_code ⇒ String?
The phone country code for the issuing bank as provided by the end user.
-
#bank_phone_number ⇒ String?
The phone number, without the country code, for the issuing bank as provided by the end user.
-
#country ⇒ String?
The two character ISO 3166-1 alpha-2 country code where the issuer of the card is located.
-
#cvv_result ⇒ String?
The card verification value (CVV) code as provided by the payment processor.
-
#issuer_id_number ⇒ String?
The issuer ID number for the credit card.
-
#last_digits ⇒ String?
The last two or four digits of the credit card number.
-
#token ⇒ String?
A token uniquely identifying the card.
-
#was_3d_secure_successful ⇒ Boolean?
Whether the outcome of 3-D Secure verification (e.g. SafeKey, SecureCode, Verified by Visa) was successful.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ CreditCard
constructor
A new instance of CreditCard.
-
#last_4_digits ⇒ String?
deprecated
Deprecated.
Use #last_digits instead.
-
#last_4_digits=(last4) ⇒ String?
deprecated
Deprecated.
Use #last_digits instead.
Methods inherited from Base
Constructor Details
#initialize(params = {}) ⇒ CreditCard
Returns a new instance of CreditCard.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/minfraud/components/credit_card.rb', line 108 def initialize(params = {}) @bank_phone_country_code = params[:bank_phone_country_code] @country = params[:country] @issuer_id_number = params[:issuer_id_number] @last_digits = params[:last_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] @was_3d_secure_successful = params[:was_3d_secure_successful] validate end |
Instance Attribute Details
#avs_result ⇒ String?
The address verification system (AVS) check result, as returned to you by the credit card processor. The minFraud service supports the standard AVS codes.
70 71 72 |
# File 'lib/minfraud/components/credit_card.rb', line 70 def avs_result @avs_result end |
#bank_name ⇒ String?
The name of the issuing bank as provided by the end user.
28 29 30 |
# File 'lib/minfraud/components/credit_card.rb', line 28 def bank_name @bank_name end |
#bank_phone_country_code ⇒ String?
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.
35 36 37 |
# File 'lib/minfraud/components/credit_card.rb', line 35 def bank_phone_country_code @bank_phone_country_code end |
#bank_phone_number ⇒ String?
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.
43 44 45 |
# File 'lib/minfraud/components/credit_card.rb', line 43 def bank_phone_number @bank_phone_number end |
#country ⇒ String?
The two character ISO 3166-1 alpha-2 country code where the issuer of the card is located. This may be passed instead of #issuer_id_number if you do not wish to pass partial account numbers, or if your payment processor does not provide them.
53 54 55 |
# File 'lib/minfraud/components/credit_card.rb', line 53 def country @country end |
#cvv_result ⇒ String?
The card verification value (CVV) code as provided by the payment processor.
76 77 78 |
# File 'lib/minfraud/components/credit_card.rb', line 76 def cvv_result @cvv_result end |
#issuer_id_number ⇒ String?
The issuer ID number for the credit card. This is the first 6 or 8 digits of the credit card number. It identifies the issuing bank.
15 16 17 |
# File 'lib/minfraud/components/credit_card.rb', line 15 def issuer_id_number @issuer_id_number end |
#last_digits ⇒ String?
The last two or four digits of the credit card number. In most cases,
you should send the last four digits for last_digits.
23 24 25 |
# File 'lib/minfraud/components/credit_card.rb', line 23 def last_digits @last_digits end |
#token ⇒ String?
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-.
63 64 65 |
# File 'lib/minfraud/components/credit_card.rb', line 63 def token @token end |
#was_3d_secure_successful ⇒ Boolean?
Whether the outcome of 3-D Secure verification (e.g. SafeKey,
SecureCode, Verified by Visa) was successful. true if customer
verification was successful, or false if the customer failed
verification. If 3-D Secure verification was not used, was unavailable,
or resulted in an outcome other than success or failure, do not
include this field.
86 87 88 |
# File 'lib/minfraud/components/credit_card.rb', line 86 def was_3d_secure_successful @was_3d_secure_successful end |
Instance Method Details
#last_4_digits ⇒ String?
Use #last_digits instead.
Get the last digits of the credit card number.
93 94 95 |
# File 'lib/minfraud/components/credit_card.rb', line 93 def last_4_digits @last_digits end |
#last_4_digits=(last4) ⇒ String?
Use #last_digits instead.
Set the last digits of the credit card number.
102 103 104 |
# File 'lib/minfraud/components/credit_card.rb', line 102 def last_4_digits=(last4) @last_digits = last4 end |