hasoffersv3 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hasoffersv3/advertiser.rb +5 -0
- data/lib/hasoffersv3/advertiser_billing.rb +5 -0
- data/lib/hasoffersv3/affiliate.rb +6 -1
- data/lib/hasoffersv3/affiliate_billing.rb +9 -0
- data/lib/hasoffersv3/version.rb +1 -1
- data/spec/lib/advertiser_billing_spec.rb +21 -1
- data/spec/lib/advertiser_spec.rb +20 -0
- data/spec/lib/affiliate_billing_spec.rb +29 -0
- data/spec/lib/affiliate_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eefc584486a52827598e4cc0fe17fb050f19b730
|
4
|
+
data.tar.gz: 34ccbf8f939fd76476be45be3a52da41c3cc6b02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e35ea5362691e3621e510894a5ff6baa87f7f64baf7803fae74b3aad34ddadde92e43a276b9cd50c2d74a87c6c60c8a1405b0a68ea3863f470e74bc8c674ff9f
|
7
|
+
data.tar.gz: 5a36c482a56acfb7187fb096c2c7a56d54bc561d4b99e1d3bfefabdcf1ea7cb5ef9319d20df8d82a3d3ce089a058a8fab99e042ac6cc53eb927ada6a90a4238f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 0.5.5
|
2
|
+
- [#58] Added `AdvertiserBilling::findAllInvoicesByIds`, `AffiliateBilling::findAllInvoicesByIds` methods. (@kamil89)
|
3
|
+
- [#59] Added `Advertiser::getSingupAnswers` and `Affiliate::getSingupAnswers` methods. (@kamil89)
|
4
|
+
|
1
5
|
# 0.5.4
|
2
6
|
- [#56] Enable configuring proxy. (@wowawiwa)
|
3
7
|
|
@@ -4,6 +4,11 @@ class HasOffersV3
|
|
4
4
|
post_request 'findAllInvoices', params
|
5
5
|
end
|
6
6
|
|
7
|
+
def find_all_invoices_by_ids(params = {})
|
8
|
+
requires! params, [:ids]
|
9
|
+
post_request 'findAllInvoicesByIds', params
|
10
|
+
end
|
11
|
+
|
7
12
|
def create_invoice(params = {})
|
8
13
|
requires! params, [:data]
|
9
14
|
post_request 'createInvoice', params
|
@@ -22,7 +22,7 @@ class HasOffersV3
|
|
22
22
|
post_request 'updatePaymentMethodPaypal', params
|
23
23
|
end
|
24
24
|
|
25
|
-
def create
|
25
|
+
def create(params = {})
|
26
26
|
requires! params, [:data]
|
27
27
|
requires! params[:data], [:zipcode, :company]
|
28
28
|
post_request 'create', params
|
@@ -32,5 +32,10 @@ class HasOffersV3
|
|
32
32
|
requires! params, [:id]
|
33
33
|
post_request 'getAffiliateTier', params
|
34
34
|
end
|
35
|
+
|
36
|
+
def get_signup_answers(params = {})
|
37
|
+
requires! params, [:id]
|
38
|
+
post_request 'getSignupAnswers', params
|
39
|
+
end
|
35
40
|
end
|
36
41
|
end
|
@@ -1,5 +1,14 @@
|
|
1
1
|
class HasOffersV3
|
2
2
|
class AffiliateBilling < Base
|
3
|
+
def find_all_invoices(params = {})
|
4
|
+
post_request 'findAllInvoices', params
|
5
|
+
end
|
6
|
+
|
7
|
+
def find_all_invoices_by_ids(params = {})
|
8
|
+
requires! params, [:ids]
|
9
|
+
post_request 'findAllInvoicesByIds', params
|
10
|
+
end
|
11
|
+
|
3
12
|
def find_last_invoice(params = {})
|
4
13
|
requires! params, [:affiliate_id]
|
5
14
|
post_request 'findLastInvoice', params
|
data/lib/hasoffersv3/version.rb
CHANGED
@@ -10,6 +10,26 @@ describe HasOffersV3::AdvertiserBilling do
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
describe '#find_all_invoices_by_ids' do
|
14
|
+
context 'when ids is specified' do
|
15
|
+
it 'makes a proper request call' do
|
16
|
+
stub_call
|
17
|
+
response = subject.find_all_invoices_by_ids(ids: [1, 2, 3])
|
18
|
+
expect(a_request(:post, url).with(body: hash_including({
|
19
|
+
'Method' => 'findAllInvoicesByIds',
|
20
|
+
'ids' => ['1', '2', '3']
|
21
|
+
}))).to have_been_made
|
22
|
+
validate_call response
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'when ids is not specified' do
|
27
|
+
it 'raises an exception' do
|
28
|
+
expect { subject.find_all_invoices_by_ids }.to raise_error ArgumentError
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
13
33
|
describe '#create_invoice' do
|
14
34
|
context 'when data is specified' do
|
15
35
|
it 'makes a proper request call' do
|
@@ -49,7 +69,7 @@ describe HasOffersV3::AdvertiserBilling do
|
|
49
69
|
end
|
50
70
|
|
51
71
|
describe '#add_invoice_item' do
|
52
|
-
context 'when invoice
|
72
|
+
context 'when invoice ID and data is specified' do
|
53
73
|
it 'makes a proper request call' do
|
54
74
|
stub_call
|
55
75
|
response = subject.add_invoice_item(invoice_id: 1, data: {memo: 'abc'})
|
data/spec/lib/advertiser_spec.rb
CHANGED
@@ -33,4 +33,24 @@ describe HasOffersV3::Advertiser do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
describe '#get_signup_answers' do
|
38
|
+
context 'when ID is specified' do
|
39
|
+
it 'makes a proper request call' do
|
40
|
+
stub_call
|
41
|
+
response = subject.get_signup_answers id: 1
|
42
|
+
expect(a_request(:post, url).with(body: hash_including({
|
43
|
+
'Method' => 'getSignupAnswers',
|
44
|
+
'id' => '1'
|
45
|
+
}))).to have_been_made
|
46
|
+
validate_call response
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'when there is no ID' do
|
51
|
+
it 'raises exception' do
|
52
|
+
expect { subject.get_signup_answers }.to raise_error ArgumentError
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
36
56
|
end
|
@@ -1,6 +1,35 @@
|
|
1
1
|
describe HasOffersV3::AffiliateBilling do
|
2
2
|
let(:url) { api_url 'AffiliateBilling' }
|
3
3
|
|
4
|
+
describe '#find_all_invoices' do
|
5
|
+
it 'makes a proper request call' do
|
6
|
+
stub_call
|
7
|
+
response = subject.find_all_invoices
|
8
|
+
expect(a_request(:post, url).with(body: hash_including({'Method' => 'findAllInvoices'}))).to have_been_made
|
9
|
+
validate_call response
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '#find_all_invoices_by_ids' do
|
14
|
+
context 'when ids is specified' do
|
15
|
+
it 'makes a proper request call' do
|
16
|
+
stub_call
|
17
|
+
response = subject.find_all_invoices_by_ids(ids: [1, 2, 3])
|
18
|
+
expect(a_request(:post, url).with(body: hash_including({
|
19
|
+
'Method' => 'findAllInvoicesByIds',
|
20
|
+
'ids' => ['1', '2', '3']
|
21
|
+
}))).to have_been_made
|
22
|
+
validate_call response
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'when ids is not specified' do
|
27
|
+
it 'raises an exception' do
|
28
|
+
expect { subject.find_all_invoices_by_ids }.to raise_error ArgumentError
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
4
33
|
describe '#find_last_invoice' do
|
5
34
|
context 'when affiliate ID is specified' do
|
6
35
|
it 'makes a proper request call' do
|
data/spec/lib/affiliate_spec.rb
CHANGED
@@ -96,4 +96,23 @@ describe HasOffersV3::Affiliate do
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
+
describe '#get_signup_answers' do
|
100
|
+
context 'when ID is specified' do
|
101
|
+
it 'makes a proper request call' do
|
102
|
+
stub_call
|
103
|
+
response = subject.get_signup_answers id: 1
|
104
|
+
expect(a_request(:post, url).with(body: hash_including({
|
105
|
+
'Method' => 'getSignupAnswers',
|
106
|
+
'id' => '1'
|
107
|
+
}))).to have_been_made
|
108
|
+
validate_call response
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
context 'when there is no ID' do
|
113
|
+
it 'raises exception' do
|
114
|
+
expect { subject.get_signup_answers }.to raise_error ArgumentError
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
99
118
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hasoffersv3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maximilian Seifert
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|