Class: AffiliateWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/affiliate_window/base.rb,
lib/affiliate_window/client.rb,
lib/affiliate_window/parser.rb,
lib/affiliate_window/version.rb,
lib/affiliate_window/error_handler.rb

Overview

For full API documentation, refer to: wiki.affiliatewindow.com/index.php/Publisher_Service_API

Defined Under Namespace

Modules: ErrorHandler, Parser Classes: Client, Error, UnknownQuotaError

Constant Summary collapse

VERSION =
"0.1.0"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:, error_handler: ErrorHandler, parser: Parser) ⇒ AffiliateWindow

Returns a new instance of AffiliateWindow.



16
17
18
19
20
# File 'lib/affiliate_window/base.rb', line 16

def initialize(client:, error_handler: ErrorHandler, parser: Parser)
  self.client = client
  self.error_handler = error_handler
  self.parser = parser
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



5
6
7
# File 'lib/affiliate_window/base.rb', line 5

def client
  @client
end

#debugObject

Returns the value of attribute debug.



5
6
7
# File 'lib/affiliate_window/base.rb', line 5

def debug
  @debug
end

#error_handlerObject

Returns the value of attribute error_handler.



5
6
7
# File 'lib/affiliate_window/base.rb', line 5

def error_handler
  @error_handler
end

#parserObject

Returns the value of attribute parser.



5
6
7
# File 'lib/affiliate_window/base.rb', line 5

def parser
  @parser
end

#remaining_quotaObject

Returns the value of attribute remaining_quota.



5
6
7
# File 'lib/affiliate_window/base.rb', line 5

def remaining_quota
  @remaining_quota
end

Class Method Details

.login(account_id:, affiliate_api_password:) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/affiliate_window/base.rb', line 7

def self.(account_id:, affiliate_api_password:)
  client = Client.new(
    account_id: ,
    affiliate_api_password: affiliate_api_password,
  )

  new(client: client)
end

Instance Method Details

#get_click_stats(start_date:, end_date:, merchant_ids: nil, date_type:, offset: nil, limit: nil) ⇒ Object

Gets the requested link click stats wiki.affiliatewindow.com/index.php/AS:getClickStats



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/affiliate_window/base.rb', line 91

def get_click_stats(start_date:, end_date:, merchant_ids: nil, date_type:, offset: nil, limit: nil)
  call(
    :get_click_stats,
    dStartDate: start_date,
    dEndDate: end_date,
    aMerchantIds: merchant_ids,
    sDateType: date_type,
    iOffset: offset,
    iLimit: limit,
  )
end

#get_commission_group(merchant_id:, commission_group_code:) ⇒ Object

Gets the commission values for a given commission group and advertiser wiki.affiliatewindow.com/index.php/AS:getCommissionGroup



24
25
26
27
28
29
30
# File 'lib/affiliate_window/base.rb', line 24

def get_commission_group(merchant_id:, commission_group_code:)
  call(
    :get_commission_group,
    iMerchantId: merchant_id,
    sCommissionGroupCode: commission_group_code,
  )
end

#get_commission_group_list(merchant_id:) ⇒ Object

Gets an array of commission groups for an advertiser wiki.affiliatewindow.com/index.php/AS:getCommissionGroupList



34
35
36
# File 'lib/affiliate_window/base.rb', line 34

def get_commission_group_list(merchant_id:)
  call(:get_commission_group_list, iMerchantId: merchant_id)
end

#get_impression_stats(start_date:, end_date:, merchant_ids: nil, date_type:, offset: nil, limit: nil) ⇒ Object

Gets the requested link impression stats wiki.affiliatewindow.com/index.php/AS:getImpressionStats



105
106
107
108
109
110
111
112
113
114
115
# File 'lib/affiliate_window/base.rb', line 105

def get_impression_stats(start_date:, end_date:, merchant_ids: nil, date_type:, offset: nil, limit: nil)
  call(
    :get_impression_stats,
    dStartDate: start_date,
    dEndDate: end_date,
    aMerchantIds: merchant_ids,
    sDateType: date_type,
    iOffset: offset,
    iLimit: limit,
  )
end

#get_merchant(merchant_ids:) ⇒ Object

Gets the requested advertisers wiki.affiliatewindow.com/index.php/AS:getMerchant



66
67
68
# File 'lib/affiliate_window/base.rb', line 66

def get_merchant(merchant_ids:)
  call(:get_merchant, aMerchantIds: merchant_ids)
end

#get_merchant_list(relationship: nil) ⇒ Object

Gets the advertisers that fall under the specified criteria wiki.affiliatewindow.com/index.php/AS:getMerchantList



72
73
74
# File 'lib/affiliate_window/base.rb', line 72

def get_merchant_list(relationship: nil)
  call(:get_merchant_list, sRelationship: relationship)
end

#get_transaction(transaction_ids:) ⇒ Object



60
61
62
# File 'lib/affiliate_window/base.rb', line 60

def get_transaction(transaction_ids:)
  call(:get_transaction, aTransactionIds: transaction_ids)
end

#get_transaction_list(merchant_ids: nil, start_date:, end_date:, date_type:, transaction_status: nil, limit: nil, offset: nil) ⇒ Object

Gets the transactions that fall under the specified criteria wiki.affiliatewindow.com/index.php/AS:getTransactionList



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/affiliate_window/base.rb', line 45

def get_transaction_list(merchant_ids: nil, start_date:, end_date:, date_type:, transaction_status: nil, limit: nil, offset: nil)
  call(
    :get_transaction_list,
    aMerchantIds: merchant_ids,
    dStartDate: start_date,
    dEndDate: end_date,
    sDateType: date_type,
    sTransactionStatus: transaction_status,
    iLimit: limit,
    iOffset: offset,
  )
end

#get_transaction_product(transaction_ids:) ⇒ Object

Gets products for the specified transaction # wiki.affiliatewindow.com/index.php/AS:getTransactionProduct



39
40
41
# File 'lib/affiliate_window/base.rb', line 39

def get_transaction_product(transaction_ids:)
  call(:get_transaction_product, aTransactionIds: transaction_ids)
end

#get_transaction_queries(merchant_ids: nil, status: nil, click_refs:, offset: nil, limit: nil) ⇒ Object

Gets the requested transaction queries wiki.affiliatewindow.com/index.php/AS:getTransactionQuerys



78
79
80
81
82
83
84
85
86
87
# File 'lib/affiliate_window/base.rb', line 78

def get_transaction_queries(merchant_ids: nil, status: nil, click_refs:, offset: nil, limit: nil)
  call(
    :get_transaction_queries,
    aMerchantIds: merchant_ids,
    aStatus: status,
    aClickRefs: click_refs,
    iOffset: offset,
    iLimit: limit,
  )
end