popbill 1.17.2 → 1.18.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/popbill.rb +18 -9
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bc926cf9e22f8c56b61027c043967839faddbcd
|
4
|
+
data.tar.gz: bb08081f9a52a1f8b41d59a663b21fe5b481a2aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdb8434bc6221ad5bf769acf49b90429211c12bde3eceb58a5bdcf28957f62d69dea320202261d2788bb8fead836873d81080ee1012efd981bc91de3d91e7e1c
|
7
|
+
data.tar.gz: 98cc810dd4a709899fb154c10a5b3fb2553561d51464b75aeb0d8d8660fcee90d8eed3951af919f14b73bdfd695c366bf450b731cd4ac4335644fb056a62d5ee
|
data/lib/popbill.rb
CHANGED
@@ -11,13 +11,15 @@ class BaseService
|
|
11
11
|
ServiceID_TEST = "POPBILL_TEST"
|
12
12
|
ServiceURL_REAL = "https://popbill.linkhub.co.kr"
|
13
13
|
ServiceURL_TEST = "https://popbill-test.linkhub.co.kr"
|
14
|
+
ServiceURL_Static_REAL = "https://static-popbill.linkhub.co.kr"
|
15
|
+
ServiceURL_Static_TEST = "https://static-popbill-test.linkhub.co.kr"
|
14
16
|
ServiceURL_GA_REAL = "https://ga-popbill.linkhub.co.kr"
|
15
17
|
ServiceURL_GA_TEST = "https://ga-popbill-test.linkhub.co.kr"
|
16
18
|
|
17
19
|
POPBILL_APIVersion = "1.0"
|
18
20
|
BOUNDARY = "==POPBILL_RUBY_SDK=="
|
19
21
|
|
20
|
-
attr_accessor :token_table, :scopes, :isTest, :linkhub, :ipRestrictOnOff, :useStaticIP
|
22
|
+
attr_accessor :token_table, :scopes, :isTest, :linkhub, :ipRestrictOnOff, :useStaticIP, :useGAIP
|
21
23
|
|
22
24
|
# Generate Linkhub Class Singleton Instance
|
23
25
|
class << self
|
@@ -28,6 +30,7 @@ class BaseService
|
|
28
30
|
@instance.scopes = ["member"]
|
29
31
|
@instance.ipRestrictOnOff = true
|
30
32
|
@instance.useStaticIP = false
|
33
|
+
@instance.useGAIP = false
|
31
34
|
|
32
35
|
return @instance
|
33
36
|
end
|
@@ -53,9 +56,15 @@ class BaseService
|
|
53
56
|
@useStaticIP = value
|
54
57
|
end
|
55
58
|
|
59
|
+
def setUseGAIP(value)
|
60
|
+
@useGAIP = value
|
61
|
+
end
|
62
|
+
|
56
63
|
def getServiceURL()
|
57
|
-
if @
|
58
|
-
|
64
|
+
if @useGAIP
|
65
|
+
return @isTest ? BaseService::ServiceURL_GA_TEST : BaseService::ServiceURL_GA_REAL
|
66
|
+
elsif @useStaticIP
|
67
|
+
return @isTest ? BaseService::ServiceURL_Static_TEST : BaseService::ServiceURL_Static_REAL
|
59
68
|
else
|
60
69
|
return @isTest ? BaseService::ServiceURL_TEST : BaseService::ServiceURL_REAL
|
61
70
|
end
|
@@ -81,7 +90,7 @@ class BaseService
|
|
81
90
|
else
|
82
91
|
# Token's expireTime must use parse() because time format is hh:mm:ss.SSSZ
|
83
92
|
expireTime = DateTime.parse(targetToken['expiration'])
|
84
|
-
serverUTCTime = DateTime.strptime(@linkhub.getTime(@useStaticIP))
|
93
|
+
serverUTCTime = DateTime.strptime(@linkhub.getTime(@useStaticIP, @useGAIP))
|
85
94
|
refresh = expireTime < serverUTCTime
|
86
95
|
end
|
87
96
|
|
@@ -89,7 +98,7 @@ class BaseService
|
|
89
98
|
begin
|
90
99
|
# getSessionToken from Linkhub
|
91
100
|
targetToken = @linkhub.getSessionToken(
|
92
|
-
@isTest ? ServiceID_TEST : ServiceID_REAL, corpNum, @scopes, @ipRestrictOnOff ? "" : "*", @useStaticIP)
|
101
|
+
@isTest ? ServiceID_TEST : ServiceID_REAL, corpNum, @scopes, @ipRestrictOnOff ? "" : "*", @useStaticIP, @useGAIP)
|
93
102
|
|
94
103
|
rescue LinkhubException => le
|
95
104
|
raise PopbillException.new(le.code, le.message)
|
@@ -299,7 +308,7 @@ class BaseService
|
|
299
308
|
# Add the file Data
|
300
309
|
|
301
310
|
uri = URI(getServiceURL() + url)
|
302
|
-
|
311
|
+
|
303
312
|
https = Net::HTTP.new(uri.host, 443)
|
304
313
|
https.use_ssl = true
|
305
314
|
Net::HTTP::Post.new(uri)
|
@@ -326,7 +335,7 @@ class BaseService
|
|
326
335
|
end
|
327
336
|
|
328
337
|
begin
|
329
|
-
@linkhub.getBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP)
|
338
|
+
@linkhub.getBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP, @useGAIP)
|
330
339
|
rescue LinkhubException => le
|
331
340
|
raise PopbillException.new(le.code, le.message)
|
332
341
|
end
|
@@ -339,7 +348,7 @@ class BaseService
|
|
339
348
|
end
|
340
349
|
|
341
350
|
begin
|
342
|
-
@linkhub.getPartnerBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP)
|
351
|
+
@linkhub.getPartnerBalance(getSession_Token(corpNum), getServiceID(), @useStaticIP, @useGAIP)
|
343
352
|
rescue LinkhubException => le
|
344
353
|
raise PopbillException.new(le.code, le.message)
|
345
354
|
end
|
@@ -352,7 +361,7 @@ class BaseService
|
|
352
361
|
end
|
353
362
|
|
354
363
|
begin
|
355
|
-
@linkhub.getPartnerURL(getSession_Token(corpNum), getServiceID(), togo, @useStaticIP)
|
364
|
+
@linkhub.getPartnerURL(getSession_Token(corpNum), getServiceID(), togo, @useStaticIP, @useGAIP)
|
356
365
|
rescue LinkhubException => le
|
357
366
|
raise PopbillException.new(le.code, le.message)
|
358
367
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popbill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linkhub Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linkhub
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.4.0
|
27
27
|
description: Popbill API SDK
|
28
28
|
email: code@linkhub.co.kr
|
29
29
|
executables: []
|