yahoo_store_api 0.2.4 → 0.2.5
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/.gitignore +2 -1
- data/README.md +9 -2
- data/lib/yahoo_store_api/helper.rb +1 -3
- data/lib/yahoo_store_api/version.rb +1 -1
- data/lib/yahoo_store_api.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc0e2477c4f680e362595d10e094e2ad91fd0ac6cd41a89fbbe08728d1937007
|
|
4
|
+
data.tar.gz: 6be1e3443b3e400ffc3e575dea1861a5d91a105d656eccbdc8821583e6779239
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 561646417f09b28521617c48ed33e1afb6d3f32011bcb52c16ad50a4f3e41f6c2db8b9d4cb704a15a98b74ab733033043c6a87bd5cb5fa6235715fda18064cd4
|
|
7
|
+
data.tar.gz: 98df0a5737ceae790cd59598d4e45980072c7bc3f8dcb5eda621d949312eb516d4f369afbd0caf03103f98292c770056de6de68b9e99fa04ffd915b9612004f3
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
# YahooStoreApi
|
|
2
2
|
|
|
3
|
+
**⚠️Deprecated⚠️**
|
|
4
|
+
|
|
5
|
+
YahooのAPI認証がv1からv2に移行しており、自分自身EC関連の業務から離れているため、メンテナンスができません。
|
|
6
|
+
|
|
7
|
+
> 2021年8月3日をもちましてYahoo! ID連携 v1の新規の登録を終了いたしました。
|
|
8
|
+
> 2022年4月27日にYahoo! ID連携 v1の利用を終了いたしますのでv2への移行が必要です。
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
3
12
|
[](https://badge.fury.io/rb/yahoo_store_api)
|
|
4
13
|
[](https://github.com/t4traw/yahoo_store_api/actions/workflows/main.yml)
|
|
5
14
|
[](https://codeclimate.com/github/t4traw/yahoo_store_api)
|
|
6
15
|
|
|
7
16
|
Yahoo!ショッピング プロフェッショナル出店ストア向けAPIを簡単に叩けるrubyラッパーです。
|
|
8
17
|
|
|
9
|
-
現在開発中です🐛 まだ商品情報のCRUDと在庫情報の取得・更新、反映予約しかできません。順次機能追加をしていきたいと思います。
|
|
10
|
-
|
|
11
18
|
## できること
|
|
12
19
|
|
|
13
20
|
* 商品に関連するAPI
|
|
@@ -4,9 +4,7 @@ module YahooStoreApi
|
|
|
4
4
|
|
|
5
5
|
def connection(method, with_seller_id: false)
|
|
6
6
|
url = ENDPOINT + method
|
|
7
|
-
if with_seller_id
|
|
8
|
-
url += "?seller_id=#{@seller_id}" if with_seller_id
|
|
9
|
-
end
|
|
7
|
+
url += "?seller_id=#{@seller_id}" if with_seller_id
|
|
10
8
|
|
|
11
9
|
Faraday.new(url: url) do |c|
|
|
12
10
|
c.request :multipart
|
data/lib/yahoo_store_api.rb
CHANGED
|
@@ -27,12 +27,12 @@ module YahooStoreApi
|
|
|
27
27
|
@application_id = application_id
|
|
28
28
|
@application_secret = application_secret
|
|
29
29
|
@redirect_uri = redirect_uri ? "&redirect_uri=" + CGI.escape(redirect_uri) : nil
|
|
30
|
-
@access_token =
|
|
30
|
+
@access_token = refresh_access_token(refresh_token) || get_access_token(authorization_code)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
private
|
|
34
34
|
|
|
35
|
-
ACCESS_TOKEN_ENDPOINT = "https://auth.login.yahoo.co.jp/yconnect/
|
|
35
|
+
ACCESS_TOKEN_ENDPOINT = "https://auth.login.yahoo.co.jp/yconnect/v2/token".freeze
|
|
36
36
|
|
|
37
37
|
def access_token_connection
|
|
38
38
|
Faraday.new(url: ACCESS_TOKEN_ENDPOINT) do |c|
|
|
@@ -50,7 +50,7 @@ module YahooStoreApi
|
|
|
50
50
|
result[:access_token]
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
def
|
|
53
|
+
def refresh_access_token(refresh_token)
|
|
54
54
|
param = "grant_type=refresh_token&refresh_token=#{refresh_token}"
|
|
55
55
|
obj = access_token_connection.post { |r| r.body = param }
|
|
56
56
|
result = hash_converter(obj)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yahoo_store_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- t4traw
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-04-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
239
239
|
- !ruby/object:Gem::Version
|
|
240
240
|
version: '0'
|
|
241
241
|
requirements: []
|
|
242
|
-
rubygems_version: 3.2.
|
|
242
|
+
rubygems_version: 3.2.3
|
|
243
243
|
signing_key:
|
|
244
244
|
specification_version: 4
|
|
245
245
|
summary: Yahoo!ショッピング プロフェッショナル出店ストア向けAPIを簡単に叩けるrubyラッパー
|