soapy_cake 1.14.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/soapy_cake/admin.rb +10 -2
- data/lib/soapy_cake/admin_addedit.rb +4 -4
- data/lib/soapy_cake/admin_batched.rb +1 -1
- data/lib/soapy_cake/const.rb +23 -22
- data/lib/soapy_cake/response_value.rb +1 -1
- data/lib/soapy_cake/version.rb +1 -1
- data/spec/integration/soapy_cake/admin_track_spec.rb +1 -0
- data/spec/lib/soapy_cake/admin_spec.rb +7 -3
- data/spec/lib/soapy_cake/admin_track_spec.rb +1 -0
- data/spec/support/admin_method_example.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 975d77a9bebc36a642eb905204a727ac4b461c18
|
4
|
+
data.tar.gz: 515c4a92916f800774388ab2169d354f5052d2c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9209729dd365c22b06a09d96de5751a609a3b970b189fe9533f84721cc468886eb133ff9ca0dcba4d4df5cab50fb2139af16baa4eaaf5025659db77d46f75094
|
7
|
+
data.tar.gz: dfd5f4b2ff618af93fcd79d94ec9eb890186b52a9f41e042400a6f7911fadbb1809f3496b906e1022c08f25d499156008967cf4e04ebb8870ce977ef5a0e4a5c
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.3
|
data/lib/soapy_cake/admin.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
module SoapyCake
|
2
|
+
# rubocop:disable Metrics/ClassLength
|
2
3
|
class Admin < Client
|
3
4
|
include Helper
|
4
5
|
|
@@ -105,8 +106,15 @@ module SoapyCake
|
|
105
106
|
run Request.new(:admin, :addedit, :campaign, opts)
|
106
107
|
end
|
107
108
|
|
108
|
-
def add_blacklist(opts
|
109
|
-
|
109
|
+
def add_blacklist(opts)
|
110
|
+
require_params(opts, %i(blacklist_date))
|
111
|
+
|
112
|
+
run Request.new(
|
113
|
+
:admin,
|
114
|
+
:addedit,
|
115
|
+
:blacklist,
|
116
|
+
opts.merge(blacklist_date: (opts[:blacklist_date] + 1.day).to_s)
|
117
|
+
)
|
110
118
|
end
|
111
119
|
|
112
120
|
def affiliate_signup(opts = {})
|
@@ -47,7 +47,7 @@ module SoapyCake
|
|
47
47
|
payout_modification_type: 'change',
|
48
48
|
received_modification_type: 'change',
|
49
49
|
tags_modification_type: 'do_not_change'
|
50
|
-
}
|
50
|
+
}.freeze
|
51
51
|
|
52
52
|
REQUIRED_NEW_OFFER_PARAMS = %i(
|
53
53
|
hidden offer_status_id offer_type_id currency_id ssl click_cookie_days
|
@@ -56,18 +56,18 @@ module SoapyCake
|
|
56
56
|
enable_transaction_id_deduplication postbacks_only fire_global_pixel
|
57
57
|
fire_pixel_on_nonpaid_conversions offer_link thankyou_link from_lines
|
58
58
|
subject_lines
|
59
|
-
)
|
59
|
+
).freeze
|
60
60
|
|
61
61
|
REQUIRED_OFFER_PARAMS = %i(
|
62
62
|
advertiser_id vertical_id postback_url_ms_delay offer_contract_hidden
|
63
63
|
price_format_id received received_percentage payout tags
|
64
|
-
)
|
64
|
+
).freeze
|
65
65
|
|
66
66
|
REQUIRED_OFFER_CONTRACT_PARAMS = %i(
|
67
67
|
offer_id offer_contract_id offer_contract_name price_format_id payout received
|
68
68
|
received_percentage offer_link thankyou_link offer_contract_hidden
|
69
69
|
offer_contract_is_default use_fallback_targeting
|
70
|
-
)
|
70
|
+
).freeze
|
71
71
|
|
72
72
|
def add_offer(opts)
|
73
73
|
require_params(opts, REQUIRED_NEW_OFFER_PARAMS)
|
data/lib/soapy_cake/const.rb
CHANGED
@@ -1,17 +1,30 @@
|
|
1
1
|
module SoapyCake
|
2
2
|
module Const
|
3
|
+
# The ID mapping in the API docs is wrong, these values are taken from the UI.
|
4
|
+
CONVERSION_BEHAVIOUR_ID = {
|
5
|
+
system: 0,
|
6
|
+
adv_off: 1,
|
7
|
+
adv_no_aff: 2,
|
8
|
+
no_adv_aff: 3,
|
9
|
+
no_adv_no_aff: 4,
|
10
|
+
ignore: 5
|
11
|
+
}.freeze
|
12
|
+
|
13
|
+
OFFER_STATUS_ID = {
|
14
|
+
public: 1,
|
15
|
+
private: 2,
|
16
|
+
apply_to_run: 3,
|
17
|
+
inactive: 4
|
18
|
+
}.freeze
|
19
|
+
|
3
20
|
CONSTS = {
|
4
21
|
account_status_id: {
|
5
22
|
active: 1,
|
6
23
|
inactive: 2,
|
7
24
|
pending: 3
|
8
25
|
},
|
9
|
-
offer_status_id:
|
10
|
-
|
11
|
-
private: 2,
|
12
|
-
apply_to_run: 3,
|
13
|
-
inactive: 4
|
14
|
-
},
|
26
|
+
offer_status_id: OFFER_STATUS_ID,
|
27
|
+
status_id: OFFER_STATUS_ID,
|
15
28
|
offer_type_id: {
|
16
29
|
hosted: 1,
|
17
30
|
host_n_post: 2,
|
@@ -36,15 +49,9 @@ module SoapyCake
|
|
36
49
|
fixed: 4,
|
37
50
|
revshare: 5
|
38
51
|
},
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
adv_off: 1,
|
43
|
-
adv_no_aff: 2,
|
44
|
-
no_adv_aff: 3,
|
45
|
-
no_adv_no_aff: 4,
|
46
|
-
ignore: 5
|
47
|
-
},
|
52
|
+
conversion_behavior_id: CONVERSION_BEHAVIOUR_ID,
|
53
|
+
conversion_cap_behavior: CONVERSION_BEHAVIOUR_ID,
|
54
|
+
conversion_behavior_on_redirect: CONVERSION_BEHAVIOUR_ID,
|
48
55
|
cap_type_id: {
|
49
56
|
click: 1,
|
50
57
|
conversion: 2
|
@@ -67,12 +74,6 @@ module SoapyCake
|
|
67
74
|
inactive: 2,
|
68
75
|
hidden: 3
|
69
76
|
}
|
70
|
-
}
|
71
|
-
|
72
|
-
CONSTS.merge!(
|
73
|
-
conversion_cap_behavior: CONSTS[:conversion_behavior_id],
|
74
|
-
conversion_behavior_on_redirect: CONSTS[:conversion_behavior_id],
|
75
|
-
status_id: CONSTS[:offer_status_id]
|
76
|
-
)
|
77
|
+
}.freeze
|
77
78
|
end
|
78
79
|
end
|
data/lib/soapy_cake/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
RSpec.describe SoapyCake::Admin do
|
2
|
-
let(:opts) {
|
2
|
+
let(:opts) { nil }
|
3
3
|
let(:cake_opts) { opts }
|
4
4
|
let(:cake_method) { method }
|
5
5
|
|
@@ -88,7 +88,7 @@ RSpec.describe SoapyCake::Admin do
|
|
88
88
|
|
89
89
|
describe '#conversions' do
|
90
90
|
let(:method) { :conversions }
|
91
|
-
let(:cake_opts) {
|
91
|
+
let(:cake_opts) { { conversion_type: 'conversions' } }
|
92
92
|
it_behaves_like 'a cake admin method'
|
93
93
|
end
|
94
94
|
|
@@ -100,7 +100,7 @@ RSpec.describe SoapyCake::Admin do
|
|
100
100
|
describe '#events' do
|
101
101
|
let(:method) { :events }
|
102
102
|
let(:cake_method) { :conversions }
|
103
|
-
let(:cake_opts) {
|
103
|
+
let(:cake_opts) { { conversion_type: 'events' } }
|
104
104
|
it_behaves_like 'a cake admin method'
|
105
105
|
end
|
106
106
|
|
@@ -176,6 +176,10 @@ RSpec.describe SoapyCake::Admin do
|
|
176
176
|
describe '#add_blacklist' do
|
177
177
|
let(:method) { :add_blacklist }
|
178
178
|
let(:cake_method) { :blacklist }
|
179
|
+
let(:date) { Date.new(2015, 9, 3) }
|
180
|
+
let(:request) { double('request') }
|
181
|
+
let(:opts) { { blacklist_date: date } }
|
182
|
+
let(:cake_opts) { { blacklist_date: (date + 1.day).to_s } }
|
179
183
|
it_behaves_like 'a cake admin method'
|
180
184
|
end
|
181
185
|
end
|
@@ -6,6 +6,6 @@ RSpec.shared_examples_for 'a cake admin method' do
|
|
6
6
|
.with(:admin, service, cake_method, cake_opts || {}).and_return(request)
|
7
7
|
expect(subject).to receive(:run).with(request)
|
8
8
|
|
9
|
-
subject.public_send(method, *[cake_opts].compact)
|
9
|
+
subject.public_send(method, *[opts || cake_opts].compact)
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soapy_cake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|