class Minfraud::Components::Payment

Payment corresponds to the payment object of a minFraud request.

@see dev.maxmind.com/minfraud/#Payment_(/payment)

Attributes

decline_code[RW]

The decline code as provided by your payment processor. If the transaction was not declined, do not include this field.

@return [String, nil]

was_authorized[RW]

The authorization outcome from the payment processor. If the transaction has not yet been approved or denied, do not include this field.

@return [Boolean, nil]

Public Class Methods

new(params = {}) click to toggle source

@param params [Hash] Hash of parameters. Each key/value should

correspond to one of the available attributes.
# File lib/minfraud/components/payment.rb, line 176
def initialize(params = {})
  @was_authorized = params[:was_authorized]
  @decline_code   = params[:decline_code]
  self.processor  = params[:processor]

  validate
end

Private Instance Methods

validate() click to toggle source
# File lib/minfraud/components/payment.rb, line 186
def validate
  return if !Minfraud.enable_validation

  validate_boolean('was_authorized', @was_authorized)
  validate_string('decline_code', 255, @decline_code)
end