soapy_cake 1.11.2 → 1.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soapy_cake/admin_addedit.rb +9 -0
- data/lib/soapy_cake/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_/_offer_contract_caps/removes_a_cap_for_an_offer_contract.yml +53 -0
- data/spec/integration/soapy_cake/admin_addedit_spec.rb +9 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e10479da39d209535afba222d2c975964e62adf2
|
4
|
+
data.tar.gz: 60a0ba81e32a667e45f209052dcd2f22fd06ae22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8956d60d85b7be6b89a0365780b5628d87707267888b97126d4e9fd4dd08620657a9803fb5cbb9a5d4df92763a19e5d5f13036a80639d6222ec32fb5ea0fe4f9
|
7
|
+
data.tar.gz: 582185de03414f3e0238b95f37cec415824e0691c4acc393574fe1b365b9d5a4d717df42bba43af2961c0755400b40339cfa2e9e7963bb00b70ef50e6d73d845
|
@@ -136,6 +136,15 @@ module SoapyCake
|
|
136
136
|
run Request.new(:admin, :addedit, :caps, opts)
|
137
137
|
end
|
138
138
|
|
139
|
+
def remove_caps(opts)
|
140
|
+
require_params(opts, %i(cap_type_id))
|
141
|
+
|
142
|
+
translate_values!(opts, %i(cap_type_id))
|
143
|
+
|
144
|
+
opts.merge!(cap_interval_id: 0, cap_amount: -1, send_alert_only: false)
|
145
|
+
run Request.new(:admin, :addedit, :caps, opts)
|
146
|
+
end
|
147
|
+
|
139
148
|
def add_offer_tier(opts)
|
140
149
|
require_params(opts, %i(offer_id tier_id price_format_id offer_contract_id status_id))
|
141
150
|
|
data/lib/soapy_cake/version.rb
CHANGED
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://cake-partner-domain.com/api/1/addedit.asmx
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0"?>
|
10
|
+
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:cake="http://cakemarketing.com/api/1/">
|
11
|
+
<env:Header/>
|
12
|
+
<env:Body>
|
13
|
+
<cake:Caps>
|
14
|
+
<cake:api_key>cake-api-key</cake:api_key>
|
15
|
+
<cake:offer_contract_id>1456</cake:offer_contract_id>
|
16
|
+
<cake:cap_type_id>2</cake:cap_type_id>
|
17
|
+
<cake:cap_interval_id>0</cake:cap_interval_id>
|
18
|
+
<cake:cap_amount>-1</cake:cap_amount>
|
19
|
+
<cake:send_alert_only>false</cake:send_alert_only>
|
20
|
+
</cake:Caps>
|
21
|
+
</env:Body>
|
22
|
+
</env:Envelope>
|
23
|
+
headers:
|
24
|
+
Content-Type:
|
25
|
+
- application/soap+xml;charset=UTF-8
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Cache-Control:
|
32
|
+
- private, max-age=0
|
33
|
+
Content-Type:
|
34
|
+
- application/soap+xml; charset=utf-8
|
35
|
+
Server:
|
36
|
+
- Microsoft-IIS/8.0
|
37
|
+
X-Aspnet-Version:
|
38
|
+
- 4.0.30319
|
39
|
+
X-Powered-By:
|
40
|
+
- ASP.NET
|
41
|
+
Date:
|
42
|
+
- Wed, 29 Jul 2015 16:01:14 GMT
|
43
|
+
Content-Length:
|
44
|
+
- '391'
|
45
|
+
body:
|
46
|
+
encoding: UTF-8
|
47
|
+
string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
|
48
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CapsResponse
|
49
|
+
xmlns="http://cakemarketing.com/api/1/"><CapsResult><success>true</success><message>Cap
|
50
|
+
Updated</message></CapsResult></CapsResponse></soap:Body></soap:Envelope>
|
51
|
+
http_version:
|
52
|
+
recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
|
53
|
+
recorded_with: VCR 2.9.3
|
@@ -218,6 +218,15 @@ RSpec.describe SoapyCake::AdminAddedit do
|
|
218
218
|
|
219
219
|
expect(result[:message]).to eq('Cap Updated')
|
220
220
|
end
|
221
|
+
|
222
|
+
it 'removes a cap for an offer contract', :vcr do
|
223
|
+
result = subject.remove_caps(
|
224
|
+
offer_contract_id: offer_contract_id,
|
225
|
+
cap_type_id: :conversion
|
226
|
+
)
|
227
|
+
|
228
|
+
expect(result[:message]).to eq('Cap Updated')
|
229
|
+
end
|
221
230
|
end
|
222
231
|
|
223
232
|
describe 'offer tiers' do
|
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.11.
|
4
|
+
version: 1.11.3
|
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-07-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -206,6 +206,7 @@ files:
|
|
206
206
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/edits_a_campaign.yml
|
207
207
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/contacts/edits_a_contact.yml
|
208
208
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/geo_targeting/creates_geo_targetings.yml
|
209
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_/_offer_contract_caps/removes_a_cap_for_an_offer_contract.yml
|
209
210
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_/_offer_contract_caps/updates_a_cap_for_an_offer_contract.yml
|
210
211
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_contracts/creates_an_offer_contract.yml
|
211
212
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_contracts/updates_an_offer_contract.yml
|
@@ -262,6 +263,7 @@ test_files:
|
|
262
263
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/campaigns/edits_a_campaign.yml
|
263
264
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/contacts/edits_a_contact.yml
|
264
265
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/geo_targeting/creates_geo_targetings.yml
|
266
|
+
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_/_offer_contract_caps/removes_a_cap_for_an_offer_contract.yml
|
265
267
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_/_offer_contract_caps/updates_a_cap_for_an_offer_contract.yml
|
266
268
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_contracts/creates_an_offer_contract.yml
|
267
269
|
- spec/fixtures/vcr_cassettes/SoapyCake_AdminAddedit/offer_contracts/updates_an_offer_contract.yml
|