Class: Minfraud::Components::Order
- Defined in:
- lib/minfraud/components/order.rb
Overview
Order corresponds to the order object of a minFraud request.
Instance Attribute Summary collapse
-
#affiliate_id ⇒ String?
The ID of the affiliate where the order is coming from.
-
#amount ⇒ Float?
The total order amount for the transaction before taxes and discounts.
-
#currency ⇒ String?
The ISO 4217 currency code for the currency used in the transaction.
-
#discount_code ⇒ String?
The discount code applied to the transaction.
-
#has_gift_message ⇒ Boolean?
Whether the purchaser included a gift message.
-
#is_gift ⇒ Boolean?
Whether order was marked as a gift by the purchaser.
-
#referrer_uri ⇒ String?
The URI of the referring site for this order.
-
#subaffiliate_id ⇒ String?
The ID of the sub-affiliate where the order is coming from.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Order
constructor
A new instance of Order.
Methods inherited from Base
Constructor Details
#initialize(params = {}) ⇒ Order
Returns a new instance of Order.
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_id ⇒ String?
The ID of the affiliate where the order is coming from. No specific format is required.
34 35 36 |
# File 'lib/minfraud/components/order.rb', line 34 def affiliate_id @affiliate_id end |
#amount ⇒ Float?
The total order amount for the transaction before taxes and discounts. The value must be at least 0 and at most 1e14 - 1.
15 16 17 |
# File 'lib/minfraud/components/order.rb', line 15 def amount @amount end |
#currency ⇒ String?
The ISO 4217 currency code for the currency used in the transaction.
22 23 24 |
# File 'lib/minfraud/components/order.rb', line 22 def currency @currency end |
#discount_code ⇒ String?
The discount code applied to the transaction. If multiple discount codes are used, please separate them with a comma.
28 29 30 |
# File 'lib/minfraud/components/order.rb', line 28 def discount_code @discount_code end |
#has_gift_message ⇒ Boolean?
Whether the purchaser included a gift message.
56 57 58 |
# File 'lib/minfraud/components/order.rb', line 56 def @has_gift_message end |
#is_gift ⇒ Boolean?
Whether order was marked as a gift by the purchaser.
51 52 53 |
# File 'lib/minfraud/components/order.rb', line 51 def is_gift @is_gift end |
#referrer_uri ⇒ String?
The URI of the referring site for this order. Needs to be absolute and have a URI scheme such as https://
.
46 47 48 |
# File 'lib/minfraud/components/order.rb', line 46 def referrer_uri @referrer_uri end |
#subaffiliate_id ⇒ String?
The ID of the sub-affiliate where the order is coming from. No specific format is required.
40 41 42 |
# File 'lib/minfraud/components/order.rb', line 40 def subaffiliate_id @subaffiliate_id end |