soapy_cake 1.0.0 → 1.0.1

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: b6f7d62babdfc4fc4fe15e18b73cddf9438950f6
4
- data.tar.gz: ebb81a5b7ebc9605520231f04bc2bc84f9ba552e
3
+ metadata.gz: 8d26a37197fcaa53e31064c87431bf8118f4e9b6
4
+ data.tar.gz: e164f22aec7f3ccd0e0db4762b77dd3c8fe36b76
5
5
  SHA512:
6
- metadata.gz: 106f6be2db7835ead031a090cbce6a241451a8907af245347cb964d70d3000341d1c7447864c97ce6aee26d9e57c967c9a80a62ddb22fec468a678cfe7e05cc0
7
- data.tar.gz: 87ecc1739c0b32da04b2c2da8b4990193f9624c013d0f234180817ab069d34f7b0eeaa383d65bf4d91e12a2f95867a6dd658113f7fd95b306e3ea72c13669e97
6
+ metadata.gz: 571a9c42ba94aeff68121e9d7a78331e1101589742ce16a051f349d847422d9ced39fc0215b3801548b43084afb2741ba4de67ae621c9c46776baad96efd7b08
7
+ data.tar.gz: a17f9644883824d607dbc164ea7e5719e817982999d4df1a0dfe78efc7dbdfb4117df4101fc1a0a91f0b2f35fbecae52947ae792e57989309dc814f93ee2fcfb
data/README.md CHANGED
@@ -23,19 +23,19 @@ Or install it yourself as:
23
23
 
24
24
  ## Usage Examples
25
25
 
26
- First we assume that you set the `CAKE_DOMAIN` and `CAKE_API_KEY`
26
+ First we assume that you set the `CAKE_DOMAIN`, `CAKE_API_KEY` and `CAKE_TIME_OFFSET`
27
27
  environment variables.
28
28
 
29
29
  Export all advertisers:
30
30
 
31
31
  ```ruby
32
- SoapyCake::Client::CakeClient.export.advertisers(opts)
32
+ SoapyCake::Admin.new.advertisers(opts)
33
33
  ```
34
34
 
35
35
  Get report for specific date range:
36
36
 
37
37
  ```ruby
38
- SoapyCake::Client::CakeClient.reports.affiliate_summary(
38
+ SoapyCake::Admin.new.affiliate_summary(
39
39
  start_date: Date.beginning_of_month,
40
40
  end_date: Date.today
41
41
  )
@@ -19,7 +19,7 @@ module SoapyCake
19
19
 
20
20
  def typed_element(element)
21
21
  Helper.walk_tree(element) do |value, key|
22
- next value.to_i if key.to_s.end_with?('_id')
22
+ next value.to_i if key.to_s.end_with?('_id') && !key.to_s.end_with?('tax_id')
23
23
 
24
24
  if /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.?\d*\z/.match(value)
25
25
  next DateTime.parse(value + format('%+03d:00', time_offset.to_i))
@@ -42,7 +42,10 @@ module SoapyCake
42
42
  def check_errors!
43
43
  fault = sax.for_tag(:fault).first
44
44
  fail RequestFailed, fault[:reason][:text] if fault
45
- fail RequestFailed, sax.for_tag(:Text).first unless sax.for_tag(:success).first == 'true'
45
+ unless sax.for_tag(:success).first == 'true'
46
+ message = sax.for_tag(:message).first || sax.for_tag(:Text).first || 'Unknown error'
47
+ fail RequestFailed, message
48
+ end
46
49
  end
47
50
  end
48
51
  end
@@ -1,3 +1,3 @@
1
1
  module SoapyCake
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -35,7 +35,7 @@ http_interactions:
35
35
  X-Powered-By:
36
36
  - ASP.NET
37
37
  Date:
38
- - Tue, 10 Feb 2015 13:00:42 GMT
38
+ - Thu, 12 Feb 2015 12:17:12 GMT
39
39
  Content-Length:
40
40
  - '542'
41
41
  body:
@@ -46,5 +46,5 @@ http_interactions:
46
46
  in XML document (7, 52). ---&gt; Input string was not in a correct format.</soap:Text></soap:Reason><soap:Detail
47
47
  /></soap:Fault></soap:Body></soap:Envelope>
48
48
  http_version:
49
- recorded_at: Tue, 10 Feb 2015 13:00:44 GMT
49
+ recorded_at: Thu, 12 Feb 2015 12:17:18 GMT
50
50
  recorded_with: VCR 2.9.3
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://cake-partner-domain.com//api/7/reports.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/7/">
11
+ <env:Header/>
12
+ <env:Body>
13
+ <cake:Clicks>
14
+ <cake:api_key>cake-api-key</cake:api_key>
15
+ <cake:start_date>2014-06-30T01:00:00</cake:start_date>
16
+ <cake:end_date>2014-07-01T01:00:00</cake:end_date>
17
+ <cake:row_limit>1</cake:row_limit>
18
+ </cake:Clicks>
19
+ </env:Body>
20
+ </env:Envelope>
21
+ headers:
22
+ Content-Type:
23
+ - application/soap+xml;charset=UTF-8
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Cache-Control:
30
+ - private, max-age=0
31
+ Content-Type:
32
+ - application/soap+xml; charset=utf-8
33
+ Server:
34
+ - Microsoft-IIS/8.0
35
+ X-Aspnet-Version:
36
+ - 4.0.30319
37
+ X-Powered-By:
38
+ - ASP.NET
39
+ Date:
40
+ - Thu, 12 Feb 2015 12:17:12 GMT
41
+ Content-Length:
42
+ - '2151'
43
+ body:
44
+ encoding: UTF-8
45
+ string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
46
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ClicksResponse
47
+ xmlns="http://cakemarketing.com/api/7/"><ClicksResult><success>true</success><row_count>9</row_count><clicks><click><click_id>1275452</click_id><visitor_id>1208222</visitor_id><request_session_id>1303953</request_session_id><click_date>2014-06-30T19:31:35.067</click_date><affiliate><affiliate_id
48
+ xmlns="API:id_name_store">-1</affiliate_id><affiliate_name xmlns="API:id_name_store">ad2games
49
+ GmbH</affiliate_name></affiliate><advertiser><advertiser_id xmlns="API:id_name_store">1</advertiser_id><advertiser_name
50
+ xmlns="API:id_name_store">ad2games GmbH</advertiser_name></advertiser><offer><offer_id
51
+ xmlns="API:id_name_store">-1</offer_id><offer_name xmlns="API:id_name_store">Global
52
+ Redirect</offer_name></offer><offer_contract><offer_contract_id xmlns="API:id_name_store">-1</offer_contract_id><offer_contract_name
53
+ xmlns="API:id_name_store" /></offer_contract><campaign_id>-1</campaign_id><creative><creative_id
54
+ xmlns="API:id_name_store">-1</creative_id><creative_name xmlns="API:id_name_store">-1
55
+ - Global Redirect</creative_name></creative><sub_id_1 /><sub_id_2 /><sub_id_3
56
+ /><sub_id_4 /><sub_id_5 /><ip_address>184.72.184.113</ip_address><user_agent>Cloud%20mapping%20experiment.%20Contact%20research@pdrlabs.net</user_agent><referrer_url
57
+ /><search_term /><request_url>http://94.236.50.153/</request_url><redirect_url>http://www.getcake.com</redirect_url><country><country_code
58
+ xmlns="API:id_name_store">US</country_code><country_name xmlns="API:id_name_store">United
59
+ States</country_name></country><region><region_code xmlns="API:id_name_store">VA</region_code><region_name
60
+ xmlns="API:id_name_store">Virginia</region_name></region><isp><isp_id xmlns="API:id_name_store">29534</isp_id><isp_name
61
+ xmlns="API:id_name_store">Amazon.Com Inc.</isp_name></isp><disposition>Base
62
+ Tracking Domain Redirect</disposition><total_clicks>1</total_clicks></click></clicks></ClicksResult></ClicksResponse></soap:Body></soap:Envelope>
63
+ http_version:
64
+ recorded_at: Thu, 12 Feb 2015 12:17:18 GMT
65
+ recorded_with: VCR 2.9.3
@@ -35,9 +35,9 @@ http_interactions:
35
35
  X-Powered-By:
36
36
  - ASP.NET
37
37
  Date:
38
- - Tue, 10 Feb 2015 12:50:36 GMT
38
+ - Thu, 12 Feb 2015 12:17:13 GMT
39
39
  Content-Length:
40
- - '3036'
40
+ - '4618'
41
41
  body:
42
42
  encoding: ASCII-8BIT
43
43
  string: !binary |-
@@ -59,56 +59,91 @@ http_interactions:
59
59
  L2NvbnRhY3RfaWQ+PGNvbnRhY3RfbmFtZSB4bWxucz0iQVBJOmlkX25hbWVf
60
60
  c3RvcmUiPlBhcnRuZXIgU3VwcG9ydDwvY29udGFjdF9uYW1l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hdGVfbGFzdF9hY2NlcHRlZF90ZXJtcyB4
144
+ c2k6bmlsPSJ0cnVlIiAvPjxub3RlcyAvPjwvYWZmaWxpYXRlPjwvYWZmaWxp
145
+ YXRlcz48L0FmZmlsaWF0ZXNSZXN1bHQ+PC9BZmZpbGlhdGVzUmVzcG9uc2U+
146
+ PC9zb2FwOkJvZHk+PC9zb2FwOkVudmVsb3BlPg==
112
147
  http_version:
113
- recorded_at: Tue, 10 Feb 2015 12:50:38 GMT
148
+ recorded_at: Thu, 12 Feb 2015 12:17:19 GMT
114
149
  recorded_with: VCR 2.9.3
@@ -15,6 +15,24 @@ RSpec.describe 'Integration test' do
15
15
  # floats
16
16
  minimum_payment_threshold: '0.0000',
17
17
  )
18
+
19
+ # arrays
20
+ expect(result.first[:contacts][:contact_info].map { |contact| contact[:contact_id]}).to \
21
+ eq([8819, 8820])
22
+ end
23
+
24
+ it 'returns a clicks report with a defined time range', :vcr do
25
+ result = SoapyCake::Admin.new.clicks(
26
+ start_date: Date.new(2014, 6, 30),
27
+ end_date: Date.new(2014, 7, 1),
28
+ row_limit: 1
29
+ )
30
+
31
+ expect(result.count).to eq(1)
32
+ expect(result.first).to include(
33
+ click_id: 1275452,
34
+ visitor_id: 1208222
35
+ )
18
36
  end
19
37
 
20
38
  it 'raises if there is an error', :vcr do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soapy_cake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ad2games GmbH
@@ -176,6 +176,7 @@ files:
176
176
  - lib/soapy_cake/version.rb
177
177
  - soapy_cake.gemspec
178
178
  - spec/fixtures/vcr_cassettes/Integration_test/raises_if_there_is_an_error.yml
179
+ - spec/fixtures/vcr_cassettes/Integration_test/returns_a_clicks_report_with_a_defined_time_range.yml
179
180
  - spec/fixtures/vcr_cassettes/Integration_test/returns_an_affiliate_with_correct_data_types.yml
180
181
  - spec/lib/soapy_cake/admin_spec.rb
181
182
  - spec/lib/soapy_cake/affiliate_spec.rb
@@ -207,6 +208,7 @@ specification_version: 4
207
208
  summary: Simple client for the CAKE API
208
209
  test_files:
209
210
  - spec/fixtures/vcr_cassettes/Integration_test/raises_if_there_is_an_error.yml
211
+ - spec/fixtures/vcr_cassettes/Integration_test/returns_a_clicks_report_with_a_defined_time_range.yml
210
212
  - spec/fixtures/vcr_cassettes/Integration_test/returns_an_affiliate_with_correct_data_types.yml
211
213
  - spec/lib/soapy_cake/admin_spec.rb
212
214
  - spec/lib/soapy_cake/affiliate_spec.rb