papapi 0.0.1 → 0.1.0
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 +4 -4
- data/lib/papapi/version.rb +1 -1
- data/spec/affiliate.rb +2 -1
- data/spec/affiliate_commission_spec.rb +5 -2
- data/spec/grid_request_spec.rb +1 -1
- data/spec/merchnat_commision_spec.rb +13 -0
- data/spec/request_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8b816984d8c24c624917da09e738623737e642f
|
|
4
|
+
data.tar.gz: 62364063dcc58a5a0f10b1cf3fa77ef80c20314a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ef4275ff7c8115981ba174b203928bceda9018eb3a822006d50e2907361a4444f56750f7c3c8f8abf4a9ffb2c6a3d1bd875bc989f678d048afc8e88415e8df9
|
|
7
|
+
data.tar.gz: 5e4ae6ba536c376aad3c371bd91a915cb73647b894ccbd9261dc3c11be640f8b5544d182779b935bce2840f964871c2f633dfb0c3fc290004dd22f37e45a967f
|
data/lib/papapi/version.rb
CHANGED
data/spec/affiliate.rb
CHANGED
|
@@ -2,10 +2,11 @@ require 'papapi'
|
|
|
2
2
|
require 'spec_helper'
|
|
3
3
|
|
|
4
4
|
RSpec.describe Papapi::Affiliate::Commission do
|
|
5
|
-
it "#
|
|
5
|
+
it "#load" do
|
|
6
6
|
session = Papapi::Session.new(script_url).login(affiliate_login, affiliate_password, Papapi::Session::AFFILIATE)
|
|
7
7
|
affiliate = Papapi::Affiliate.new(session)
|
|
8
8
|
affiliate.load()
|
|
9
9
|
expect(affiliate.id).to be eql('11111111')
|
|
10
|
+
expect(affiliate[:username]).to be eql('affiliate@example.com')
|
|
10
11
|
end
|
|
11
12
|
end
|
|
@@ -2,9 +2,12 @@ require 'papapi'
|
|
|
2
2
|
require 'spec_helper'
|
|
3
3
|
|
|
4
4
|
RSpec.describe Papapi::Affiliate::Commission do
|
|
5
|
-
it "#
|
|
5
|
+
it "#by_orders" do
|
|
6
6
|
session = Papapi::Session.new(script_url).login(affiliate_login, affiliate_password, Papapi::Session::AFFILIATE)
|
|
7
7
|
commission = Papapi::Affiliate::Commission.new(session)
|
|
8
|
-
|
|
8
|
+
result = commission.by_orders(['ORD_123', 'test123'])
|
|
9
|
+
expect(result.keys.length).to eq(2)
|
|
10
|
+
expect(result.has_key?('ORD_123')).to be true
|
|
11
|
+
expect(result.has_key?('test123')).to be true
|
|
9
12
|
end
|
|
10
13
|
end
|
data/spec/grid_request_spec.rb
CHANGED
|
@@ -15,7 +15,7 @@ RSpec.describe Papapi::GridRequest do
|
|
|
15
15
|
|
|
16
16
|
context "load affiliate transaction grid" do
|
|
17
17
|
it "#send" do
|
|
18
|
-
affiliate_session = Papapi::Session.new(script_url
|
|
18
|
+
affiliate_session = Papapi::Session.new(script_url).login(affiliate_login, affiliate_password, Papapi::Session::AFFILIATE)
|
|
19
19
|
request = Papapi::GridRequest.new("Pap_Affiliates_Reports_TransactionsGrid", "getRows", affiliate_session)
|
|
20
20
|
response = request.send
|
|
21
21
|
expect(response.count).to be > 1
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'papapi'
|
|
2
|
+
require 'spec_helper'
|
|
3
|
+
|
|
4
|
+
RSpec.describe Papapi::Merchant::Commission do
|
|
5
|
+
it "#by_orders" do
|
|
6
|
+
session = Papapi::Session.new(script_url).login(merchant_login, merchant_password)
|
|
7
|
+
commission = Papapi::Merchant::Commission.new(session)
|
|
8
|
+
result = commission.by_orders(['ORD_123', 'test123'], '11111111')
|
|
9
|
+
expect(result.keys.length).to eq(2)
|
|
10
|
+
expect(result.has_key?('ORD_123')).to be true
|
|
11
|
+
expect(result.has_key?('test123')).to be true
|
|
12
|
+
end
|
|
13
|
+
end
|
data/spec/request_spec.rb
CHANGED
|
@@ -2,7 +2,7 @@ require 'papapi'
|
|
|
2
2
|
require 'spec_helper'
|
|
3
3
|
|
|
4
4
|
RSpec.describe Papapi::Request do
|
|
5
|
-
let(:session) { Papapi::Session.new(script_url
|
|
5
|
+
let(:session) { Papapi::Session.new(script_url).login(merchant_login, merchant_password) }
|
|
6
6
|
|
|
7
7
|
context "load statistics data" do
|
|
8
8
|
it "#send" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: papapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitry Nizovtsev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-03-
|
|
11
|
+
date: 2015-03-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
version: '0'
|
|
110
110
|
requirements: []
|
|
111
111
|
rubyforge_project:
|
|
112
|
-
rubygems_version: 2.
|
|
112
|
+
rubygems_version: 2.2.2
|
|
113
113
|
signing_key:
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: A client for the Post Affiliate Pro API
|