bootpay 1.2.0 → 3.0.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/.gitignore +8 -9
- data/.rspec +2 -0
- data/CHANGELOG.md +63 -21
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +2 -4
- data/LICENSE.txt +1 -1
- data/README.md +309 -196
- data/Rakefile +3 -3
- data/bin/console +1 -1
- data/bootpay.gemspec +23 -20
- data/lib/bootpay/bootpay-rest-client.rb +51 -0
- data/lib/bootpay/concern/authenticate.rb +69 -0
- data/lib/bootpay/concern/cash_receipt.rb +83 -0
- data/lib/bootpay/concern/easy.rb +18 -0
- data/lib/bootpay/concern/escrow.rb +25 -0
- data/lib/bootpay/concern/payment.rb +126 -0
- data/lib/bootpay/concern/reseller.rb +97 -0
- data/lib/bootpay/concern/rest.rb +56 -0
- data/lib/bootpay/concern/sdk.rb +52 -0
- data/lib/bootpay/concern/seller.rb +15 -0
- data/lib/bootpay/concern/service.rb +15 -0
- data/lib/bootpay/concern/subscription.rb +211 -0
- data/lib/bootpay/concern/token.rb +33 -0
- data/lib/bootpay/concern/user_token.rb +23 -0
- data/lib/bootpay/concern/wallet.rb +20 -0
- data/lib/bootpay/concern/webhook.rb +18 -0
- data/lib/bootpay/concern.rb +35 -0
- data/lib/bootpay-backend-ruby.rb +6 -0
- data/lib/bootpay.rb +10 -66
- data/lib/bootpay_storage/bootpay-storage-rest-client.rb +46 -0
- data/lib/bootpay_storage/concern/csv.rb +18 -0
- data/lib/bootpay_storage/concern/image.rb +30 -0
- data/lib/bootpay_storage/concern/rest.rb +176 -0
- data/lib/bootpay_storage/concern/token.rb +9 -0
- data/lib/bootpay_storage/concern.rb +12 -0
- data/lib/bootpay_storage/response.rb +14 -0
- data/lib/bootpay_store/bootpay-store-rest-client.rb +47 -0
- data/lib/bootpay_store/concern/alimtalk_message.rb +67 -0
- data/lib/bootpay_store/concern/alimtalk_official.rb +63 -0
- data/lib/bootpay_store/concern/alimtalk_optout.rb +72 -0
- data/lib/bootpay_store/concern/alimtalk_send.rb +83 -0
- data/lib/bootpay_store/concern/alimtalk_sender.rb +105 -0
- data/lib/bootpay_store/concern/alimtalk_template.rb +215 -0
- data/lib/bootpay_store/concern/alimtalk_webhook.rb +84 -0
- data/lib/bootpay_store/concern/invoice.rb +102 -0
- data/lib/bootpay_store/concern/mall_setting.rb +385 -0
- data/lib/bootpay_store/concern/order.rb +74 -0
- data/lib/bootpay_store/concern/order_subscription.rb +391 -0
- data/lib/bootpay_store/concern/payment.rb +119 -0
- data/lib/bootpay_store/concern/product.rb +175 -0
- data/lib/bootpay_store/concern/rest.rb +128 -0
- data/lib/bootpay_store/concern/store.rb +31 -0
- data/lib/bootpay_store/concern/supervisor.rb +211 -0
- data/lib/bootpay_store/concern/token.rb +24 -0
- data/lib/bootpay_store/concern/user.rb +325 -0
- data/lib/bootpay_store/concern/user_group.rb +221 -0
- data/lib/bootpay_store/concern/webhook.rb +17 -0
- data/lib/bootpay_store/concern.rb +45 -0
- data/lib/bootpay_store/response.rb +14 -0
- data/lib/version.rb +9 -0
- metadata +77 -49
- data/.DS_Store +0 -0
- data/.env.example +0 -23
- data/lib/.DS_Store +0 -0
- data/lib/bootpay/.DS_Store +0 -0
- data/lib/bootpay/authentication.rb +0 -61
- data/lib/bootpay/automatic_transfer.rb +0 -56
- data/lib/bootpay/billing.rb +0 -157
- data/lib/bootpay/cancel.rb +0 -29
- data/lib/bootpay/cash_receipt.rb +0 -77
- data/lib/bootpay/commerce/cart.rb +0 -20
- data/lib/bootpay/commerce/category.rb +0 -39
- data/lib/bootpay/commerce/commerce_resource.rb +0 -196
- data/lib/bootpay/commerce/coupon.rb +0 -41
- data/lib/bootpay/commerce/invoice.rb +0 -46
- data/lib/bootpay/commerce/order.rb +0 -61
- data/lib/bootpay/commerce/order_cancel.rb +0 -52
- data/lib/bootpay/commerce/order_subscription.rb +0 -117
- data/lib/bootpay/commerce/order_subscription_adjustment.rb +0 -29
- data/lib/bootpay/commerce/order_subscription_bill.rb +0 -50
- data/lib/bootpay/commerce/order_subscription_request.rb +0 -60
- data/lib/bootpay/commerce/point.rb +0 -36
- data/lib/bootpay/commerce/product.rb +0 -63
- data/lib/bootpay/commerce/store.rb +0 -21
- data/lib/bootpay/commerce/user.rb +0 -75
- data/lib/bootpay/commerce/user_group.rb +0 -70
- data/lib/bootpay/easy.rb +0 -25
- data/lib/bootpay/escrow.rb +0 -24
- data/lib/bootpay/link.rb +0 -60
- data/lib/bootpay/naverpay.rb +0 -17
- data/lib/bootpay/payment_resource.rb +0 -31
- data/lib/bootpay/reseller.rb +0 -12
- data/lib/bootpay/rest.rb +0 -46
- data/lib/bootpay/submit.rb +0 -20
- data/lib/bootpay/token.rb +0 -33
- data/lib/bootpay/verification.rb +0 -55
- data/lib/bootpay/version.rb +0 -25
- data/lib/bootpay/wallet.rb +0 -56
- data/lib/bootpay_commerce.rb +0 -152
- /data/lib/{response.rb → bootpay/response.rb} +0 -0
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bootpay
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- gosomi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -38,15 +38,27 @@ dependencies:
|
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
|
-
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: addressable
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
description: 부트페이 공식 Ruby 서버사이드 모듈입니다. 결제조회, 취소, 빌링키 결제시 사용됩니다.
|
|
42
56
|
email:
|
|
43
|
-
- bootpay.co.kr
|
|
57
|
+
- gosomi@bootpay.co.kr
|
|
44
58
|
executables: []
|
|
45
59
|
extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
|
47
61
|
files:
|
|
48
|
-
- ".DS_Store"
|
|
49
|
-
- ".env.example"
|
|
50
62
|
- ".gitignore"
|
|
51
63
|
- ".rspec"
|
|
52
64
|
- CHANGELOG.md
|
|
@@ -58,49 +70,65 @@ files:
|
|
|
58
70
|
- bin/console
|
|
59
71
|
- bin/setup
|
|
60
72
|
- bootpay.gemspec
|
|
61
|
-
- lib
|
|
73
|
+
- lib/bootpay-backend-ruby.rb
|
|
62
74
|
- lib/bootpay.rb
|
|
63
|
-
- lib/bootpay
|
|
64
|
-
- lib/bootpay/
|
|
65
|
-
- lib/bootpay/
|
|
66
|
-
- lib/bootpay/
|
|
67
|
-
- lib/bootpay/
|
|
68
|
-
- lib/bootpay/
|
|
69
|
-
- lib/bootpay/
|
|
70
|
-
- lib/bootpay/
|
|
71
|
-
- lib/bootpay/
|
|
72
|
-
- lib/bootpay/
|
|
73
|
-
- lib/bootpay/
|
|
74
|
-
- lib/bootpay/
|
|
75
|
-
- lib/bootpay/
|
|
76
|
-
- lib/bootpay/
|
|
77
|
-
- lib/bootpay/
|
|
78
|
-
- lib/bootpay/
|
|
79
|
-
- lib/bootpay/
|
|
80
|
-
- lib/bootpay/
|
|
81
|
-
- lib/bootpay
|
|
82
|
-
- lib/
|
|
83
|
-
- lib/
|
|
84
|
-
- lib/
|
|
85
|
-
- lib/
|
|
86
|
-
- lib/
|
|
87
|
-
- lib/
|
|
88
|
-
- lib/bootpay
|
|
89
|
-
- lib/
|
|
90
|
-
- lib/
|
|
91
|
-
- lib/
|
|
92
|
-
- lib/
|
|
93
|
-
- lib/
|
|
94
|
-
- lib/
|
|
95
|
-
- lib/
|
|
96
|
-
- lib/
|
|
97
|
-
- lib/
|
|
98
|
-
- lib/
|
|
99
|
-
|
|
75
|
+
- lib/bootpay/bootpay-rest-client.rb
|
|
76
|
+
- lib/bootpay/concern.rb
|
|
77
|
+
- lib/bootpay/concern/authenticate.rb
|
|
78
|
+
- lib/bootpay/concern/cash_receipt.rb
|
|
79
|
+
- lib/bootpay/concern/easy.rb
|
|
80
|
+
- lib/bootpay/concern/escrow.rb
|
|
81
|
+
- lib/bootpay/concern/payment.rb
|
|
82
|
+
- lib/bootpay/concern/reseller.rb
|
|
83
|
+
- lib/bootpay/concern/rest.rb
|
|
84
|
+
- lib/bootpay/concern/sdk.rb
|
|
85
|
+
- lib/bootpay/concern/seller.rb
|
|
86
|
+
- lib/bootpay/concern/service.rb
|
|
87
|
+
- lib/bootpay/concern/subscription.rb
|
|
88
|
+
- lib/bootpay/concern/token.rb
|
|
89
|
+
- lib/bootpay/concern/user_token.rb
|
|
90
|
+
- lib/bootpay/concern/wallet.rb
|
|
91
|
+
- lib/bootpay/concern/webhook.rb
|
|
92
|
+
- lib/bootpay/response.rb
|
|
93
|
+
- lib/bootpay_storage/bootpay-storage-rest-client.rb
|
|
94
|
+
- lib/bootpay_storage/concern.rb
|
|
95
|
+
- lib/bootpay_storage/concern/csv.rb
|
|
96
|
+
- lib/bootpay_storage/concern/image.rb
|
|
97
|
+
- lib/bootpay_storage/concern/rest.rb
|
|
98
|
+
- lib/bootpay_storage/concern/token.rb
|
|
99
|
+
- lib/bootpay_storage/response.rb
|
|
100
|
+
- lib/bootpay_store/bootpay-store-rest-client.rb
|
|
101
|
+
- lib/bootpay_store/concern.rb
|
|
102
|
+
- lib/bootpay_store/concern/alimtalk_message.rb
|
|
103
|
+
- lib/bootpay_store/concern/alimtalk_official.rb
|
|
104
|
+
- lib/bootpay_store/concern/alimtalk_optout.rb
|
|
105
|
+
- lib/bootpay_store/concern/alimtalk_send.rb
|
|
106
|
+
- lib/bootpay_store/concern/alimtalk_sender.rb
|
|
107
|
+
- lib/bootpay_store/concern/alimtalk_template.rb
|
|
108
|
+
- lib/bootpay_store/concern/alimtalk_webhook.rb
|
|
109
|
+
- lib/bootpay_store/concern/invoice.rb
|
|
110
|
+
- lib/bootpay_store/concern/mall_setting.rb
|
|
111
|
+
- lib/bootpay_store/concern/order.rb
|
|
112
|
+
- lib/bootpay_store/concern/order_subscription.rb
|
|
113
|
+
- lib/bootpay_store/concern/payment.rb
|
|
114
|
+
- lib/bootpay_store/concern/product.rb
|
|
115
|
+
- lib/bootpay_store/concern/rest.rb
|
|
116
|
+
- lib/bootpay_store/concern/store.rb
|
|
117
|
+
- lib/bootpay_store/concern/supervisor.rb
|
|
118
|
+
- lib/bootpay_store/concern/token.rb
|
|
119
|
+
- lib/bootpay_store/concern/user.rb
|
|
120
|
+
- lib/bootpay_store/concern/user_group.rb
|
|
121
|
+
- lib/bootpay_store/concern/webhook.rb
|
|
122
|
+
- lib/bootpay_store/response.rb
|
|
123
|
+
- lib/version.rb
|
|
124
|
+
homepage: https://www.bootpay.ai
|
|
100
125
|
licenses:
|
|
101
126
|
- MIT
|
|
102
127
|
metadata:
|
|
103
|
-
homepage_uri:
|
|
128
|
+
homepage_uri: https://www.bootpay.ai
|
|
129
|
+
source_code_uri: https://github.com/bootpay/backend-ruby/tree/2-x-development
|
|
130
|
+
changelog_uri: https://github.com/bootpay/backend-ruby/blob/2-x-development/CHANGELOG.md
|
|
131
|
+
documentation_uri: https://developers.bootpay.ai
|
|
104
132
|
post_install_message:
|
|
105
133
|
rdoc_options: []
|
|
106
134
|
require_paths:
|
|
@@ -109,15 +137,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
109
137
|
requirements:
|
|
110
138
|
- - ">="
|
|
111
139
|
- !ruby/object:Gem::Version
|
|
112
|
-
version: 2.
|
|
140
|
+
version: 2.6.0
|
|
113
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
142
|
requirements:
|
|
115
143
|
- - ">="
|
|
116
144
|
- !ruby/object:Gem::Version
|
|
117
145
|
version: '0'
|
|
118
146
|
requirements: []
|
|
119
|
-
rubygems_version: 3.
|
|
147
|
+
rubygems_version: 3.4.10
|
|
120
148
|
signing_key:
|
|
121
149
|
specification_version: 4
|
|
122
|
-
summary: Bootpay
|
|
150
|
+
summary: Bootpay Ruby REST Client
|
|
123
151
|
test_files: []
|
data/.DS_Store
DELETED
|
Binary file
|
data/.env.example
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Bootpay server SDK example/test credentials
|
|
2
|
-
BOOTPAY_ENV=production
|
|
3
|
-
|
|
4
|
-
# PG 인증 방식: new (client_key/secret_key, default) 또는 legacy (application_id/private_key)
|
|
5
|
-
BOOTPAY_AUTH_MODE=new
|
|
6
|
-
|
|
7
|
-
# PG API - recommended client_key/secret_key
|
|
8
|
-
BOOTPAY_PG_CLIENT_KEY_PROD=OdKci2s0ux9iyFWsgYHdKw
|
|
9
|
-
BOOTPAY_PG_SECRET_KEY_PROD=L15AxIjXxGwFj9xe7NUUOt9VPHqP-CvyXJuK-FqMHto=
|
|
10
|
-
BOOTPAY_PG_CLIENT_KEY_DEV=K1Xok7RzFxbT7zMBmiBXNw
|
|
11
|
-
BOOTPAY_PG_SECRET_KEY_DEV=vcd_5OXoQAxTA8JSg2VGaSnwmQPkd8DgQ6xiyL6QkyE=
|
|
12
|
-
|
|
13
|
-
# PG API - legacy application_id/private_key (호환성 검증용)
|
|
14
|
-
BOOTPAY_PG_APPLICATION_ID_PROD=5b8f6a4d396fa665fdc2b5ea
|
|
15
|
-
BOOTPAY_PG_PRIVATE_KEY_PROD=rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=
|
|
16
|
-
BOOTPAY_PG_APPLICATION_ID_DEV=59bfc738e13f337dbd6ca48a
|
|
17
|
-
BOOTPAY_PG_PRIVATE_KEY_DEV=pDc0NwlkEX3aSaHTp/PPL/i8vn5E/CqRChgyEp/gHD0=
|
|
18
|
-
|
|
19
|
-
# Commerce API
|
|
20
|
-
BOOTPAY_COMMERCE_CLIENT_KEY_PROD=K1Xok7RzFxbT7zMBmiBXNw
|
|
21
|
-
BOOTPAY_COMMERCE_SECRET_KEY_PROD=vcd_5OXoQAxTA8JSg2VGaSnwmQPkd8DgQ6xiyL6QkyE=
|
|
22
|
-
BOOTPAY_COMMERCE_CLIENT_KEY_DEV=ZYEi9d93uIaQFEuxXEZfyQ
|
|
23
|
-
BOOTPAY_COMMERCE_SECRET_KEY_DEV=j8ONDlZQVHgAWq52g97pGNCqxahGatyZKuC2O09r9MM=
|
data/lib/.DS_Store
DELETED
|
Binary file
|
data/lib/bootpay/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
module Bootpay::Authentication
|
|
2
|
-
extend ActiveSupport::Concern
|
|
3
|
-
|
|
4
|
-
included do
|
|
5
|
-
# 본인인증 요청 (SMS / PASS)
|
|
6
|
-
# NodeJS: POST request/authentication
|
|
7
|
-
def request_authentication(authentication_id: nil, pg: nil, method: nil, username: nil,
|
|
8
|
-
identity_no: nil, carrier: nil, phone: nil, client_ip: nil,
|
|
9
|
-
order_name: nil, site_url: nil, authenticate_type: nil,
|
|
10
|
-
extra: nil, user: nil, metadata: nil)
|
|
11
|
-
raise 'authentication_id 값을 입력해주세요.' if authentication_id.blank?
|
|
12
|
-
raise 'pg 값을 입력해주세요.' if pg.blank?
|
|
13
|
-
raise 'method 값을 입력해주세요.' if method.blank?
|
|
14
|
-
raise 'username 값을 입력해주세요.' if username.blank?
|
|
15
|
-
raise 'identity_no 값을 입력해주세요.' if identity_no.blank?
|
|
16
|
-
raise 'carrier 값을 입력해주세요.' if carrier.blank?
|
|
17
|
-
raise 'phone 값을 입력해주세요.' if phone.blank?
|
|
18
|
-
raise 'client_ip 값을 입력해주세요.' if client_ip.blank?
|
|
19
|
-
raise 'order_name 값을 입력해주세요.' if order_name.blank?
|
|
20
|
-
request(
|
|
21
|
-
uri: 'request/authentication',
|
|
22
|
-
payload: {
|
|
23
|
-
authentication_id: authentication_id,
|
|
24
|
-
pg: pg,
|
|
25
|
-
method: method,
|
|
26
|
-
username: username,
|
|
27
|
-
identity_no: identity_no,
|
|
28
|
-
carrier: carrier,
|
|
29
|
-
phone: phone,
|
|
30
|
-
client_ip: client_ip,
|
|
31
|
-
order_name: order_name,
|
|
32
|
-
site_url: site_url,
|
|
33
|
-
authenticate_type: authenticate_type,
|
|
34
|
-
extra: extra,
|
|
35
|
-
user: user,
|
|
36
|
-
metadata: metadata
|
|
37
|
-
}.compact
|
|
38
|
-
)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# 본인인증 확인 (OTP 입력)
|
|
42
|
-
# NodeJS: POST authenticate/confirm
|
|
43
|
-
def confirm_authentication(receipt_id, otp: nil)
|
|
44
|
-
raise 'receipt_id 값을 입력해주세요.' if receipt_id.blank?
|
|
45
|
-
request(
|
|
46
|
-
uri: 'authenticate/confirm',
|
|
47
|
-
payload: { receipt_id: receipt_id, otp: otp }.compact
|
|
48
|
-
)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# 본인인증 SMS 재발송
|
|
52
|
-
# NodeJS: POST authenticate/realarm
|
|
53
|
-
def realarm_authentication(receipt_id)
|
|
54
|
-
raise 'receipt_id 값을 입력해주세요.' if receipt_id.blank?
|
|
55
|
-
request(
|
|
56
|
-
uri: 'authenticate/realarm',
|
|
57
|
-
payload: { receipt_id: receipt_id }
|
|
58
|
-
)
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
module Bootpay::AutomaticTransfer
|
|
2
|
-
extend ActiveSupport::Concern
|
|
3
|
-
|
|
4
|
-
included do
|
|
5
|
-
# 자동이체 빌링키 발급 요청
|
|
6
|
-
# NodeJS: POST request/subscribe/automatic-transfer
|
|
7
|
-
def request_subscribe_automatic_transfer_billing_key(
|
|
8
|
-
pg: nil, order_name: nil, subscription_id: nil,
|
|
9
|
-
auth_type: nil, username: nil, bank_name: nil, bank_account: nil, identity_no: nil,
|
|
10
|
-
method: nil, cash_receipt_type: nil, cash_receipt_identity_no: nil,
|
|
11
|
-
phone: nil, price: nil, tax_free: nil,
|
|
12
|
-
extra: nil, user: nil, metadata: nil
|
|
13
|
-
)
|
|
14
|
-
raise 'pg 값을 입력해주세요.' if pg.blank?
|
|
15
|
-
raise 'order_name 값을 입력해주세요.' if order_name.blank?
|
|
16
|
-
raise 'subscription_id 값을 입력해주세요.' if subscription_id.blank?
|
|
17
|
-
raise 'auth_type 값을 입력해주세요.' if auth_type.blank?
|
|
18
|
-
raise 'username 값을 입력해주세요.' if username.blank?
|
|
19
|
-
raise 'bank_name 값을 입력해주세요.' if bank_name.blank?
|
|
20
|
-
raise 'bank_account 값을 입력해주세요.' if bank_account.blank?
|
|
21
|
-
raise 'identity_no 값을 입력해주세요.' if identity_no.blank?
|
|
22
|
-
request(
|
|
23
|
-
uri: 'request/subscribe/automatic-transfer',
|
|
24
|
-
payload: {
|
|
25
|
-
pg: pg,
|
|
26
|
-
order_name: order_name,
|
|
27
|
-
subscription_id: subscription_id,
|
|
28
|
-
auth_type: auth_type, # ARS | 간편인증
|
|
29
|
-
username: username,
|
|
30
|
-
bank_name: bank_name,
|
|
31
|
-
bank_account: bank_account,
|
|
32
|
-
identity_no: identity_no,
|
|
33
|
-
method: method,
|
|
34
|
-
cash_receipt_type: cash_receipt_type, # 소득공제 | 지출증빙
|
|
35
|
-
cash_receipt_identity_no: cash_receipt_identity_no,
|
|
36
|
-
phone: phone,
|
|
37
|
-
price: price,
|
|
38
|
-
tax_free: tax_free,
|
|
39
|
-
extra: extra,
|
|
40
|
-
user: user,
|
|
41
|
-
metadata: metadata
|
|
42
|
-
}.compact
|
|
43
|
-
)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# 자동이체 빌링키 발급 완료
|
|
47
|
-
# NodeJS: POST request/subscribe/automatic-transfer/publish
|
|
48
|
-
def publish_automatic_transfer_billing_key(receipt_id)
|
|
49
|
-
raise 'receipt_id 값을 입력해주세요.' if receipt_id.blank?
|
|
50
|
-
request(
|
|
51
|
-
uri: 'request/subscribe/automatic-transfer/publish',
|
|
52
|
-
payload: { receipt_id: receipt_id }
|
|
53
|
-
)
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
data/lib/bootpay/billing.rb
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
module Bootpay::Billing
|
|
2
|
-
extend ActiveSupport::Concern
|
|
3
|
-
|
|
4
|
-
included do
|
|
5
|
-
# 빌링키 가져오기
|
|
6
|
-
# Comment by ehowlsla
|
|
7
|
-
# Date: 2021-08-30
|
|
8
|
-
def get_billing_key(order_id: nil, pg: nil, item_name: nil, card_no: nil, card_pw: nil, expire_year: nil, expire_month: nil, identify_number: nil,
|
|
9
|
-
user_info: { # 구매자 정보
|
|
10
|
-
id: nil, # 개발사에서 관리하는 회원 고유 id
|
|
11
|
-
username: nil, # 구매자 이름
|
|
12
|
-
email: nil, # 구매자 email
|
|
13
|
-
phone: nil, # 01012341234
|
|
14
|
-
gender: nil, # 0:여자, 1:남자
|
|
15
|
-
area: nil, # 서울|인천|대구|광주|부산|울산|경기|강원|충청북도|충북|충청남도|충남|전라북도|전북|전라남도|전남|경상북도|경북|경상남도|경남|제주|세종|대전 중 택 1
|
|
16
|
-
birth: nil # 생일 901004
|
|
17
|
-
},
|
|
18
|
-
extra: { # 기타 설정
|
|
19
|
-
subscribe_test_payment: nil, # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러
|
|
20
|
-
raw_data: nil # raw_data: PG 오류 코드 및 메세지까지 리턴
|
|
21
|
-
})
|
|
22
|
-
request(
|
|
23
|
-
uri: 'request/card_rebill',
|
|
24
|
-
payload:
|
|
25
|
-
{
|
|
26
|
-
order_id: order_id, # 개발사에서 관리하는 고유 주문 번호
|
|
27
|
-
pg: pg, # PG사의 Alias ex) danal, kcp, inicis 등
|
|
28
|
-
item_name: item_name, # 상품명
|
|
29
|
-
card_no: card_no, # 카드 일련번호
|
|
30
|
-
card_pw: card_pw, # 카드 비밀번호 앞 2자리
|
|
31
|
-
expire_year: expire_year, # 카드 유효기간 년
|
|
32
|
-
expire_month: expire_month, # 카드 유효기간 월
|
|
33
|
-
identify_number: identify_number, # 주민등록번호 또는 사업자번호
|
|
34
|
-
user_info: user_info, # 구매자 정보
|
|
35
|
-
extra: extra.values.any? {|v|v != nil} ? extra : nil
|
|
36
|
-
}.compact
|
|
37
|
-
)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# 빌링키 삭제하기
|
|
41
|
-
# Comment by ehowlsla
|
|
42
|
-
# Date: 2021-08-30
|
|
43
|
-
def destroy_billing_key(billing_key)
|
|
44
|
-
request(
|
|
45
|
-
method: :delete,
|
|
46
|
-
uri: "subscribe/billing/#{billing_key}"
|
|
47
|
-
)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# 빌링키로 결제 요청하기
|
|
51
|
-
# Comment by ehowlsla
|
|
52
|
-
# Date: 2021-08-30
|
|
53
|
-
def subscribe_billing(billing_key: nil, item_name: nil, price: 0, tax_free: 0, order_id: nil, quota: nil, interest: nil,
|
|
54
|
-
user_info: { # 구매자 정보
|
|
55
|
-
id: nil, # 개발사에서 관리하는 회원 고유 id
|
|
56
|
-
username: nil, # 구매자 이름
|
|
57
|
-
email: nil, # 구매자 email
|
|
58
|
-
phone: nil, # 01012341234
|
|
59
|
-
gender: nil, # 0:여자, 1:남자
|
|
60
|
-
area: nil, # 서울|인천|대구|광주|부산|울산|경기|강원|충청북도|충북|충청남도|충남|전라북도|전북|전라남도|전남|경상북도|경북|경상남도|경남|제주|세종|대전 중 택 1
|
|
61
|
-
birth: nil # 생일 901004
|
|
62
|
-
},
|
|
63
|
-
items: nil, # 상품 정보 배열
|
|
64
|
-
feedback_url: nil, feedback_content_type: nil,
|
|
65
|
-
extra: { # 기타 설정
|
|
66
|
-
subscribe_test_payment: nil, # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러
|
|
67
|
-
raw_data: nil # raw_data: PG 오류 코드 및 메세지까지 리턴
|
|
68
|
-
})
|
|
69
|
-
raise 'billing_key 값을 입력해주세요.' if billing_key.blank?
|
|
70
|
-
raise 'item_name 값을 입력해주세요.' if item_name.blank?
|
|
71
|
-
raise 'price 금액을 설정을 해주세요.' if price.blank?
|
|
72
|
-
raise 'order_id 주문번호를 설정해주세요.' if order_id.blank?
|
|
73
|
-
request(
|
|
74
|
-
uri: 'subscribe/billing',
|
|
75
|
-
payload: {
|
|
76
|
-
billing_key: billing_key, # 발급받은 빌링키
|
|
77
|
-
item_name: item_name, # 결제할 상품명, 결제창에 노출됨
|
|
78
|
-
price: price, # 결제할 상품금액
|
|
79
|
-
tax_free: tax_free, # 면세 상품일 경우 해당만큼의 금액을 설정
|
|
80
|
-
order_id: order_id, # 개발사에서 지정하는 고유주문번호
|
|
81
|
-
quota: quota, # 5만원 이상 결제건에 적용하는 할부개월수. 0-일시불, 1은 지정시 에러 발생함, 2-2개월, 3-3개월... 12까지 지정가능
|
|
82
|
-
interest: interest, # 웰컴페이먼츠 전용, 무이자여부를 보내는 파라미터가 있다
|
|
83
|
-
user_info: user_info.values.any? {|v|v != nil} ? user_info : nil,
|
|
84
|
-
items: items, # 상품 정보 배열
|
|
85
|
-
feedback_url: feedback_url, # webhook 통지시 받으실 url 주소 (localhost 사용 불가)
|
|
86
|
-
feedback_content_type: feedback_content_type.presence || 'urlencoded', # webhook 통지시 받으실 데이터 타입 (json 또는 urlencoded, 기본값 urlencoded)
|
|
87
|
-
extra: extra.values.any? {|v|v != nil} ? extra : nil # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러, raw_data: PG 오류 코드 및 메세지까지 리턴
|
|
88
|
-
}.compact,
|
|
89
|
-
)
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
# 빌링키로 결제 예약하기
|
|
93
|
-
# Comment by ehowlsla
|
|
94
|
-
# Date: 2021-08-30
|
|
95
|
-
def subscribe_reserve_billing(billing_key: nil, item_name: nil, price: 0, tax_free: 0, order_id: nil, quota: 12, interest: 0,
|
|
96
|
-
user_info: {id: nil, username: nil, email: nil, phone: nil, gender: nil, area: nil, birth: nil},
|
|
97
|
-
items: nil, # 상품 정보 배열
|
|
98
|
-
feedback_url: nil, feedback_content_type: nil,
|
|
99
|
-
extra: {subscribe_test_payment: 0, raw_data: 0},
|
|
100
|
-
execute_at: nil)
|
|
101
|
-
raise 'billing_key 값을 입력해주세요.' if billing_key.blank?
|
|
102
|
-
raise 'item_name 값을 입력해주세요.' if item_name.blank?
|
|
103
|
-
raise 'price 금액을 설정을 해주세요.' if price.blank?
|
|
104
|
-
raise 'order_id 주문번호를 설정해주세요.' if order_id.blank?
|
|
105
|
-
request(
|
|
106
|
-
uri: 'subscribe/billing/reserve',
|
|
107
|
-
payload: {
|
|
108
|
-
billing_key: billing_key, # 발급받은 빌링키
|
|
109
|
-
item_name: item_name, # 결제할 상품명, 결제창에 노출됨
|
|
110
|
-
price: price, # 결제할 상품금액
|
|
111
|
-
tax_free: tax_free, # 면세 상품일 경우 해당만큼의 금액을 설정
|
|
112
|
-
order_id: order_id, # 개발사에서 지정하는 고유주문번호
|
|
113
|
-
quota: quota, # 5만원 이상 결제건에 적용하는 할부개월수. 0-일시불, 1은 지정시 에러 발생함, 2-2개월, 3-3개월... 12까지 지정가능
|
|
114
|
-
interest: interest, # 웰컴페이먼츠 전용, 무이자여부를 보내는 파라미터가 있다
|
|
115
|
-
user_info: user_info.values.any? {|v|v != nil} ? user_info : nil,
|
|
116
|
-
items: items, # 상품 정보 배열
|
|
117
|
-
feedback_url: feedback_url, # webhook 통지시 받으실 url 주소 (localhost 사용 불가)
|
|
118
|
-
feedback_content_type: feedback_content_type.presence || 'urlencoded', # webhook 통지시 받으실 데이터 타입 (json 또는 urlencoded, 기본값 urlencoded)
|
|
119
|
-
extra: extra.values.any? {|v|v != nil} ? extra : nil, # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러, raw_data: PG 오류 코드 및 메세지까지 리턴
|
|
120
|
-
scheduler_type: 'oneshot',
|
|
121
|
-
execute_at: execute_at.presence || (Time.now + 10.seconds).to_i # 예약 실행시간, 미지정 시 10초뒤 실행
|
|
122
|
-
}.compact,
|
|
123
|
-
)
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
# 결제 예약 취소하기
|
|
127
|
-
# Comment by ehowlsla
|
|
128
|
-
# Date: 2021-08-30
|
|
129
|
-
def subscribe_reserve_cancel(reserve_id)
|
|
130
|
-
raise 'reserve_id를 입력해주세요.' if reserve_id.blank?
|
|
131
|
-
request(
|
|
132
|
-
method: :delete,
|
|
133
|
-
uri: "subscribe/billing/reserve/#{reserve_id}"
|
|
134
|
-
)
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
# 빌링키 단일 조회
|
|
138
|
-
# NodeJS: GET billing_key/{billingKey}
|
|
139
|
-
def lookup_billing_key(billing_key)
|
|
140
|
-
raise 'billing_key 값을 입력해주세요.' if billing_key.blank?
|
|
141
|
-
request(
|
|
142
|
-
method: :get,
|
|
143
|
-
uri: "billing_key/#{billing_key}"
|
|
144
|
-
)
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
# 예약 결제 단일 조회
|
|
148
|
-
# NodeJS: GET subscribe/payment/reserve/{reserveId}
|
|
149
|
-
def subscribe_payment_reserve_lookup(reserve_id)
|
|
150
|
-
raise 'reserve_id 값을 입력해주세요.' if reserve_id.blank?
|
|
151
|
-
request(
|
|
152
|
-
method: :get,
|
|
153
|
-
uri: "subscribe/payment/reserve/#{reserve_id}"
|
|
154
|
-
)
|
|
155
|
-
end
|
|
156
|
-
end
|
|
157
|
-
end
|
data/lib/bootpay/cancel.rb
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module Bootpay::Cancel
|
|
2
|
-
extend ActiveSupport::Concern
|
|
3
|
-
|
|
4
|
-
included do
|
|
5
|
-
# 결제 취소 요청
|
|
6
|
-
# Comment by Gosomi
|
|
7
|
-
# Date: 2021-05-21
|
|
8
|
-
def cancel_payment(cancel_id: nil, receipt_id:, cancel_price: nil, cancel_tax_free: 0, cancel_username: '시스템', cancel_message: '결제취소',
|
|
9
|
-
refund: { # (선택사항) 가상계좌 환불요청시, 전제조건으로 PG사와 CMS 특약이 체결되어 있을 경우에만 환불요청 가능, 기본적으로 가상계좌는 결제취소가 안됨
|
|
10
|
-
account: nil, # 환불받을 계좌번호 - 675601***1234
|
|
11
|
-
accountholder: nil, # 환불받을 계좌주 - 홍길동
|
|
12
|
-
bankcode: nil # 은행 코드
|
|
13
|
-
})
|
|
14
|
-
request(
|
|
15
|
-
uri: 'cancel',
|
|
16
|
-
payload:
|
|
17
|
-
{
|
|
18
|
-
cancel_id: cancel_id.presence || SecureRandom.uuid, # (선택사항) 부분취소 요청시 중복 요청을 방지하기 위한 고유값
|
|
19
|
-
receipt_id: receipt_id, # 부트페이에서 발급한 영수증 id
|
|
20
|
-
price: cancel_price, # (선택사항) 부분취소 요청시 금액을 지정, 미지정시 전액 취소 (부분취소가 가능한 PG사, 결제수단에 한해 적용됨)
|
|
21
|
-
tax_free: cancel_tax_free, # 취소할 비과세 금액
|
|
22
|
-
name: cancel_username, # 취소 요청자 이름
|
|
23
|
-
reason: cancel_message, # 취소 요청 사유
|
|
24
|
-
refund: refund.values.any? {|v|v != nil} ? refund : nil # (선택사항) 가상계좌 환불요청시, 전제조건으로 PG사와 CMS 특약이 체결되어 있을 경우에만 환불요청 가능, 기본적으로 가상계좌는 결제취소가 안됨
|
|
25
|
-
}.compact
|
|
26
|
-
)
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
data/lib/bootpay/cash_receipt.rb
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
module Bootpay::CashReceipt
|
|
2
|
-
extend ActiveSupport::Concern
|
|
3
|
-
|
|
4
|
-
included do
|
|
5
|
-
# 결제 건에 현금영수증 발급 요청
|
|
6
|
-
# NodeJS: POST request/receipt/cash/publish
|
|
7
|
-
def cash_receipt_publish_on_receipt(receipt_id: nil, identity_no: nil,
|
|
8
|
-
cash_receipt_type: nil, username: nil,
|
|
9
|
-
email: nil, phone: nil, currency: nil)
|
|
10
|
-
raise 'receipt_id 값을 입력해주세요.' if receipt_id.blank?
|
|
11
|
-
raise 'identity_no 값을 입력해주세요.' if identity_no.blank?
|
|
12
|
-
raise 'cash_receipt_type 값을 입력해주세요.' if cash_receipt_type.blank?
|
|
13
|
-
request(
|
|
14
|
-
uri: 'request/receipt/cash/publish',
|
|
15
|
-
payload: {
|
|
16
|
-
receipt_id: receipt_id,
|
|
17
|
-
identity_no: identity_no,
|
|
18
|
-
cash_receipt_type: cash_receipt_type, # 소득공제 | 지출증빙
|
|
19
|
-
username: username,
|
|
20
|
-
email: email,
|
|
21
|
-
phone: phone,
|
|
22
|
-
currency: currency
|
|
23
|
-
}.compact
|
|
24
|
-
)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# 결제 건에 발급된 현금영수증 취소
|
|
28
|
-
# NodeJS: DELETE request/receipt/cash/cancel/{receiptId}
|
|
29
|
-
def cash_receipt_cancel_on_receipt(receipt_id, cancel_username: nil, cancel_message: nil)
|
|
30
|
-
raise 'receipt_id 값을 입력해주세요.' if receipt_id.blank?
|
|
31
|
-
request(
|
|
32
|
-
method: :delete,
|
|
33
|
-
uri: "request/receipt/cash/cancel/#{receipt_id}",
|
|
34
|
-
params: { cancel_username: cancel_username, cancel_message: cancel_message }.compact
|
|
35
|
-
)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
# 단독 현금영수증 발급
|
|
39
|
-
# NodeJS: POST request/cash/receipt
|
|
40
|
-
def request_cash_receipt(pg: nil, price: nil, order_name: nil, cash_receipt_type: nil,
|
|
41
|
-
identity_no: nil, order_id: nil, tax_free: nil,
|
|
42
|
-
purchased_at: nil, user: nil, extra: nil)
|
|
43
|
-
raise 'pg 값을 입력해주세요.' if pg.blank?
|
|
44
|
-
raise 'price 값을 입력해주세요.' if price.blank?
|
|
45
|
-
raise 'order_name 값을 입력해주세요.' if order_name.blank?
|
|
46
|
-
raise 'cash_receipt_type 값을 입력해주세요.' if cash_receipt_type.blank?
|
|
47
|
-
raise 'identity_no 값을 입력해주세요.' if identity_no.blank?
|
|
48
|
-
raise 'order_id 값을 입력해주세요.' if order_id.blank?
|
|
49
|
-
request(
|
|
50
|
-
uri: 'request/cash/receipt',
|
|
51
|
-
payload: {
|
|
52
|
-
pg: pg,
|
|
53
|
-
price: price,
|
|
54
|
-
order_name: order_name,
|
|
55
|
-
cash_receipt_type: cash_receipt_type,
|
|
56
|
-
identity_no: identity_no,
|
|
57
|
-
order_id: order_id,
|
|
58
|
-
tax_free: tax_free,
|
|
59
|
-
purchased_at: purchased_at,
|
|
60
|
-
user: user,
|
|
61
|
-
extra: extra
|
|
62
|
-
}.compact
|
|
63
|
-
)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
# 단독 현금영수증 취소
|
|
67
|
-
# NodeJS: DELETE request/cash/receipt/{receiptId}
|
|
68
|
-
def cancel_cash_receipt(receipt_id, cancel_username: nil, cancel_message: nil)
|
|
69
|
-
raise 'receipt_id 값을 입력해주세요.' if receipt_id.blank?
|
|
70
|
-
request(
|
|
71
|
-
method: :delete,
|
|
72
|
-
uri: "request/cash/receipt/#{receipt_id}",
|
|
73
|
-
params: { cancel_username: cancel_username, cancel_message: cancel_message }.compact
|
|
74
|
-
)
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bootpay
|
|
4
|
-
module Commerce
|
|
5
|
-
class CartModule
|
|
6
|
-
def initialize(bootpay)
|
|
7
|
-
@bootpay = bootpay
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# 주문 미리보기 (배송비/할인 권위적 계산)
|
|
11
|
-
# POST /v1/cart/order-preview
|
|
12
|
-
#
|
|
13
|
-
# member_mode='guest' (기본): cart_items 필수
|
|
14
|
-
# member_mode='member': 서버 장바구니 사용 (user 토큰 필요)
|
|
15
|
-
def order_preview(params = {})
|
|
16
|
-
@bootpay.post('cart/order-preview', params)
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bootpay
|
|
4
|
-
module Commerce
|
|
5
|
-
class CategoryModule
|
|
6
|
-
def initialize(bootpay)
|
|
7
|
-
@bootpay = bootpay
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# 카테고리 트리 조회
|
|
11
|
-
def list
|
|
12
|
-
@bootpay.get('categories')
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# 카테고리 단건 조회
|
|
16
|
-
def detail(category_id)
|
|
17
|
-
@bootpay.get("categories/#{category_id}")
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# 카테고리 생성
|
|
21
|
-
def create(params)
|
|
22
|
-
@bootpay.post('categories', params)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# 카테고리 수정
|
|
26
|
-
def update(params)
|
|
27
|
-
raise ArgumentError, 'category_id is required' unless params[:category_id]
|
|
28
|
-
category_id = params[:category_id]
|
|
29
|
-
body = params.reject { |k, _| k == :category_id }
|
|
30
|
-
@bootpay.put("categories/#{category_id}", body)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# 카테고리 삭제
|
|
34
|
-
def destroy(category_id)
|
|
35
|
-
@bootpay.delete("categories/#{category_id}")
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|