bootpay 1.0.4 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f93c2b7e68e637cf9ef3e6349179b7635bb513a749c1df031cc34385f8df6252
4
- data.tar.gz: c71a38014a72b0d4dabc92ddf615d8267302722c79c7d202e42f34d273712f75
3
+ metadata.gz: 1db5c75a6a35e6085bb32d154260ceefd3dce35fc02b8419baba46f4a7c9166b
4
+ data.tar.gz: 138c6ffa96ef2cda07a575d35507e1fd98a9e4c767a90619e06a539f5abc0ec8
5
5
  SHA512:
6
- metadata.gz: 1f8e2ecb7afb21f5d44ff93b7348d0706a3a48dbb797891365f67be3030078351bbb2495a431d72c0cf4597e9b730785607567ef56d04c6347719f3a2cd651a2
7
- data.tar.gz: 15ca7fcd004f83855f90155eead0b97251677a0d5bfd58ead94d093e4eb4e1823298762fbffb1dc9e304cad7472f6a7a7e501af4f4afba4d6f0551f1e3182756
6
+ metadata.gz: b01db426e436f99f84a6bc741df6252cb3df6692aaa037ac264409d8574858548898296d591876097f70c29ea8ae5d6feee3b15403a88214c064df7686ab82f7
7
+ data.tar.gz: 0a85381bdf7a0018417803137124025c72a8f59a7dc5014884262f8aae380018e37b58615b2a6bbd06bf123606cd931527eb71a01208c6375a79a5f2d76c7752
data/bootpay-1.0.4.gem ADDED
Binary file
@@ -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만원 이상 결제건에 대한 할부개월 노출 설정. 00-일시불, 01-1개월, 02-2개월 ... 12까지 지정가능, 만약 09로 지정할 경우 최대 9개월까지 선택가능. 지정하지 않을 경우 해당 PG사의 기본값 적용
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만원 이상 결제건에 대한 할부개월 노출 설정. 00-일시불, 01-1개월, 02-2개월 ... 12까지 지정가능, 만약 09로 지정할 경우 최대 9개월까지 선택가능. 지정하지 않을 경우 해당 PG사의 기본값 적용
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
@@ -11,13 +11,13 @@ module Bootpay::Cancel
11
11
  uri: 'cancel',
12
12
  payload:
13
13
  {
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
14
+ cancel_id: cancel_id.presence || SecureRandom.uuid, # (선택사항) 부분취소 요청시 중복 요청을 방지하기 위한 고유값
15
+ receipt_id: receipt_id, # 부트페이에서 발급한 영수증 id
16
+ price: cancel_price, # (선택사항) 부분취소 요청시 금액을 지정, 미지정시 전액 취소 (부분취소가 가능한 PG사, 결제수단에 한해 적용됨)
17
+ tax_free: cancel_tax_free, # 취소할 비과세 금액
18
+ name: cancel_username, # 취소 요청자 이름
19
+ reason: cancel_message, # 취소 요청 사유
20
+ refund: refund.values.any? {|v|v != nil} ? refund : nil # (선택사항) 가상계좌 환불요청시, 전제조건으로 PG사와 CMS 특약이 체결되어 있을 경우에만 환불요청 가능, 기본적으로 가상계좌는 결제취소가 안됨
21
21
  }.compact
22
22
  )
23
23
  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
@@ -8,24 +8,33 @@ module Bootpay::Link
8
8
  included do
9
9
  def request_link(pg: nil, method: nil, methods: nil, price: nil, order_id: nil, params: nil, tax_free: nil, name: nil,
10
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 })
11
+ items: nil,
12
+ extra: {
13
+ escrow: nil, # 에스크로 연동 시 true, 기본값 false
14
+ quota: nil, #List<int> 형태, 결제금액이 5만원 이상시 할부개월 허용범위를 설정할 수 있음, ex) "0,2,3" 지정시 - [0(일시불), 2개월, 3개월] 허용, 미설정시 PG사별 기본값 적용
15
+ disp_cash_result: nil, # 현금영수증 노출할지 말지 (가상계좌 이용시)
16
+ offer_period: nil, # 통합결제창, PG 정기결제창에서 표시되는 '월 자동결제'에 해당하는 문구를 지정한 값으로 변경, 지원하는 PG사만 적용 가능
17
+ theme: nil, # 통합결제창 테마, [ red, purple(기본), custom ] 중 택 1
18
+ custom_background: nil, # 통합결제창 배경색, ex) "#00a086" theme가 custom 일 때 background 색상 지정 가능
19
+ custom_font_color: nil # 통합결제창 글자색, ex) "#ffffff" theme가 custom 일 때 font color 색상 지정 가능
20
+ }
21
+ )
13
22
  request(
14
23
  uri: 'request/payment',
15
24
  payload:
16
25
  {
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
26
+ pg: pg, # [PG 결제] 사용하고자 하는 PG사의 Alias를 입력. ex) danal, kcp, inicis등, 미 지정시 통합결제창이 오픈
27
+ method: method, # card:카드, phone: 휴대폰, bank: 실시간 계좌이체, vbank: 가상계좌, auth: 본인인증, card_rebill: 정기결제, easy: 카카오,페이코,네이버페이 등의 간편결제, 미지정시 통합결제창 오픈
28
+ methods: methods, # 통합결제시 사용할 method 배열 형태
29
+ price: price, # 결제금액
30
+ order_id: order_id, # 개발사에서 관리하는 고유결제번호
31
+ params: params, # string 형태로 전달 할 값, 결제 후 똑같이 리턴해드림
32
+ tax_free: tax_free, # 비과세 금액
33
+ name: name, # 결제할 상품명
34
+ user_info: user_info, # 구매자 정보
35
+ items: items, # 상품정보
36
+ # return_url: return_url, # 결제후 이동할 페이지 url, 아직 사용하지 않음
37
+ extra: extra.values.any? {|v|v != nil} ? extra : nil # 기타 옵션
29
38
  }.compact
30
39
  )
31
40
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootpay
4
- VERSION = "1.0.4"
4
+ VERSION = "1.0.5"
5
5
  BANKCODE = {
6
6
  "한국은행" => "001",
7
7
  "기업은행" => "003",
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.4
4
+ version: 1.0.5
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-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -60,6 +60,7 @@ files:
60
60
  - bootpay-1.0.1.gem
61
61
  - bootpay-1.0.2.gem
62
62
  - bootpay-1.0.3.gem
63
+ - bootpay-1.0.4.gem
63
64
  - bootpay.gemspec
64
65
  - lib/.DS_Store
65
66
  - lib/bootpay.rb