bootpay 1.0.3 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7be9922ed3bc9c96baa0bd0fa2c4bc3808de03a1d1f60fbc80607a8bd8af6e9b
4
- data.tar.gz: 8a30c213d19ebe55820aec6b9f1db984771dbad02d61fa8e8bc59af137b53fb1
3
+ metadata.gz: 67247bbea9fec88697e3e4ee68dc1798e0b0c3e3b8aa55099e3ea029b3b389a5
4
+ data.tar.gz: c376cf2c3dc1b85317b76e3f1f3b0c4d5fde2627458ebd724160f3649b8d1eb8
5
5
  SHA512:
6
- metadata.gz: 9f5678fc5ac4854ea067a15d02770551584032f98ec96997564a46954804b9aad08c4f7f74ed36cc270a4ea86c598ea571820cc7c14126eb869adcfd4c0c1cd0
7
- data.tar.gz: 3b14fec83f8f6979d5425919a5dc98f2157d925bb6c16639e8b715bdc3576be2e1f8d607a48b4ccf4097dab1097fdfe5da736f56e81c51a3b59af13af4a2bb9e
6
+ metadata.gz: f6eddf1d558f4e185538788703a5609bda99b36a9426e6ecb673a261a7eece95dadc6d9f420204583bdf68d6db1a85ff7df987a4d9eef58e5dacb64f54a2de41
7
+ data.tar.gz: 847f3b3631e76549006b851c5f9a0dbf7e51acc9b5130442293fb1ba4626ca37493c6f5e5b6fb8b6b55a8dfadbf77048fb49b2391eab825f530b6a0c84eb88b3
data/.gitignore CHANGED
@@ -13,3 +13,4 @@
13
13
  *.idea
14
14
  *.iml
15
15
  Gemfile.lock
16
+ *.gem
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
- ## [Unreleased]
1
+ ### 1.0.6
2
+ - request_link api 에 주석 추가
2
3
 
3
- ## [0.1.0] - 2021-08-30
4
+ ### 1.0.5
5
+ - model별 주석 추가, extra에 불필요한 파라미터 제거
4
6
 
5
- - Initial release
7
+ ### 1.0.4
8
+
9
+ - cancel에 refund 형식 수정
10
+
11
+ ### 1.0.3
12
+
13
+ - BankCode 추가
14
+
15
+ ### 1.0.2
16
+ - certificate data type application/json 으로 수정
17
+
18
+ ### 1.0.1
19
+ - namespace 변경
20
+
21
+ ### 1.0.0
22
+
23
+ - 첫 배포
@@ -6,21 +6,32 @@ module Bootpay::Billing
6
6
  # Comment by ehowlsla
7
7
  # Date: 2021-08-30
8
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: {id: nil, username: nil, email: nil, phone: nil, gender: nil, area: nil, birth: nil},
10
- extra: {subscribeTestPayment: nil, raw_data: 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
+ })
11
22
  request(
12
23
  uri: 'request/card_rebill',
13
24
  payload:
14
25
  {
15
- order_id: order_id,
16
- pg: pg,
17
- item_name: item_name,
18
- card_no: card_no,
19
- card_pw: card_pw,
20
- expire_year: expire_year,
21
- expire_month: expire_month,
22
- identify_number: identify_number,
23
- user_info: user_info,
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, # 구매자 정보
24
35
  extra: extra.values.any? {|v|v != nil} ? extra : nil
25
36
  }.compact
26
37
  )
@@ -40,9 +51,20 @@ module Bootpay::Billing
40
51
  # Comment by ehowlsla
41
52
  # Date: 2021-08-30
42
53
  def subscribe_billing(billing_key: nil, item_name: nil, price: 0, tax_free: 0, order_id: nil, quota: nil, interest: nil,
43
- user_info: {id: nil, username: nil, email: nil, phone: nil, gender: nil, area: nil, birth: 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
+ },
44
63
  feedback_url: nil, feedback_content_type: nil,
45
- extra: {subscribeTestPayment: nil, raw_data: nil})
64
+ extra: { # 기타 설정
65
+ subscribe_test_payment: nil, # subscribe_test_payment:100원 결제 후 결제가 되면 billing key를 발행, 결제가 실패하면 에러
66
+ raw_data: nil # raw_data: PG 오류 코드 및 메세지까지 리턴
67
+ })
46
68
  raise 'billing_key 값을 입력해주세요.' if billing_key.blank?
47
69
  raise 'item_name 값을 입력해주세요.' if item_name.blank?
48
70
  raise 'price 금액을 설정을 해주세요.' if price.blank?
@@ -50,17 +72,17 @@ module Bootpay::Billing
50
72
  request(
51
73
  uri: 'subscribe/billing',
52
74
  payload: {
53
- billing_key: billing_key,
54
- item_name: item_name,
55
- price: price,
56
- tax_free: tax_free,
57
- order_id: order_id,
58
- quota: quota,
59
- interest: interest,
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, # 웰컴페이먼츠 전용, 무이자여부를 보내는 파라미터가 있다
60
82
  user_info: user_info.values.any? {|v|v != nil} ? user_info : nil,
61
- feedback_url: feedback_url,
62
- feedback_content_type: feedback_content_type,
63
- extra: extra.values.any? {|v|v != nil} ? extra : 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 오류 코드 및 메세지까지 리턴
64
86
  }.compact,
65
87
  )
66
88
  end
@@ -72,7 +94,7 @@ module Bootpay::Billing
72
94
  user_info: {id: nil, username: nil, email: nil, phone: nil, gender: nil, area: nil, birth: nil},
73
95
  feedback_url: nil, feedback_content_type: nil,
74
96
  extra: {subscribeTestPayment: 0, raw_data: 0},
75
- scheduler_type: nil, execute_at: nil)
97
+ execute_at: nil)
76
98
  raise 'billing_key 값을 입력해주세요.' if billing_key.blank?
77
99
  raise 'item_name 값을 입력해주세요.' if item_name.blank?
78
100
  raise 'price 금액을 설정을 해주세요.' if price.blank?
@@ -80,19 +102,19 @@ module Bootpay::Billing
80
102
  request(
81
103
  uri: 'subscribe/billing/reserve',
82
104
  payload: {
83
- billing_key: billing_key,
84
- item_name: item_name,
85
- price: price,
86
- tax_free: tax_free,
87
- order_id: order_id,
88
- quota: quota,
89
- interest: interest,
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, # 웰컴페이먼츠 전용, 무이자여부를 보내는 파라미터가 있다
90
112
  user_info: user_info.values.any? {|v|v != nil} ? user_info : nil,
91
- feedback_url: feedback_url,
92
- feedback_content_type: feedback_content_type,
93
- extra: extra.values.any? {|v|v != nil} ? extra : nil,
94
- scheduler_type: scheduler_type.presence || 'oneshot',
95
- execute_at: execute_at.presence || (Time.now + 10.seconds).to_i
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초뒤 실행
96
118
  }.compact,
97
119
  )
98
120
  end
@@ -6,18 +6,22 @@ module Bootpay::Cancel
6
6
  # Comment by Gosomi
7
7
  # Date: 2021-05-21
8
8
  def cancel_payment(cancel_id: nil, receipt_id:, cancel_price: nil, cancel_tax_free: 0, cancel_username: '시스템', cancel_message: '결제취소',
9
- refund: { bank_account: nil, bank_username: nil, bank_code: nil })
9
+ refund: { # (선택사항) 가상계좌 환불요청시, 전제조건으로 PG사와 CMS 특약이 체결되어 있을 경우에만 환불요청 가능, 기본적으로 가상계좌는 결제취소가 안됨
10
+ account: nil, # 환불받을 계좌번호 - 675601***1234
11
+ accountholder: nil, # 환불받을 계좌주 - 홍길동
12
+ bankcode: nil # 은행 코드
13
+ })
10
14
  request(
11
15
  uri: 'cancel',
12
16
  payload:
13
17
  {
14
- cancel_id: cancel_id.presence || SecureRandom.uuid,
15
- receipt_id: receipt_id,
16
- price: cancel_price,
17
- tax_free: cancel_tax_free,
18
- name: cancel_username,
19
- reason: cancel_message,
20
- refund: refund.values.any? {|v|v != nil} ? refund : nil
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 특약이 체결되어 있을 경우에만 환불요청 가능, 기본적으로 가상계좌는 결제취소가 안됨
21
25
  }.compact
22
26
  )
23
27
  end
data/lib/bootpay/easy.rb CHANGED
@@ -12,12 +12,12 @@ module Bootpay::Easy
12
12
  request(
13
13
  uri: 'request/user/token',
14
14
  payload: {
15
- user_id: user_id,
16
- email: email,
17
- name: name,
18
- gender: gender,
19
- birth: birth,
20
- phone: phone
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
21
  }.compact
22
22
  )
23
23
  end
@@ -3,7 +3,8 @@ module Bootpay::Escrow
3
3
 
4
4
  included do
5
5
 
6
- # bootpay dev api
6
+
7
+ # @deprecated, 사용되지 않는 api
7
8
  # Comment by Gosomi
8
9
  # Date: 2020-06-18
9
10
  # @return [Hash]
data/lib/bootpay/link.rb CHANGED
@@ -6,26 +6,53 @@ module Bootpay::Link
6
6
  extend ActiveSupport::Concern
7
7
 
8
8
  included do
9
+ # item 모델 설명
10
+ # {
11
+ # item_name: '', # 상품명
12
+ # qty: 1, # 수량
13
+ # unique: '', # 상품 고유키
14
+ # price: 1000, # 상품단가
15
+ # cat1: '', # 카테고리 상
16
+ # cat2: '', # 카테고리 중
17
+ # cat3: '' # 카테고리 하
18
+ # }
9
19
  def request_link(pg: nil, method: nil, methods: nil, price: nil, order_id: nil, params: nil, tax_free: nil, name: nil,
10
- user_info: {id: nil, username: nil, email: nil, phone: nil, gender: nil, area: nil, birth: nil},
11
- items: nil, return_url: nil,
12
- extra: {escrow: nil, expire_month: nil, quota: nil, subscribe_test_payment: nil, disp_cash_result: nil, offer_period: nil, seller_name: nil, theme: nil, custom_background: nil, custom_font_color: 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
+ )
13
40
  request(
14
41
  uri: 'request/payment',
15
42
  payload:
16
43
  {
17
- pg: pg,
18
- method: method,
19
- methods: methods,
20
- price: price,
21
- order_id: order_id,
22
- params: params,
23
- tax_free: tax_free,
24
- name: name,
25
- user_info: user_info,
26
- items: items,
27
- return_url: return_url,
28
- extra: extra.values.any? {|v|v != nil} ? extra : nil
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 # 기타 옵션
29
56
  }.compact
30
57
  )
31
58
  end
@@ -1,4 +1,3 @@
1
-
2
1
  # bootpay dev api
3
2
  # Comment by Gosomi
4
3
  # Date: 2020-06-18
@@ -9,9 +8,23 @@ module Bootpay::PaymentResource
9
8
  included do
10
9
  def update_pg_resource(data)
11
10
  request(
12
- uri: 'project/payment',
11
+ uri: 'project/payment',
13
12
  payload: data
14
13
  )
15
14
  end
15
+
16
+ #----------------------------------------------------------
17
+ # 새로운 웹훅을 실행한다
18
+ # Comment by Gosomi
19
+ # Date: 2021-12-21
20
+ #----------------------------------------------------------
21
+ def create_webhook(receipt_id)
22
+ request(
23
+ uri: 'webhook',
24
+ payload: {
25
+ receipt_id: receipt_id
26
+ }
27
+ )
28
+ end
16
29
  end
17
30
  end
@@ -1,25 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootpay
4
- VERSION = "1.0.3"
4
+ VERSION = "1.0.7"
5
5
  BANKCODE = {
6
- "한국은행" => "001",
7
- "기업은행" => "003",
8
- "국민은행" => "004",
9
- "외환은행" => "005",
10
- "수협은행" => "007",
11
- "농협은행" => "011",
12
- "우리은행" => "020",
13
- "SC은행" => "023",
14
- "대구은행" => "031",
15
- "부산은행" => "032",
16
- "광주은행" => "034",
17
- "경남은행" => "039",
18
- "우체국" => "071",
6
+ "한국은행" => "001",
7
+ "기업은행" => "003",
8
+ "국민은행" => "004",
9
+ "외환은행" => "005",
10
+ "수협은행" => "007",
11
+ "농협은행" => "011",
12
+ "우리은행" => "020",
13
+ "SC은행" => "023",
14
+ "대구은행" => "031",
15
+ "부산은행" => "032",
16
+ "광주은행" => "034",
17
+ "경남은행" => "039",
18
+ "우체국" => "071",
19
19
  "KEB하나은행" => "081",
20
- "신한은행" => "088",
21
- "케이뱅크" => "089",
22
- "카카오뱅크" => "090",
20
+ "신한은행" => "088",
21
+ "케이뱅크" => "089",
22
+ "카카오뱅크" => "090",
23
23
  }
24
24
  end
25
25
 
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: 1.0.3
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - bootpay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-08 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -56,9 +56,6 @@ files:
56
56
  - Rakefile
57
57
  - bin/console
58
58
  - bin/setup
59
- - bootpay-1.0.0.gem
60
- - bootpay-1.0.1.gem
61
- - bootpay-1.0.2.gem
62
59
  - bootpay.gemspec
63
60
  - lib/.DS_Store
64
61
  - lib/bootpay.rb
@@ -98,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
95
  - !ruby/object:Gem::Version
99
96
  version: '0'
100
97
  requirements: []
101
- rubygems_version: 3.2.19
98
+ rubygems_version: 3.1.4
102
99
  signing_key:
103
100
  specification_version: 4
104
101
  summary: Bootpay server side plugin for ruby
data/bootpay-1.0.0.gem DELETED
Binary file
data/bootpay-1.0.1.gem DELETED
Binary file
data/bootpay-1.0.2.gem DELETED
Binary file