Skip to content

Commit 228b9aa

Browse files
author
ehowlsla
committed
할부 옵션 업데이트
1 parent e143755 commit 228b9aa

File tree

6 files changed

+53
-14
lines changed

6 files changed

+53
-14
lines changed

bootpay/src/main/java/kr/co/bootpay/BootpayDialog.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,21 @@ public Builder setOrderId(String orderId) {
179179
return this;
180180
}
181181

182+
public Builder setExpireMonth(int expireMonth) {
183+
result.setExtraExpireMonth(expireMonth);
184+
return this;
185+
}
186+
187+
public Builder setVBankResult(int vbankResult) {
188+
result.setExtraVbankResult(vbankResult);
189+
return this;
190+
}
191+
192+
public Builder setQuotas(int[] quotas) {
193+
result.setExtraQuotas(quotas);
194+
return this;
195+
}
196+
182197
public Builder setMethod(String method) {
183198
result.setMethod(method);
184199
return this;

bootpay/src/main/java/kr/co/bootpay/BootpayWebView.kt

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ import android.util.AttributeSet
1717
import android.view.KeyEvent
1818
import android.view.View
1919
import android.webkit.*
20+
import android.widget.Toast
2021
import kr.co.bootpay.model.Request
2122
import kr.co.bootpay.pref.UserInfo
2223
import java.net.URISyntaxException
2324

2425
internal class BootpayWebView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0): WebView(context, attrs, defStyleAttr) {
2526

2627
companion object {
27-
private const val BOOTPAY = "https://inapp.bootpay.co.kr/2.0.8/production.html"
28+
private const val BOOTPAY = "https://inapp.bootpay.co.kr/2.0.9/production.html"
2829

2930
private const val CLOSE = -3
3031

@@ -100,6 +101,11 @@ internal class BootpayWebView @JvmOverloads constructor(context: Context, attrs:
100101
userAddr(),
101102
userPhone()
102103
),
104+
extra(
105+
extraExpireMonth(),
106+
extraVBankResult(),
107+
extraQuota()
108+
),
103109
params(),
104110
order_id()
105111
),
@@ -193,17 +199,22 @@ internal class BootpayWebView @JvmOverloads constructor(context: Context, attrs:
193199

194200
private fun userInfo(vararg info: String) = "user_info: {${info.filter(String::isNotEmpty).joinToString()}}"
195201

196-
private fun userName() = request?.userName?.takeIf(String::isNotEmpty)?.let { "username: '$it'" }
197-
?: ""
202+
private fun extra(vararg etcs: String) = "extra: {${etcs.filter(String::isNotEmpty).joinToString()}}"
203+
204+
private fun userName() = request?.userName?.takeIf(String::isNotEmpty)?.let { "username: '$it'" } ?: ""
205+
206+
private fun userEmail() = request?.userEmail?.takeIf(String::isNotEmpty)?.let { "email: '$it'" } ?: ""
207+
208+
private fun userAddr() = request?.userAddr?.takeIf(String::isNotEmpty)?.let { "addr: '$it'" } ?: ""
198209

199-
private fun userEmail() = request?.userEmail?.takeIf(String::isNotEmpty)?.let { "email: '$it'" }
200-
?: ""
210+
private fun userPhone() = request?.userPhone?.takeIf(String::isNotEmpty)?.let { "phone: '$it'" } ?: ""
201211

202-
private fun userAddr() = request?.userAddr?.takeIf(String::isNotEmpty)?.let { "addr: '$it'" }
203-
?: ""
212+
private fun extraExpireMonth() = request?.extraExpireMonth?.let { "expire_month: $it" } ?: ""
213+
214+
private fun extraVBankResult() = request?.extraVbankResult?.let { "vbank_result: $it" } ?: ""
215+
216+
private fun extraQuota() = request?.extraQuotas?.let { "quota: '${it.joinToString()}'" } ?: ""
204217

205-
private fun userPhone() = request?.userPhone?.takeIf(String::isNotEmpty)?.let { "phone: '$it'" }
206-
?: ""
207218

208219
private fun error() = ".error(function(data){Android.error(JSON.stringify(data));})"
209220

@@ -253,6 +264,8 @@ internal class BootpayWebView @JvmOverloads constructor(context: Context, attrs:
253264
request?.items?.map { "{item_name:'${it.name}',qty:${it.qty},unique:'${it.unique}',price:${it.price},cat1:'${it.cat1}',cat2:'${it.cat2}',cat3:'${it.cat3}'}" }
254265
}"
255266

267+
// private fun quotas() = ""
268+
256269
private fun order_id() = request?.order_id?.let { "order_id:'$it'" } ?: ""
257270

258271
fun setData(request: Request?): BootpayWebView {

bootpay/src/main/java/kr/co/bootpay/analytics/BootpayAnalyticsPresenter.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ internal class BootpayAnalyticsPresenter(context: Context) {
1717
private val rest: RestService by lazy { RestService(context) }
1818
private val executor: Scheduler by lazy { Schedulers.from(Executors.newCachedThreadPool()) }
1919

20+
private val ver = "2.0.9"
21+
2022
fun login(
2123
id: String?,
2224
email: String?,
@@ -27,7 +29,7 @@ internal class BootpayAnalyticsPresenter(context: Context) {
2729
area: String?) {
2830

2931
val login = StatLogin(
30-
"2.0.8",
32+
ver,
3133
UserInfo.bootpay_application_id,
3234
id ?: "",
3335
email ?: "",
@@ -54,7 +56,7 @@ internal class BootpayAnalyticsPresenter(context: Context) {
5456
fun call(url: String, page_type: String, items: MutableList<StatItem>) {
5557

5658
val call = StatCall(
57-
"2.0.8",
59+
ver,
5860
UserInfo.bootpay_application_id,
5961
UserInfo.bootpay_uuid,
6062
url,

bootpay/src/main/java/kr/co/bootpay/model/Request.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class Request {
2424
var userAddr: String? = null
2525
var userPhone: String? = null
2626

27+
var extraExpireMonth: Int? = null
28+
var extraVbankResult: Int? = null
29+
var extraQuotas: IntArray? = null
30+
// intArrayOf(0,2,3,4,5,6,7,8,9,10,11,12)
31+
32+
2733
fun addItem(item: Item): MutableList<Item> {
2834
items.add(item)
2935
return items

sample/sample.iml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
9191
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/build-info" />
9292
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
93+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-libraries" />
9394
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
9495
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkDebugClasspath" />
9596
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
@@ -101,7 +102,9 @@
101102
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
102103
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
103104
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
105+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_app_info_output_file" />
104106
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
107+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_split_apk_resources" />
105108
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
106109
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
107110
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />

sample/src/main/java/bootpay/co/kr/samplepayment/MainActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ public void startTrace() {
5858
}
5959

6060
public void onClick_request(View v) {
61-
6261
// 결제호출
6362
Bootpay.init(getFragmentManager())
6463
.setApplicationId("59a7e647396fa64fcad4a8c2") // 해당 프로젝트(안드로이드)의 application id 값
6564
.setPG(PG.DANAL) // 결제할 PG 사
6665
.setUserPhone("010-1234-5678") // 구매자 전화번호
67-
.setMethod(Method.PHONE) // 결제수단
66+
.setMethod(Method.CARD) // 결제수단
6867
.setName("맥북프로임다") // 결제할 상품명
6968
.setOrderId("1234") // 결제 고유번호
70-
.setPrice(1000) // 결제할 금액
69+
.setQuotas(new int[] {0,2,3}) // 일시불, 2개월, 3개월 할부 허용, 할부는 최대 12개월까지 사용됨
70+
.setPrice(50000) // 결제할 금액
7171
.addItem("마우스", 1, "ITEM_CODE_MOUSE", 100) // 주문정보에 담길 상품정보, 통계를 위해 사용
7272
.addItem("키보드", 1, "ITEM_CODE_KEYBOARD", 200, "패션", "여성상의", "블라우스") // 주문정보에 담길 상품정보, 통계를 위해 사용
7373
.onConfirm(new ConfirmListener() { // 결제가 진행되기 바로 직전 호출되는 함수로, 주로 재고처리 등의 로직이 수행

0 commit comments

Comments
 (0)