soapy_cake 1.8.0 → 1.8.1

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: 90201356e6d2385c37b53e49e865c434402896b7
4
- data.tar.gz: 28dcc83c8a090dc0fb98840456d826a43dd7811c
3
+ metadata.gz: 48b4062dce12845caf36f528b60327033e63d7a0
4
+ data.tar.gz: cbcbfe9b1dddceb67984576a63825ff5c19b39ca
5
5
  SHA512:
6
- metadata.gz: 43dafa8fb75b0df882c4d8fdf76536c86b5de504dee9a32b44d8023339b325a6b66873a8ecbeaf46d592eacf11b74f29f40e9de88152a718bf411a97817386fe
7
- data.tar.gz: 611d5795f76310439df20c03d9bb0f3d8159f0f0a13ec8fa19fb3b249c8f6fa7d0fb75e06f6a8c076d87ce155310d4e85d73304a7b04522f5e4d8426d93a3bee
6
+ metadata.gz: af1c7e864df7ad50faac0d902c7578bf869decef11ff63b9bb6a4f1de6acdf9acf6a35a3666e1fc03385566216d1d5187dca1589e8c51aaa7680b6bccd22ec94
7
+ data.tar.gz: 79149b70f6e70c92879016ecb054f78d1310c50713142adc7a643ea1f106951edc202e3fa63f582b6878627a5f4612cc23a0fd41d570ec5c989ba9768b99b0d1
@@ -28,7 +28,7 @@ module SoapyCake
28
28
  end
29
29
 
30
30
  def short_response?
31
- %w(addedit track).include?(service)
31
+ %w(addedit track signup).include?(service)
32
32
  end
33
33
 
34
34
  private
@@ -1,3 +1,3 @@
1
1
  module SoapyCake
2
- VERSION = '1.8.0'
2
+ VERSION = '1.8.1'
3
3
  end
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://cake-partner-domain.com/api/4/signup.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/4/">
11
+ <env:Header/>
12
+ <env:Body>
13
+ <cake:Affiliate>
14
+ <cake:api_key>cake-api-key</cake:api_key>
15
+ <cake:contact_timezone>CET</cake:contact_timezone>
16
+ <cake:contact_phone_work>n/a</cake:contact_phone_work>
17
+ <cake:address_country>n/a</cake:address_country>
18
+ <cake:ssn_tax_id>n/a</cake:ssn_tax_id>
19
+ <cake:tax_class>n/a</cake:tax_class>
20
+ <cake:address_street>n/a</cake:address_street>
21
+ <cake:address_city>n/a</cake:address_city>
22
+ <cake:address_state>n/a</cake:address_state>
23
+ <cake:address_zip_code>n/a</cake:address_zip_code>
24
+ <cake:account_status_id>1</cake:account_status_id>
25
+ <cake:affiliate_name>Foxy Fox</cake:affiliate_name>
26
+ <cake:contact_first_name>Foxy</cake:contact_first_name>
27
+ <cake:contact_last_name>Fox</cake:contact_last_name>
28
+ <cake:contact_email_address>foxy@forrest.com</cake:contact_email_address>
29
+ <cake:date_added>2015-06-11T01:00:00</cake:date_added>
30
+ </cake:Affiliate>
31
+ </env:Body>
32
+ </env:Envelope>
33
+ headers:
34
+ Content-Type:
35
+ - application/soap+xml;charset=UTF-8
36
+ response:
37
+ status:
38
+ code: 200
39
+ message: OK
40
+ headers:
41
+ Cache-Control:
42
+ - private, max-age=0
43
+ Content-Type:
44
+ - application/soap+xml; charset=utf-8
45
+ Server:
46
+ - Microsoft-IIS/8.0
47
+ X-Aspnet-Version:
48
+ - 4.0.30319
49
+ X-Powered-By:
50
+ - ASP.NET
51
+ Date:
52
+ - Thu, 11 Jun 2015 07:20:40 GMT
53
+ Content-Length:
54
+ - '511'
55
+ body:
56
+ encoding: UTF-8
57
+ string: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
58
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><AffiliateResponse
59
+ xmlns="http://cakemarketing.com/api/4/"><AffiliateResult><success>true</success><message>Affiliate
60
+ Added Successfully</message><affiliate_id>16173</affiliate_id><tipalti_iframe_expiration_date
61
+ xsi:nil="true" /></AffiliateResult></AffiliateResponse></soap:Body></soap:Envelope>
62
+ http_version:
63
+ recorded_at: Thu, 11 Jun 2015 07:20:46 GMT
64
+ recorded_with: VCR 2.9.3
@@ -54,4 +54,31 @@ RSpec.describe SoapyCake::Admin do
54
54
  subject.affiliates(affiliate_id: 'bloops')
55
55
  end.to raise_error(SoapyCake::RequestFailed)
56
56
  end
57
+
58
+ it 'creates an affiliate and returns the ID', :vcr do
59
+ result = subject.affiliate_signup(
60
+ contact_timezone: 'CET',
61
+ contact_phone_work: 'n/a',
62
+ address_country: 'n/a',
63
+ ssn_tax_id: 'n/a',
64
+ tax_class: 'n/a',
65
+ address_street: 'n/a',
66
+ address_city: 'n/a',
67
+ address_state: 'n/a',
68
+ address_zip_code: 'n/a',
69
+ account_status_id: SoapyCake::Const::CONSTS[:account_status_id][:active],
70
+ affiliate_name: 'Foxy Fox',
71
+ contact_first_name: 'Foxy',
72
+ contact_last_name: 'Fox',
73
+ contact_email_address: 'foxy@forrest.com',
74
+ date_added: Date.today
75
+ )
76
+
77
+ expect(result).to eq(
78
+ success: true,
79
+ message: 'Affiliate Added Successfully',
80
+ affiliate_id: 16173,
81
+ tipalti_iframe_expiration_date: nil
82
+ )
83
+ end
57
84
  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.8.0
4
+ version: 1.8.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-06-10 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -194,6 +194,7 @@ files:
194
194
  - lib/soapy_cake/response_value.rb
195
195
  - lib/soapy_cake/version.rb
196
196
  - soapy_cake.gemspec
197
+ - spec/fixtures/vcr_cassettes/SoapyCake_Admin/creates_an_affiliate_and_returns_the_ID.yml
197
198
  - spec/fixtures/vcr_cassettes/SoapyCake_Admin/does_not_parse_a_transaction_id_as_an_integer.yml
198
199
  - spec/fixtures/vcr_cassettes/SoapyCake_Admin/raises_if_there_is_an_error.yml
199
200
  - spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_a_clicks_report_with_a_defined_time_range.yml
@@ -243,6 +244,7 @@ signing_key:
243
244
  specification_version: 4
244
245
  summary: Simple client for the CAKE API
245
246
  test_files:
247
+ - spec/fixtures/vcr_cassettes/SoapyCake_Admin/creates_an_affiliate_and_returns_the_ID.yml
246
248
  - spec/fixtures/vcr_cassettes/SoapyCake_Admin/does_not_parse_a_transaction_id_as_an_integer.yml
247
249
  - spec/fixtures/vcr_cassettes/SoapyCake_Admin/raises_if_there_is_an_error.yml
248
250
  - spec/fixtures/vcr_cassettes/SoapyCake_Admin/returns_a_clicks_report_with_a_defined_time_range.yml