Class: Minfraud::Components::Order

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

Overview

Order corresponds to the order object of a minFraud request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_json

Constructor Details

#initialize(params = {}) ⇒ Order

Returns a new instance of Order.

Parameters:

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

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



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/minfraud/components/order.rb', line 60

def initialize(params = {})
  @amount           = params[:amount]
  @has_gift_message = params[:has_gift_message]
  @affiliate_id     = params[:affiliate_id]
  @subaffiliate_id  = params[:subaffiliate_id]
  @currency         = params[:currency]
  @discount_code    = params[:discount_code]
  @referrer_uri     = params[:referrer_uri]
  @is_gift          = params[:is_gift]

  validate
end

Instance Attribute Details

#affiliate_idString?

The ID of the affiliate where the order is coming from. No specific format is required.

Returns:

  • (String, nil)


34
35
36
# File 'lib/minfraud/components/order.rb', line 34

def affiliate_id
  @affiliate_id
end

#amountFloat?

The total order amount for the transaction before taxes and discounts. The value must be at least 0 and at most 1e14 - 1.

Returns:

  • (Float, nil)


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

def amount
  @amount
end

#currencyString?

The ISO 4217 currency code for the currency used in the transaction.

Returns:

  • (String, nil)

See Also:



22
23
24
# File 'lib/minfraud/components/order.rb', line 22

def currency
  @currency
end

#discount_codeString?

The discount code applied to the transaction. If multiple discount codes are used, please separate them with a comma.

Returns:

  • (String, nil)


28
29
30
# File 'lib/minfraud/components/order.rb', line 28

def discount_code
  @discount_code
end

#has_gift_messageBoolean?

Whether the purchaser included a gift message.

Returns:

  • (Boolean, nil)


56
57
58
# File 'lib/minfraud/components/order.rb', line 56

def has_gift_message
  @has_gift_message
end

#is_giftBoolean?

Whether order was marked as a gift by the purchaser.

Returns:

  • (Boolean, nil)


51
52
53
# File 'lib/minfraud/components/order.rb', line 51

def is_gift
  @is_gift
end

#referrer_uriString?

The URI of the referring site for this order. Needs to be absolute and have a URI scheme such as https://.

Returns:

  • (String, nil)


46
47
48
# File 'lib/minfraud/components/order.rb', line 46

def referrer_uri
  @referrer_uri
end

#subaffiliate_idString?

The ID of the sub-affiliate where the order is coming from. No specific format is required.

Returns:

  • (String, nil)


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

def subaffiliate_id
  @subaffiliate_id
end