soapy_cake 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7d1d0c249cafc0b33720b8cca7c7c4168a090e1
4
- data.tar.gz: e9eac1a2522f9e1c0b3e46cc2494ab7710d440f4
3
+ metadata.gz: b7a9a32166576fac5806bc3dcc14f386c2a9519e
4
+ data.tar.gz: 05bf59e505b856ccf3247276111584a981d0f4ac
5
5
  SHA512:
6
- metadata.gz: 4b1e2d8f104e0e3386600705604a6413ac3b37300424cdba5e19af9a16d47c84228ce5ad5a362365391a8d660031b1bf2cf3286d27153006d64776b6d717d410
7
- data.tar.gz: 6637204dd054b76ccf2f06db09fc3a3972a9986cf9a361a26904c6b2053979f8f53fa09311d096cfa5cf2d6f91699fe724deaf9ba0cf6db4a889305d59747416
6
+ metadata.gz: af8513388da5bd0459a43e0c040c8d33a103996d326093caaf7010baa03e524d06a1cf319d9a3ca7f09fcf9223f84d5f1d4f8d09d30d209a054ad47df6a26e41
7
+ data.tar.gz: fe766e78e9c2c71dfe32a23afa56a771ec2e77f4066962998daf7bfb723f39238f235320d6571efde8419612686b46c9b3de09f307576c4cfff1b218a96c91fb
@@ -20,6 +20,14 @@ module SoapyCake
20
20
  addedit_offer(opts)
21
21
  end
22
22
 
23
+ def add_geo_targets(opts = {})
24
+ require_params(opts, %i(offer_contract_id countries set_targeting_to_geo))
25
+
26
+ opts[:countries] = Array(opts[:countries]).join(',')
27
+
28
+ run Request.new(:admin, :addedit, :geo_targets, opts.merge(add_edit_option: 'add'))
29
+ end
30
+
23
31
  def add_offer_contract(opts = {})
24
32
  addedit_offer_contract(opts.merge(offer_contract_id: 0))
25
33
  end
@@ -1,3 +1,3 @@
1
1
  module SoapyCake
2
- VERSION = '1.3.3'
2
+ VERSION = '1.3.4'
3
3
  end
@@ -0,0 +1,52 @@
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:GeoTargets>
14
+ <cake:api_key>cake-api-key</cake:api_key>
15
+ <cake:offer_contract_id>1456</cake:offer_contract_id>
16
+ <cake:countries>DE,FR</cake:countries>
17
+ <cake:set_targeting_to_geo>true</cake:set_targeting_to_geo>
18
+ <cake:add_edit_option>add</cake:add_edit_option>
19
+ </cake:GeoTargets>
20
+ </env:Body>
21
+ </env:Envelope>
22
+ headers:
23
+ Content-Type:
24
+ - application/soap+xml;charset=UTF-8
25
+ response:
26
+ status:
27
+ code: 200
28
+ message: OK
29
+ headers:
30
+ Cache-Control:
31
+ - private, max-age=0
32
+ Content-Type:
33
+ - application/soap+xml; charset=utf-8
34
+ Server:
35
+ - Microsoft-IIS/8.0
36
+ X-Aspnet-Version:
37
+ - 4.0.30319
38
+ X-Powered-By:
39
+ - ASP.NET
40
+ Date:
41
+ - Wed, 04 Mar 2015 07:44:47 GMT
42
+ Content-Length:
43
+ - '443'
44
+ body:
45
+ encoding: UTF-8
46
+ string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
47
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GeoTargetsResponse
48
+ xmlns="http://cakemarketing.com/api/1/"><GeoTargetsResult><success>true</success><message>Countries
49
+ Added</message><row_count>0</row_count></GeoTargetsResult></GeoTargetsResponse></soap:Body></soap:Envelope>
50
+ http_version:
51
+ recorded_at: Tue, 17 Feb 2015 12:00:00 GMT
52
+ recorded_with: VCR 2.9.3
@@ -90,6 +90,18 @@ RSpec.describe 'ADDEDIT integration test' do
90
90
  end
91
91
  end
92
92
 
93
+ describe 'geo targeting' do
94
+ it 'creates geo targetings', :vcr do
95
+ result = subject.add_geo_targets(
96
+ offer_contract_id: offer_contract_id,
97
+ countries: %w(DE FR),
98
+ set_targeting_to_geo: true,
99
+ )
100
+
101
+ expect(result).to include(success: true)
102
+ end
103
+ end
104
+
93
105
  describe 'offer contracts' do
94
106
  it 'creates an offer contract', :vcr do
95
107
  result = subject.add_offer_contract(
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.3.3
4
+ version: 1.3.4
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-03 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -191,6 +191,7 @@ files:
191
191
  - lib/soapy_cake/response.rb
192
192
  - lib/soapy_cake/version.rb
193
193
  - soapy_cake.gemspec
194
+ - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/geo_targeting/creates_geo_targetings.yml
194
195
  - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/offer_/_offer_contract_caps/removes_a_cap_for_an_offer_contract.yml
195
196
  - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/offer_/_offer_contract_caps/updates_a_cap_for_an_offer_contract.yml
196
197
  - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/offer_contracts/creates_an_offer_contract.yml
@@ -232,6 +233,7 @@ signing_key:
232
233
  specification_version: 4
233
234
  summary: Simple client for the CAKE API
234
235
  test_files:
236
+ - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/geo_targeting/creates_geo_targetings.yml
235
237
  - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/offer_/_offer_contract_caps/removes_a_cap_for_an_offer_contract.yml
236
238
  - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/offer_/_offer_contract_caps/updates_a_cap_for_an_offer_contract.yml
237
239
  - spec/fixtures/vcr_cassettes/ADDEDIT_integration_test/offer_contracts/creates_an_offer_contract.yml