FlipkartSeller 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -10
- data/lib/FlipkartSeller/base.rb +1 -1
- data/lib/FlipkartSeller/product.rb +72 -0
- data/lib/FlipkartSeller/version.rb +1 -1
- data/lib/FlipkartSeller.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed3944115ca9e98ba43081d9705140201ef44edc
|
4
|
+
data.tar.gz: 7af51e807608ada6be25a4d338976d6b414e24d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 916b95e8a0bb10ccfc38af7f46664026fb19ccf854bab483974fe2a172ae7fd56e9519cdfd9289c8224d5d4c511a6adeca97ef25768c627e3b887a005d801853
|
7
|
+
data.tar.gz: 2e39dc22a358ac123386223e24ed046ea53e56fb83b7f65749cd456e090486b24218d99bd6a5cadb3539268dec5a7305a986bdc897a20087ea6d7f866b857110
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# FlipkartSeller
|
2
2
|
|
3
|
-
|
3
|
+
Ruby Gem for Flipkart Marketplace API.
|
4
4
|
|
5
|
-
|
5
|
+
This extension helps developers to integrate Flipkart marketplace API easily in Rails application.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -14,7 +14,7 @@ gem 'FlipkartSeller'
|
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
17
|
-
$ bundle
|
17
|
+
$ bundle install
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
@@ -22,17 +22,17 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
1. Create flipkart client object
|
26
26
|
|
27
|
-
|
27
|
+
fk_client = FlipkartSeller::Client.new(CLIENT_ID,CLIENT_SECRET)
|
28
28
|
|
29
|
-
|
29
|
+
2. Fetch your orders
|
30
30
|
|
31
|
-
|
31
|
+
fk_client.fetch_orders
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
3. Get product detail
|
34
|
+
|
35
|
+
fk_client.get_product(PRODUCT_SKU)
|
36
36
|
|
37
37
|
|
38
38
|
## License
|
data/lib/FlipkartSeller/base.rb
CHANGED
@@ -0,0 +1,72 @@
|
|
1
|
+
module FlipkartSeller
|
2
|
+
module Product
|
3
|
+
|
4
|
+
def get_product(sku)
|
5
|
+
|
6
|
+
begin
|
7
|
+
|
8
|
+
response = RestClient::Request.execute(
|
9
|
+
:method => :get,
|
10
|
+
:url => "#{@base_url}/sellers/skus/#{sku}/listings",
|
11
|
+
:headers => {'Authorization' => 'Bearer ' + @access_token, :content_type => 'application/json'}
|
12
|
+
)
|
13
|
+
|
14
|
+
if response.code == 200
|
15
|
+
response_data = JSON.parse(response.body)
|
16
|
+
|
17
|
+
return response_data
|
18
|
+
end
|
19
|
+
|
20
|
+
rescue Exception => e
|
21
|
+
Rails.logger.error e.message
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
def update_product(sku,data)
|
27
|
+
|
28
|
+
begin
|
29
|
+
|
30
|
+
response = RestClient::Request.execute(
|
31
|
+
:method => :post,
|
32
|
+
:url => "#{@base_url}/sellers/skus/#{sku}/listings",
|
33
|
+
:headers => {'Authorization' => 'Bearer ' + @access_token, :content_type => 'application/json'},
|
34
|
+
:payload=> "#{data.to_json}"
|
35
|
+
)
|
36
|
+
|
37
|
+
if response.code == 200
|
38
|
+
response_data = JSON.parse(response.body)
|
39
|
+
|
40
|
+
return response_data
|
41
|
+
end
|
42
|
+
|
43
|
+
rescue Exception => e
|
44
|
+
Rails.logger.error e.message
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
def update_products(data)
|
50
|
+
|
51
|
+
begin
|
52
|
+
|
53
|
+
response = RestClient::Request.execute(
|
54
|
+
:method => :post,
|
55
|
+
:url => "#{BASE_URL}/sellers/skus/listings/bulk",
|
56
|
+
:headers => {'Authorization' => 'Bearer ' + @access_token, :content_type => 'application/json'},
|
57
|
+
:payload=> "#{data.to_json}"
|
58
|
+
)
|
59
|
+
|
60
|
+
if response.code == 200
|
61
|
+
response_data = JSON.parse(response.body)
|
62
|
+
|
63
|
+
return response_data
|
64
|
+
end
|
65
|
+
|
66
|
+
rescue Exception => e
|
67
|
+
Rails.logger.error e.message
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
data/lib/FlipkartSeller.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: FlipkartSeller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Atish Kumar Sahoo
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/FlipkartSeller/base.rb
|
92
92
|
- lib/FlipkartSeller/client.rb
|
93
93
|
- lib/FlipkartSeller/order.rb
|
94
|
+
- lib/FlipkartSeller/product.rb
|
94
95
|
- lib/FlipkartSeller/version.rb
|
95
96
|
homepage: https://gitlab.com/AtishSahoo/FlipkartSeller
|
96
97
|
licenses:
|