bootpay 1.1.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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -2
  3. data/.rspec +2 -0
  4. data/CHANGELOG.md +64 -14
  5. data/CODE_OF_CONDUCT.md +1 -1
  6. data/Gemfile +2 -4
  7. data/LICENSE.txt +1 -1
  8. data/README.md +309 -171
  9. data/Rakefile +3 -3
  10. data/bin/console +1 -1
  11. data/bootpay.gemspec +27 -24
  12. data/lib/bootpay/bootpay-rest-client.rb +51 -0
  13. data/lib/bootpay/concern/authenticate.rb +69 -0
  14. data/lib/bootpay/concern/cash_receipt.rb +83 -0
  15. data/lib/bootpay/concern/easy.rb +18 -0
  16. data/lib/bootpay/concern/escrow.rb +25 -0
  17. data/lib/bootpay/concern/payment.rb +126 -0
  18. data/lib/bootpay/concern/reseller.rb +97 -0
  19. data/lib/bootpay/concern/rest.rb +56 -0
  20. data/lib/bootpay/concern/sdk.rb +52 -0
  21. data/lib/bootpay/concern/seller.rb +15 -0
  22. data/lib/bootpay/concern/service.rb +15 -0
  23. data/lib/bootpay/concern/subscription.rb +211 -0
  24. data/lib/bootpay/concern/token.rb +33 -0
  25. data/lib/bootpay/concern/user_token.rb +23 -0
  26. data/lib/bootpay/concern/wallet.rb +20 -0
  27. data/lib/bootpay/concern/webhook.rb +18 -0
  28. data/lib/bootpay/concern.rb +35 -0
  29. data/lib/bootpay-backend-ruby.rb +6 -0
  30. data/lib/bootpay.rb +9 -49
  31. data/lib/bootpay_storage/bootpay-storage-rest-client.rb +46 -0
  32. data/lib/bootpay_storage/concern/csv.rb +18 -0
  33. data/lib/bootpay_storage/concern/image.rb +30 -0
  34. data/lib/bootpay_storage/concern/rest.rb +176 -0
  35. data/lib/bootpay_storage/concern/token.rb +9 -0
  36. data/lib/bootpay_storage/concern.rb +12 -0
  37. data/lib/bootpay_storage/response.rb +14 -0
  38. data/lib/bootpay_store/bootpay-store-rest-client.rb +47 -0
  39. data/lib/bootpay_store/concern/alimtalk_message.rb +67 -0
  40. data/lib/bootpay_store/concern/alimtalk_official.rb +63 -0
  41. data/lib/bootpay_store/concern/alimtalk_optout.rb +72 -0
  42. data/lib/bootpay_store/concern/alimtalk_send.rb +83 -0
  43. data/lib/bootpay_store/concern/alimtalk_sender.rb +105 -0
  44. data/lib/bootpay_store/concern/alimtalk_template.rb +215 -0
  45. data/lib/bootpay_store/concern/alimtalk_webhook.rb +84 -0
  46. data/lib/bootpay_store/concern/invoice.rb +102 -0
  47. data/lib/bootpay_store/concern/mall_setting.rb +385 -0
  48. data/lib/bootpay_store/concern/order.rb +74 -0
  49. data/lib/bootpay_store/concern/order_subscription.rb +391 -0
  50. data/lib/bootpay_store/concern/payment.rb +119 -0
  51. data/lib/bootpay_store/concern/product.rb +175 -0
  52. data/lib/bootpay_store/concern/rest.rb +128 -0
  53. data/lib/bootpay_store/concern/store.rb +31 -0
  54. data/lib/bootpay_store/concern/supervisor.rb +211 -0
  55. data/lib/bootpay_store/concern/token.rb +24 -0
  56. data/lib/bootpay_store/concern/user.rb +325 -0
  57. data/lib/bootpay_store/concern/user_group.rb +221 -0
  58. data/lib/bootpay_store/concern/webhook.rb +17 -0
  59. data/lib/bootpay_store/concern.rb +45 -0
  60. data/lib/bootpay_store/response.rb +14 -0
  61. data/lib/version.rb +9 -0
  62. metadata +81 -31
  63. data/.DS_Store +0 -0
  64. data/lib/.DS_Store +0 -0
  65. data/lib/bootpay/.DS_Store +0 -0
  66. data/lib/bootpay/billing.rb +0 -133
  67. data/lib/bootpay/cancel.rb +0 -29
  68. data/lib/bootpay/easy.rb +0 -25
  69. data/lib/bootpay/escrow.rb +0 -24
  70. data/lib/bootpay/link.rb +0 -60
  71. data/lib/bootpay/naverpay.rb +0 -17
  72. data/lib/bootpay/payment_resource.rb +0 -31
  73. data/lib/bootpay/reseller.rb +0 -12
  74. data/lib/bootpay/rest.rb +0 -38
  75. data/lib/bootpay/submit.rb +0 -20
  76. data/lib/bootpay/token.rb +0 -20
  77. data/lib/bootpay/verification.rb +0 -55
  78. data/lib/bootpay/version.rb +0 -25
  79. /data/lib/{response.rb → bootpay/response.rb} +0 -0
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - bootpay
7
+ - gosomi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-28 00:00:00.000000000 Z
11
+ date: 2026-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
19
+ version: '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: '6.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: http
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,14 +38,27 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: 결제검증 및 취소 등의 기능 연동을 위한 bootpay ruby 플러그인 입니다.
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@gmail.com
57
+ - gosomi@bootpay.co.kr
44
58
  executables: []
45
59
  extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
- - ".DS_Store"
49
62
  - ".gitignore"
50
63
  - ".rspec"
51
64
  - CHANGELOG.md
@@ -57,28 +70,65 @@ files:
57
70
  - bin/console
58
71
  - bin/setup
59
72
  - bootpay.gemspec
60
- - lib/.DS_Store
73
+ - lib/bootpay-backend-ruby.rb
61
74
  - lib/bootpay.rb
62
- - lib/bootpay/.DS_Store
63
- - lib/bootpay/billing.rb
64
- - lib/bootpay/cancel.rb
65
- - lib/bootpay/easy.rb
66
- - lib/bootpay/escrow.rb
67
- - lib/bootpay/link.rb
68
- - lib/bootpay/naverpay.rb
69
- - lib/bootpay/payment_resource.rb
70
- - lib/bootpay/reseller.rb
71
- - lib/bootpay/rest.rb
72
- - lib/bootpay/submit.rb
73
- - lib/bootpay/token.rb
74
- - lib/bootpay/verification.rb
75
- - lib/bootpay/version.rb
76
- - lib/response.rb
77
- homepage: http://www.bootpay.co.kr
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
78
125
  licenses:
79
126
  - MIT
80
127
  metadata:
81
- homepage_uri: http://www.bootpay.co.kr
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
82
132
  post_install_message:
83
133
  rdoc_options: []
84
134
  require_paths:
@@ -87,15 +137,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
137
  requirements:
88
138
  - - ">="
89
139
  - !ruby/object:Gem::Version
90
- version: 2.4.0
140
+ version: 2.6.0
91
141
  required_rubygems_version: !ruby/object:Gem::Requirement
92
142
  requirements:
93
143
  - - ">="
94
144
  - !ruby/object:Gem::Version
95
145
  version: '0'
96
146
  requirements: []
97
- rubygems_version: 3.2.19
147
+ rubygems_version: 3.4.10
98
148
  signing_key:
99
149
  specification_version: 4
100
- summary: Bootpay server side plugin for ruby
150
+ summary: Bootpay Ruby REST Client
101
151
  test_files: []
data/.DS_Store DELETED
Binary file
data/lib/.DS_Store DELETED
Binary file
Binary file
@@ -1,133 +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
- feedback_url: nil, feedback_content_type: nil,
64
- extra: { # 기타 설정
65
- subscribe_test_payment: nil, # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러
66
- raw_data: nil # raw_data: PG 오류 코드 및 메세지까지 리턴
67
- })
68
- raise 'billing_key 값을 입력해주세요.' if billing_key.blank?
69
- raise 'item_name 값을 입력해주세요.' if item_name.blank?
70
- raise 'price 금액을 설정을 해주세요.' if price.blank?
71
- raise 'order_id 주문번호를 설정해주세요.' if order_id.blank?
72
- request(
73
- uri: 'subscribe/billing',
74
- payload: {
75
- billing_key: billing_key, # 발급받은 빌링키
76
- item_name: item_name, # 결제할 상품명, 결제창에 노출됨
77
- price: price, # 결제할 상품금액
78
- tax_free: tax_free, # 면세 상품일 경우 해당만큼의 금액을 설정
79
- order_id: order_id, # 개발사에서 지정하는 고유주문번호
80
- quota: quota, # 5만원 이상 결제건에 적용하는 할부개월수. 0-일시불, 1은 지정시 에러 발생함, 2-2개월, 3-3개월... 12까지 지정가능
81
- interest: interest, # 웰컴페이먼츠 전용, 무이자여부를 보내는 파라미터가 있다
82
- user_info: user_info.values.any? {|v|v != nil} ? user_info : nil,
83
- feedback_url: feedback_url, # webhook 통지시 받으실 url 주소 (localhost 사용 불가)
84
- feedback_content_type: feedback_content_type.presence || 'urlencoded', # webhook 통지시 받으실 데이터 타입 (json 또는 urlencoded, 기본값 urlencoded)
85
- extra: extra.values.any? {|v|v != nil} ? extra : nil # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러, raw_data: PG 오류 코드 및 메세지까지 리턴
86
- }.compact,
87
- )
88
- end
89
-
90
- # 빌링키로 결제 예약하기
91
- # Comment by ehowlsla
92
- # Date: 2021-08-30
93
- def subscribe_reserve_billing(billing_key: nil, item_name: nil, price: 0, tax_free: 0, order_id: nil, quota: 12, interest: 0,
94
- user_info: {id: nil, username: nil, email: nil, phone: nil, gender: nil, area: nil, birth: nil},
95
- feedback_url: nil, feedback_content_type: nil,
96
- extra: {subscribeTestPayment: 0, raw_data: 0},
97
- execute_at: nil)
98
- raise 'billing_key 값을 입력해주세요.' if billing_key.blank?
99
- raise 'item_name 값을 입력해주세요.' if item_name.blank?
100
- raise 'price 금액을 설정을 해주세요.' if price.blank?
101
- raise 'order_id 주문번호를 설정해주세요.' if order_id.blank?
102
- request(
103
- uri: 'subscribe/billing/reserve',
104
- payload: {
105
- billing_key: billing_key, # 발급받은 빌링키
106
- item_name: item_name, # 결제할 상품명, 결제창에 노출됨
107
- price: price, # 결제할 상품금액
108
- tax_free: tax_free, # 면세 상품일 경우 해당만큼의 금액을 설정
109
- order_id: order_id, # 개발사에서 지정하는 고유주문번호
110
- quota: quota, # 5만원 이상 결제건에 적용하는 할부개월수. 0-일시불, 1은 지정시 에러 발생함, 2-2개월, 3-3개월... 12까지 지정가능
111
- interest: interest, # 웰컴페이먼츠 전용, 무이자여부를 보내는 파라미터가 있다
112
- user_info: user_info.values.any? {|v|v != nil} ? user_info : nil,
113
- feedback_url: feedback_url, # webhook 통지시 받으실 url 주소 (localhost 사용 불가)
114
- feedback_content_type: feedback_content_type.presence || 'urlencoded', # webhook 통지시 받으실 데이터 타입 (json 또는 urlencoded, 기본값 urlencoded)
115
- extra: extra.values.any? {|v|v != nil} ? extra : nil, # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러, raw_data: PG 오류 코드 및 메세지까지 리턴
116
- scheduler_type: 'oneshot',
117
- execute_at: execute_at.presence || (Time.now + 10.seconds).to_i # 예약 실행시간, 미지정 시 10초뒤 실행
118
- }.compact,
119
- )
120
- end
121
-
122
- # 결제 예약 취소하기
123
- # Comment by ehowlsla
124
- # Date: 2021-08-30
125
- def subscribe_reserve_cancel(reserve_id)
126
- raise 'reserve_id를 입력해주세요.' if reserve_id.blank?
127
- request(
128
- method: :delete,
129
- uri: "subscribe/billing/reserve/#{reserve_id}"
130
- )
131
- end
132
- end
133
- end
@@ -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/easy.rb DELETED
@@ -1,25 +0,0 @@
1
- module Bootpay::Easy
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- # 회원 Token을 요청한다
6
- # Comment by ehowlsla
7
- # Date: 2021-08-230
8
-
9
- def get_user_token(user_id: nil, email: nil, name: nil, gender: nil, birth: nil, phone: nil)
10
- raise 'user_id 값을 입력해주세요.' if user_id.blank?
11
-
12
- request(
13
- uri: 'request/user/token',
14
- payload: {
15
- user_id: user_id, # 개발사에서 관리하는 회원 고유 id
16
- email: email, # 회원 email
17
- name: name, # 회원명
18
- gender: gender, # 0:여자, 1:남자
19
- birth: birth, # 생일 901004
20
- phone: phone # 01012341234
21
- }.compact
22
- )
23
- end
24
- end
25
- end
@@ -1,24 +0,0 @@
1
- module Bootpay::Escrow
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
-
6
-
7
- # @deprecated, 사용되지 않는 api
8
- # Comment by Gosomi
9
- # Date: 2020-06-18
10
- # @return [Hash]
11
- def delivery_start(receipt_id, delivery_no, delivery_corp)
12
- raise 'receipt_id 값을 설정해주세요.' if receipt_id.blank?
13
- request(
14
- mode: :put,
15
- uri: "delivery/start/#{receipt_id}",
16
- payload:
17
- {
18
- delivery_no: delivery_no,
19
- delivery_corp: delivery_corp
20
- }.compact
21
- )
22
- end
23
- end
24
- end
data/lib/bootpay/link.rb DELETED
@@ -1,60 +0,0 @@
1
-
2
- # Comment by ehowlsla
3
- # Date: 2021-08-31
4
- # @return [Hash]
5
- module Bootpay::Link
6
- extend ActiveSupport::Concern
7
-
8
- included do
9
- # item 모델 설명
10
- # {
11
- # item_name: '', # 상품명
12
- # qty: 1, # 수량
13
- # unique: '', # 상품 고유키
14
- # price: 1000, # 상품단가
15
- # cat1: '', # 카테고리 상
16
- # cat2: '', # 카테고리 중
17
- # cat3: '' # 카테고리 하
18
- # }
19
- def request_link(pg: nil, method: nil, methods: nil, price: nil, order_id: nil, params: nil, tax_free: nil, name: nil,
20
- user_info: {
21
- id: nil, # 개발사에서 관리하는 회원 고유 id
22
- username: nil, # 구매자 이름
23
- email: nil, # 구매자 email
24
- phone: nil, # 01012341234
25
- gender: nil, # 0:여자, 1:남자
26
- area: nil, # 서울|인천|대구|광주|부산|울산|경기|강원|충청북도|충북|충청남도|충남|전라북도|전북|전라남도|전남|경상북도|경북|경상남도|경남|제주|세종|대전 중 택 1
27
- birth: nil # 생일 901004
28
- },
29
- items: nil, # item array
30
- extra: {
31
- escrow: nil, # 에스크로 연동 시 true, 기본값 false
32
- quota: nil, #List<int> 형태, 결제금액이 5만원 이상시 할부개월 허용범위를 설정할 수 있음, ex) "0,2,3" 지정시 - [0(일시불), 2개월, 3개월] 허용, 미설정시 PG사별 기본값 적용, 1 지정시 에러가 발생할 수 있음
33
- disp_cash_result: nil, # 현금영수증 노출할지 말지 (가상계좌 이용시)
34
- offer_period: nil, # 통합결제창, PG 정기결제창에서 표시되는 '월 자동결제'에 해당하는 문구를 지정한 값으로 변경, 지원하는 PG사만 적용 가능
35
- theme: nil, # 통합결제창 테마, [ red, purple(기본), custom ] 중 택 1
36
- custom_background: nil, # 통합결제창 배경색, ex) "#00a086" theme가 custom 일 때 background 색상 지정 가능
37
- custom_font_color: nil # 통합결제창 글자색, ex) "#ffffff" theme가 custom 일 때 font color 색상 지정 가능
38
- }
39
- )
40
- request(
41
- uri: 'request/payment',
42
- payload:
43
- {
44
- pg: pg, # [PG 결제] 사용하고자 하는 PG사의 Alias를 입력. ex) danal, kcp, inicis등, 미 지정시 통합결제창이 오픈
45
- method: method, # card:카드, phone: 휴대폰, bank: 실시간 계좌이체, vbank: 가상계좌, auth: 본인인증, card_rebill: 정기결제, easy: 카카오,페이코,네이버페이 등의 간편결제, 미지정시 통합결제창 오픈
46
- methods: methods, # 통합결제시 사용할 method 배열 형태
47
- price: price, # 결제금액
48
- order_id: order_id, # 개발사에서 관리하는 고유결제번호
49
- params: params, # string 형태로 전달 할 값, 결제 후 똑같이 리턴해드림
50
- tax_free: tax_free, # 비과세 금액
51
- name: name, # 결제할 상품명
52
- user_info: user_info, # 구매자 정보
53
- items: items, # 상품정보
54
- # return_url: return_url, # 결제후 이동할 페이지 url, 아직 사용하지 않음
55
- extra: extra.values.any? {|v|v != nil} ? extra : nil # 기타 옵션
56
- }.compact
57
- )
58
- end
59
- end
60
- end
@@ -1,17 +0,0 @@
1
-
2
- # bootpay dev api
3
- # Comment by Gosomi
4
- # Date: 2020-06-18
5
- # @return [Hash]
6
- module Bootpay::Naverpay
7
- extend ActiveSupport::Concern
8
-
9
- included do
10
- def naverpay_item_response(data)
11
- request(
12
- uri: 'npay/product',
13
- payload: data
14
- )
15
- end
16
- end
17
- end
@@ -1,31 +0,0 @@
1
- # bootpay dev api
2
- # Comment by Gosomi
3
- # Date: 2020-06-18
4
- # @return [Hash]
5
- module Bootpay::PaymentResource
6
- extend ActiveSupport::Concern
7
-
8
- included do
9
- def update_pg_resource(data)
10
- request(
11
- uri: 'project/payment',
12
- payload: data
13
- )
14
- end
15
-
16
- #----------------------------------------------------------
17
- # 새로운 웹훅을 실행한다
18
- # Comment by Gosomi
19
- # Date: 2021-12-21
20
- #----------------------------------------------------------
21
- def create_webhook(receipt_id:, webhook_url:)
22
- request(
23
- uri: 'webhook',
24
- payload: {
25
- receipt_id: receipt_id,
26
- webhook_url: webhook_url
27
- }
28
- )
29
- end
30
- end
31
- end
@@ -1,12 +0,0 @@
1
-
2
- # bootpay dev api
3
- # Comment by Gosomi
4
- # Date: 2020-06-18
5
- # @return [Hash]
6
- module Bootpay::Reseller
7
- extend ActiveSupport::Concern
8
-
9
- included do
10
-
11
- end
12
- end
data/lib/bootpay/rest.rb DELETED
@@ -1,38 +0,0 @@
1
- module Bootpay::Rest
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- private
6
-
7
- # HTTP Request 기본 Method
8
- # Comment by Gosomi
9
- # Date: 2021-05-21
10
- def request(method: :post, uri:, payload: {}, headers: {})
11
-
12
- print([Bootpay::Api::API[@mode.to_sym], uri].join('/'))
13
-
14
- response = HTTP.headers(
15
- {
16
- # Authorization: "Bearer #{@token}",
17
- Authorization: "#{@token}",
18
- content_type: 'application/json',
19
- accept: 'application/json'
20
- }.merge!(headers).compact
21
- ).send(
22
- method.to_sym,
23
- [Bootpay::Api::API[@mode.to_sym], uri].join('/'),
24
- json: payload
25
- )
26
- Bootpay::Response.new(
27
- response.status.success?,
28
- JSON.parse(response.body.to_s, symbolize_names: true)
29
- )
30
- rescue Exception => e
31
- Bootpay::Response.new(
32
- false,
33
- message: "부트페이 API 서버와의 통신이 실패하였습니다. 오류 메세지: #{e.message}",
34
- backtrace: e.backtrace.join("\n")
35
- )
36
- end
37
- end
38
- end
@@ -1,20 +0,0 @@
1
-
2
- # Comment by ehowlsla
3
- # Date: 2021-08-31
4
- # @return [Hash]
5
- module Bootpay::Submit
6
- extend ActiveSupport::Concern
7
-
8
- included do
9
- def server_submit(receipt_id)
10
- raise 'receipt_id 값을 입력해주세요.' if receipt_id.blank?
11
-
12
- request(
13
- uri: 'submit',
14
- payload: {
15
- receipt_id: receipt_id
16
- }
17
- )
18
- end
19
- end
20
- end
data/lib/bootpay/token.rb DELETED
@@ -1,20 +0,0 @@
1
- module Bootpay::Token
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- # Access Token을 요청한다
6
- # Comment by Gosomi
7
- # Date: 2021-05-21
8
- def request_access_token
9
- response = request(
10
- uri: 'request/token',
11
- payload: {
12
- application_id: @application_id,
13
- private_key: @private_key
14
- }
15
- )
16
- @token = response.data[:data][:token] if response.success?
17
- response
18
- end
19
- end
20
- end
@@ -1,55 +0,0 @@
1
- module Bootpay::Verification
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
-
6
- # 결제 검증하기
7
- # Comment by ehowlsla
8
- # Date: 2021-08-31
9
- def verify(receipt_id)
10
- raise 'receipt_id 값을 입력해주세요' if receipt_id.nil?
11
- request(
12
- method: :get,
13
- uri: "receipt/#{receipt_id}"
14
- )
15
- end
16
-
17
- # bootpay dev api
18
- # Comment by ehowlsla
19
- # Date: 2021-08-31
20
- def subscribe_verify(receipt_id)
21
- raise 'receipt_id 값을 입력해주세요' if receipt_id.nil?
22
- request(
23
- method: :get,
24
- uri: "subscribe/billing/#{receipt_id}"
25
- )
26
- end
27
-
28
- # 서버 승인하기
29
- # Comment by ehowlsla
30
- # Date: 2021-08-31
31
- def confirm(receipt_id)
32
- raise 'receipt_id 값을 입력해주세요' if receipt_id.nil?
33
- request(
34
- uri: "submit",
35
- payload: {
36
- receipt_id: receipt_id
37
- }.compact
38
- )
39
- end
40
-
41
- # 본인인증 검증하기
42
- # Comment by ehowlsla
43
- # Date: 2021-08-31
44
- def certificate(receipt_id)
45
- raise 'receipt_id 값을 입력해주세요' if receipt_id.nil?
46
- request(
47
- method: :get,
48
- uri: "certificate/#{receipt_id}",
49
- payload: {
50
- receipt_id: receipt_id
51
- }.compact
52
- )
53
- end
54
- end
55
- end