soapy_cake 1.5.2 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2587663bca8a1b766be60579664583098de67cb
4
- data.tar.gz: bc6335958a108391f9a8f69093e9ccbdc96701a6
3
+ metadata.gz: 958007dac1d1831b253d1e5b6a264679070df4a1
4
+ data.tar.gz: c7442bc681e1085f0217552921056d22f34a624e
5
5
  SHA512:
6
- metadata.gz: b058983ab7888a94463688e33c0da086f2ed2ea7d690ebb905de5b4d75d6b07308b3da70942e019bb77e63fdd96aef1f1dfea2c84a436af4234e487fdf17d756
7
- data.tar.gz: 0852d1b845d9e40d769de467945507a94d5bd13e074a44e6787c675671f272a31c5f26b4a3ed5ec89d1c7858e9ca412ade54308af27d9cd7d7f190de7b6ed4eb
6
+ metadata.gz: 71ab8c4c8d1c2f618c6580fadca8efcc857ab0e58d5c20922ad6ac393db55252da7de6573c901ff36da1aead38a477e561341c90a4ce4a27ca1cfdba31e052ce
7
+ data.tar.gz: 1afae96d75ad512a0db7ed37d826e503708cb211435b4f6dd92bb82140c41fcccec8599fa829f5deacc91711d7320b37f616e2736abfd932ebd240ed2341c960
@@ -21,7 +21,7 @@ admin:
21
21
  creative_files: 1
22
22
  exchange_rates: 1
23
23
  geo_targets: 2
24
- offer: 4
24
+ offer: 5
25
25
  offer_contract: 1
26
26
  offer_tiers: 1
27
27
  suppresion_list: 1
@@ -2,6 +2,54 @@ module SoapyCake
2
2
  class AdminAddedit < Client
3
3
  include Helper
4
4
 
5
+ OFFER_DEFAULT_OPTIONS = {
6
+ offer_name: '',
7
+ third_party_name: '',
8
+ hidden: 'no_change',
9
+ offer_status_id: 0,
10
+ ssl: 'no_change',
11
+ click_cookie_days: -1,
12
+ impression_cookie_days: -1,
13
+ redirect_offer_contract_id: 0,
14
+ redirect_404: 'no_change',
15
+ enable_view_thru_conversions: 'no_change',
16
+ click_trumps_impression: 'no_change',
17
+ disable_click_deduplication: 'no_change',
18
+ last_touch: 'no_change',
19
+ enable_transaction_id_deduplication: 'no_change',
20
+ postbacks_only: 'no_change',
21
+ pixel_html: '',
22
+ postback_url: '',
23
+ fire_global_pixel: 'no_change',
24
+ fire_pixel_on_nonpaid_conversions: 'no_change',
25
+ expiration_date_modification_type: 'do_not_change',
26
+ offer_contract_name: '',
27
+ offer_link: '',
28
+ thankyou_link: '',
29
+ preview_link: '',
30
+ thumbnail_file_import_url: '',
31
+ offer_description: '',
32
+ restrictions: '',
33
+ advertiser_extended_terms: '',
34
+ testing_instructions: '',
35
+ allow_affiliates_to_create_creatives: 'no_change',
36
+ unsubscribe_link: '',
37
+ from_lines: '',
38
+ subject_lines: '',
39
+ conversions_from_whitelist_only: 'off',
40
+ allowed_media_type_modification_type: 'do_not_change',
41
+ track_search_terms_from_non_supported_search_engines: 'off',
42
+ auto_disposition_type: 'none',
43
+ auto_disposition_delay_hours: '0',
44
+ session_regeneration_seconds: -1,
45
+ session_regeneration_type_id: 0,
46
+ redirect_domain: '',
47
+ cookie_domain: '',
48
+ payout_modification_type: 'change',
49
+ received_modification_type: 'change',
50
+ tags_modification_type: 'do_not_change'
51
+ }
52
+
5
53
  def add_offer(opts = {})
6
54
  require_params(opts, %i(
7
55
  hidden offer_status_id offer_type_id currency_id ssl click_cookie_days
@@ -99,7 +147,15 @@ module SoapyCake
99
147
  advertiser_id vertical_id postback_url_ms_delay offer_contract_hidden
100
148
  price_format_id received received_percentage payout tags))
101
149
 
102
- opts[:tags] = Array(opts[:tags]).join(', ')
150
+ if opts[:tags]
151
+ if opts[:tags].to_s == ''
152
+ opts[:tags_modification_type] = 'remove_all'
153
+ opts[:tags] = ''
154
+ else
155
+ opts[:tags_modification_type] = opts[:offer_id] ? 'add' : 'replace'
156
+ opts[:tags] = Array(opts[:tags]).join(',')
157
+ end
158
+ end
103
159
 
104
160
  opts.each do |k, v|
105
161
  opts[k] = 'on' if v == true
@@ -113,43 +169,11 @@ module SoapyCake
113
169
  opts[key] = const_lookup(:conversion_behaviour_id, opts[key])
114
170
  end
115
171
 
172
+ opts.reverse_merge!(OFFER_DEFAULT_OPTIONS)
116
173
  opts.reverse_merge!(
117
- offer_name: '',
118
- third_party_name: '',
119
- hidden: 'no_change',
120
- offer_status_id: 0,
121
- ssl: 'no_change',
122
- click_cookie_days: -1,
123
- impression_cookie_days: -1,
124
- redirect_offer_contract_id: 0,
125
- redirect_404: 'no_change',
126
- enable_view_thru_conversions: 'no_change',
127
- click_trumps_impression: 'no_change',
128
- disable_click_deduplication: 'no_change',
129
- last_touch: 'no_change',
130
- enable_transaction_id_deduplication: 'no_change',
131
- postbacks_only: 'no_change',
132
- pixel_html: '',
133
- postback_url: '',
134
- fire_global_pixel: 'no_change',
135
- fire_pixel_on_nonpaid_conversions: 'no_change',
136
174
  conversion_cap_behavior: const_lookup(:conversion_behaviour_id, :system),
137
175
  conversion_behavior_on_redirect: const_lookup(:conversion_behaviour_id, :system),
138
- expiration_date: Date.today + (365 * 100),
139
- expiration_date_modification_type: 'do_not_change',
140
- offer_contract_name: '',
141
- offer_link: '',
142
- thankyou_link: '',
143
- preview_link: '',
144
- thumbnail_file_import_url: '',
145
- offer_description: '',
146
- restrictions: '',
147
- advertiser_extended_terms: '',
148
- testing_instructions: '',
149
- allow_affiliates_to_create_creatives: 'no_change',
150
- unsubscribe_link: '',
151
- from_lines: '',
152
- subject_lines: ''
176
+ expiration_date: Date.today + (365 * 100)
153
177
  )
154
178
 
155
179
  run(Request.new(:admin, :addedit, :offer, opts))[:success_info]
@@ -1,3 +1,3 @@
1
1
  module SoapyCake
2
- VERSION = '1.5.2'
2
+ VERSION = '1.6.0'
3
3
  end
@@ -2,12 +2,12 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://cake-partner-domain.com/api/4/addedit.asmx
5
+ uri: https://cake-partner-domain.com/api/5/addedit.asmx
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |
9
9
  <?xml version="1.0"?>
10
- <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/4/">
10
+ <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/5/">
11
11
  <env:Header/>
12
12
  <env:Body>
13
13
  <cake:Offer>
@@ -42,24 +42,36 @@ http_interactions:
42
42
  <cake:received>2.0</cake:received>
43
43
  <cake:received_percentage>off</cake:received_percentage>
44
44
  <cake:payout>1.5</cake:payout>
45
- <cake:tags>some, tags</cake:tags>
45
+ <cake:tags>some,tags</cake:tags>
46
46
  <cake:offer_name>Test Offer</cake:offer_name>
47
47
  <cake:offer_description>TEST1</cake:offer_description>
48
48
  <cake:restrictions>TEST2</cake:restrictions>
49
49
  <cake:advertiser_extended_terms>TEST3</cake:advertiser_extended_terms>
50
50
  <cake:testing_instructions>TEST4</cake:testing_instructions>
51
51
  <cake:offer_id>0</cake:offer_id>
52
+ <cake:tags_modification_type>add</cake:tags_modification_type>
52
53
  <cake:third_party_name/>
53
54
  <cake:redirect_offer_contract_id>0</cake:redirect_offer_contract_id>
54
55
  <cake:pixel_html/>
55
56
  <cake:postback_url/>
56
- <cake:expiration_date>2115-01-24T01:00:00</cake:expiration_date>
57
57
  <cake:expiration_date_modification_type>do_not_change</cake:expiration_date_modification_type>
58
58
  <cake:offer_contract_name/>
59
59
  <cake:preview_link/>
60
60
  <cake:thumbnail_file_import_url/>
61
61
  <cake:allow_affiliates_to_create_creatives>no_change</cake:allow_affiliates_to_create_creatives>
62
62
  <cake:unsubscribe_link/>
63
+ <cake:conversions_from_whitelist_only>off</cake:conversions_from_whitelist_only>
64
+ <cake:allowed_media_type_modification_type>do_not_change</cake:allowed_media_type_modification_type>
65
+ <cake:track_search_terms_from_non_supported_search_engines>off</cake:track_search_terms_from_non_supported_search_engines>
66
+ <cake:auto_disposition_type>none</cake:auto_disposition_type>
67
+ <cake:auto_disposition_delay_hours>0</cake:auto_disposition_delay_hours>
68
+ <cake:session_regeneration_seconds>-1</cake:session_regeneration_seconds>
69
+ <cake:session_regeneration_type_id>0</cake:session_regeneration_type_id>
70
+ <cake:redirect_domain/>
71
+ <cake:cookie_domain/>
72
+ <cake:payout_modification_type>change</cake:payout_modification_type>
73
+ <cake:received_modification_type>change</cake:received_modification_type>
74
+ <cake:expiration_date>2115-01-24T01:00:00</cake:expiration_date>
63
75
  </cake:Offer>
64
76
  </env:Body>
65
77
  </env:Envelope>
@@ -82,15 +94,15 @@ http_interactions:
82
94
  X-Powered-By:
83
95
  - ASP.NET
84
96
  Date:
85
- - Fri, 27 Mar 2015 10:53:05 GMT
97
+ - Thu, 02 Apr 2015 09:39:11 GMT
86
98
  Content-Length:
87
99
  - '563'
88
100
  body:
89
101
  encoding: UTF-8
90
102
  string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
91
103
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><OfferResponse
92
- xmlns="http://cakemarketing.com/api/4/"><OfferResult><success>true</success><message>Offer
93
- 9497 Created</message><success_info><offer_id>9497</offer_id><offer_contract_id>3552</offer_contract_id><campaign_id>15404</campaign_id><creative_id>10018</creative_id></success_info></OfferResult></OfferResponse></soap:Body></soap:Envelope>
104
+ xmlns="http://cakemarketing.com/api/5/"><OfferResult><success>true</success><message>Offer
105
+ 9613 Created</message><success_info><offer_id>9613</offer_id><offer_contract_id>4000</offer_contract_id><campaign_id>15852</campaign_id><creative_id>10134</creative_id></success_info></OfferResult></OfferResponse></soap:Body></soap:Envelope>
94
106
  http_version:
95
107
  recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
96
108
  recorded_with: VCR 2.9.3
@@ -2,12 +2,12 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://cake-partner-domain.com/api/4/addedit.asmx
5
+ uri: https://cake-partner-domain.com/api/5/addedit.asmx
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |
9
9
  <?xml version="1.0"?>
10
- <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/4/">
10
+ <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/5/">
11
11
  <env:Header/>
12
12
  <env:Body>
13
13
  <cake:Offer>
@@ -22,6 +22,7 @@ http_interactions:
22
22
  <cake:received_percentage>off</cake:received_percentage>
23
23
  <cake:payout>1.5</cake:payout>
24
24
  <cake:tags/>
25
+ <cake:tags_modification_type>remove_all</cake:tags_modification_type>
25
26
  <cake:offer_name/>
26
27
  <cake:third_party_name/>
27
28
  <cake:hidden>no_change</cake:hidden>
@@ -41,9 +42,6 @@ http_interactions:
41
42
  <cake:postback_url/>
42
43
  <cake:fire_global_pixel>no_change</cake:fire_global_pixel>
43
44
  <cake:fire_pixel_on_nonpaid_conversions>no_change</cake:fire_pixel_on_nonpaid_conversions>
44
- <cake:conversion_cap_behavior>0</cake:conversion_cap_behavior>
45
- <cake:conversion_behavior_on_redirect>0</cake:conversion_behavior_on_redirect>
46
- <cake:expiration_date>2115-01-24T01:00:00</cake:expiration_date>
47
45
  <cake:expiration_date_modification_type>do_not_change</cake:expiration_date_modification_type>
48
46
  <cake:offer_contract_name/>
49
47
  <cake:offer_link/>
@@ -58,6 +56,20 @@ http_interactions:
58
56
  <cake:unsubscribe_link/>
59
57
  <cake:from_lines/>
60
58
  <cake:subject_lines/>
59
+ <cake:conversions_from_whitelist_only>off</cake:conversions_from_whitelist_only>
60
+ <cake:allowed_media_type_modification_type>do_not_change</cake:allowed_media_type_modification_type>
61
+ <cake:track_search_terms_from_non_supported_search_engines>off</cake:track_search_terms_from_non_supported_search_engines>
62
+ <cake:auto_disposition_type>none</cake:auto_disposition_type>
63
+ <cake:auto_disposition_delay_hours>0</cake:auto_disposition_delay_hours>
64
+ <cake:session_regeneration_seconds>-1</cake:session_regeneration_seconds>
65
+ <cake:session_regeneration_type_id>0</cake:session_regeneration_type_id>
66
+ <cake:redirect_domain/>
67
+ <cake:cookie_domain/>
68
+ <cake:payout_modification_type>change</cake:payout_modification_type>
69
+ <cake:received_modification_type>change</cake:received_modification_type>
70
+ <cake:conversion_cap_behavior>0</cake:conversion_cap_behavior>
71
+ <cake:conversion_behavior_on_redirect>0</cake:conversion_behavior_on_redirect>
72
+ <cake:expiration_date>2115-01-24T01:00:00</cake:expiration_date>
61
73
  </cake:Offer>
62
74
  </env:Body>
63
75
  </env:Envelope>
@@ -80,16 +92,16 @@ http_interactions:
80
92
  X-Powered-By:
81
93
  - ASP.NET
82
94
  Date:
83
- - Tue, 17 Feb 2015 13:19:09 GMT
95
+ - Thu, 02 Apr 2015 09:39:11 GMT
84
96
  Content-Length:
85
97
  - '559'
86
98
  body:
87
99
  encoding: UTF-8
88
100
  string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
89
101
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><OfferResponse
90
- xmlns="http://cakemarketing.com/api/4/"><OfferResult><success>true</success><message>Offer
102
+ xmlns="http://cakemarketing.com/api/5/"><OfferResult><success>true</success><message>Offer
91
103
  8910 Updated</message><success_info><offer_id>8910</offer_id><offer_contract_id>1455</offer_contract_id><campaign_id
92
104
  xsi:nil="true" /><creative_id xsi:nil="true" /></success_info></OfferResult></OfferResponse></soap:Body></soap:Envelope>
93
105
  http_version:
94
- recorded_at: Tue, 17 Feb 2015 13:19:11 GMT
106
+ recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
95
107
  recorded_with: VCR 2.9.3
@@ -55,9 +55,9 @@ RSpec.describe 'ADDEDIT integration test' do
55
55
  )
56
56
 
57
57
  expect(result).to include(
58
- creative_id: 10018,
59
- offer_contract_id: 3552,
60
- offer_id: 9497
58
+ creative_id: 10134,
59
+ offer_contract_id: 4000,
60
+ offer_id: 9613
61
61
  )
62
62
  end
63
63
 
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.5.2
4
+ version: 1.6.0
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-03-31 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  version: '0'
230
230
  requirements: []
231
231
  rubyforge_project:
232
- rubygems_version: 2.4.6
232
+ rubygems_version: 2.4.5
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: Simple client for the CAKE API