Skip to content

Commit eae3ec2

Browse files
committed
kcp bankpay bug fixed
1 parent 569a30f commit eae3ec2

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public void onPageFinished(WebView view, String url) {
159159
@Override
160160
public boolean shouldOverrideUrlLoading(WebView view, String url) {
161161
Intent intent = parse(url);
162+
162163
if (isIntent(url)) {
163164
if (isExistInfo(intent, view.getContext()) || isExistPackage(intent, view.getContext()))
164165
return start(intent, view.getContext());
@@ -188,12 +189,11 @@ private Boolean isSpecialCase(String url) {
188189

189190
private Intent parse(String url) {
190191
try {
191-
192192
Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
193193
if(intent.getPackage() == null) {
194194
if (url == null) return intent;
195195
if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
196-
else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay");
196+
else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay.android");
197197
else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
198198
else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
199199
else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
@@ -266,6 +266,12 @@ public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
266266
}
267267

268268
public void transactionConfirm(String data) {
269+
// getContext().runOnUiThread(new Runnable() {
270+
// @Override
271+
// public void run() {
272+
// webview.loadUrl("javascript:(function(){" + str + "})()");
273+
// }
274+
// });
269275
load("var data = JSON.parse('" + data + "'); BootPay.transactionConfirm(data);");
270276
}
271277

@@ -410,7 +416,7 @@ private String userJson() {
410416
private String extraJson() {
411417
if(request.getBoot_extra() == null) return "";
412418
if(request.getBoot_extra().toJson().length() == 0) return "";
413-
return String.format(Locale.KOREA, "bootExtra: %s", request.getBoot_extra().toJson());
419+
return String.format(Locale.KOREA, "extra: %s", request.getBoot_extra().toJson());
414420
}
415421

416422
private String listToString(List<String> array) {

bootpay/src/main/java/kr/co/bootpay/model/BootExtra.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public final class BootExtra {
1616
private String app_scheme_host; //app2app 결제시 return 받을 intent scheme host
1717
private String ux; //다양한 결제시나리오를 지원하기 위한 용도로 사용됨
1818
private String disp_cash_result = "Y"; // 현금영수증 보일지 말지.. 가상계좌 KCP 옵션
19+
private int escrow = 0; // 에스크로 쓸지 안쓸지
1920

2021

2122
public final String getApp_scheme() {
@@ -140,6 +141,10 @@ private String dispCashResult() {
140141
return String.format(Locale.KOREA, "disp_cash_result: '%s'", this.disp_cash_result);
141142
}
142143

144+
private String escrow() {
145+
return String.format(Locale.KOREA, "escrow: %d", this.escrow);
146+
}
147+
143148
public final String toJson() {
144149
return extra(
145150
startAt(),
@@ -149,7 +154,8 @@ public final String toJson() {
149154
quotas(),
150155
ux(),
151156
appScheme(),
152-
dispCashResult()
157+
dispCashResult(),
158+
escrow()
153159
);
154160
}
155161

@@ -165,4 +171,12 @@ public String getDisp_cash_result() {
165171
public void setDisp_cash_result(String disp_cash_result) {
166172
this.disp_cash_result = disp_cash_result;
167173
}
174+
175+
public int getEscrow() {
176+
return escrow;
177+
}
178+
179+
public void setEscrow(int escrow) {
180+
this.escrow = escrow;
181+
}
168182
}

sample/sample.iml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,8 @@
120120
<orderEntry type="library" name="Gradle: android.arch.core:runtime:1.1.0@aar" level="project" />
121121
<orderEntry type="module" module-name="bootpay" />
122122
<orderEntry type="module" module-name="bootpay" />
123+
<orderEntry type="module" module-name="bootpay" />
124+
<orderEntry type="module" module-name="bootpay" />
125+
<orderEntry type="module" module-name="bootpay" />
123126
</component>
124127
</module>

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
public class NativeActivity extends Activity {
2828
private int stuck = 1;
29-
//5b9f51264457636ab9a07cdc
3029
private String application_id = "5b8f6a4d396fa665fdc2b5e8";
3130

3231

@@ -37,11 +36,7 @@ protected void onCreate(Bundle savedInstanceState) {
3736

3837
// 초기설정 - 해당 프로젝트(안드로이드)의 application id 값을 설정합니다. 결제와 통계를 위해 꼭 필요합니다.
3938
BootpayAnalytics.init(this, application_id);
40-
// BootpayAnalytics.init(this, "5b14c0ffb6d49c40cda92c4e");
4139

42-
// Bootpay.useOnestoreApi(this);
43-
44-
// BootpayAnalytics.init(this, "59a7e647396fa64fcad4a8c2");
4540

4641
// 통계 - 유저 로그인 시점에 호출
4742
BootpayAnalytics.login(
@@ -67,15 +62,16 @@ public void startTrace() {
6762
public void onClick_request(View v) {
6863
BootUser bootUser = new BootUser().setPhone("010-1234-5678");
6964
BootExtra bootExtra = new BootExtra().setQuotas(new int[] {0,2,3});
65+
bootExtra.setEscrow(1);
7066

7167
// bootExtra.setEndAt()
7268
// bootExtra.setStartAt()
7369

7470
Bootpay.init(getFragmentManager())
7571
.setContext(this)
7672
.setApplicationId(application_id) // 해당 프로젝트(안드로이드)의 application id 값
77-
.setPG(PG.INICIS) // 결제할 PG 사
78-
.setMethod(Method.BANK)
73+
.setPG(PG.DANAL) // 결제할 PG 사
74+
.setMethod(Method.CARD)
7975
.setBootExtra(bootExtra)
8076
.setBootUser(bootUser)
8177
// .setUserPhone("010-1234-5678") // 구매자 전화번호

0 commit comments

Comments
 (0)