Skip to content

Commit 276230a

Browse files
committed
bootpay 3.3.0 update
1 parent b878e45 commit 276230a

File tree

3 files changed

+75
-29
lines changed

3 files changed

+75
-29
lines changed

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

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import kr.co.bootpay.pref.UserInfo;
3737

3838
public class BootpayWebView extends WebView {
39-
private static final String BOOTPAY = "https://inapp.bootpay.co.kr/3.2.6/production.html";
39+
private static final String BOOTPAY = "https://inapp.bootpay.co.kr/3.3.0/production.html";
4040

4141
private Dialog dialog;
4242
// private ConnectivityManager connManager;
@@ -98,6 +98,35 @@ public BootpayWebView(Context context, AttributeSet attrs) {
9898
this(context, attrs, 0);
9999
}
100100

101+
private void goBootpayRequest() {
102+
loadParams(
103+
request(
104+
price(),
105+
easyPayUserToken(),
106+
applicationId(),
107+
name(),
108+
pg(),
109+
// userPhone(),
110+
agree(),
111+
method(),
112+
methods(),
113+
items(),
114+
params(),
115+
accountExpireAt(),
116+
orderId(),
117+
useOrderId(),
118+
userJson(),
119+
extraJson()
120+
),
121+
error(),
122+
cancel(),
123+
ready(),
124+
confirm(),
125+
close(),
126+
done()
127+
);
128+
}
129+
101130
public BootpayWebView(Context context, AttributeSet attrs, int defStyleAttr) {
102131
super(context, attrs, defStyleAttr);
103132

@@ -124,35 +153,18 @@ public void onPageFinished(WebView view, String url) {
124153

125154
// setDevelopMode();
126155
// useOneStoreApi();
156+
// if(extraJson())
127157

128-
// Log.d("bootpay", "onPageFinished");
158+
if(request.getBoot_extra().getQuick_popup() == 1) {
159+
setQuickPopup();
160+
goBootpayRequest();
129161

130-
loadParams(
131-
request(
132-
price(),
133-
easyPayUserToken(),
134-
applicationId(),
135-
name(),
136-
pg(),
137-
// userPhone(),
138-
agree(),
139-
method(),
140-
methods(),
141-
items(),
142-
params(),
143-
accountExpireAt(),
144-
orderId(),
145-
useOrderId(),
146-
userJson(),
147-
extraJson()
148-
),
149-
error(),
150-
cancel(),
151-
ready(),
152-
confirm(),
153-
close(),
154-
done()
155-
);
162+
} else {
163+
goBootpayRequest();
164+
}
165+
// request.getBoot_extra().
166+
167+
// goBootpayRequest();
156168
}
157169
}
158170

@@ -316,6 +328,10 @@ private void setDevelopMode() {
316328
load("window.BootPay.setMode('development');");
317329
}
318330

331+
private void setQuickPopup() {
332+
load("window.BootPay.startQuickPopup();");
333+
}
334+
319335

320336
// private void useOneStoreApi() {
321337
// if(request != null && "onestore".equals(request.getPG())) {

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public final class BootExtra {
2323

2424
private BootpayOneStore onestore;
2525
private int escrow = 0; // 에스크로 쓸지 안쓸지
26+
private int popup = -1; //1이면 popup, 아니면 iframe 연동
27+
private int quick_popup = -1; //1: popup 호출시 버튼을 띄우지 않는다. 아닐 경우 버튼을 호출한다
2628

2729

2830
public final String getApp_scheme() {
@@ -151,6 +153,14 @@ private String escrow() {
151153
return String.format(Locale.KOREA, "escrow: %d", this.escrow);
152154
}
153155

156+
private String popup() {
157+
return String.format(Locale.KOREA, "popup: %d", this.popup);
158+
}
159+
160+
private String quick_popup() {
161+
return String.format(Locale.KOREA, "quick_popup: %d", this.quick_popup);
162+
}
163+
154164
private String oneStore() {
155165
if(this.onestore == null) return "";
156166
return String.format(Locale.KOREA, "onestore: %s", this.onestore.toJson());
@@ -165,6 +175,8 @@ public final String toJson() {
165175
vbankResult(),
166176
quotas(),
167177
ux(),
178+
popup(),
179+
quick_popup(),
168180
appScheme(),
169181
dispCashResult(),
170182
escrow(),
@@ -200,4 +212,22 @@ public BootpayOneStore getOnestore() {
200212
public void setOnestore(BootpayOneStore onestore) {
201213
this.onestore = onestore;
202214
}
215+
216+
public int getPopup() {
217+
return popup;
218+
}
219+
220+
public final BootExtra setPopup(int popup) {
221+
this.popup = popup;
222+
return this;
223+
}
224+
225+
public int getQuick_popup() {
226+
return quick_popup;
227+
}
228+
229+
public final BootExtra setQuick_popup(int quick_popup) {
230+
this.quick_popup = quick_popup;
231+
return this;
232+
}
203233
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void goPGPay() {
8080
.setContext(this)
8181
.setApplicationId(application_id) // 해당 프로젝트(안드로이드)의 application id 값
8282
.setPG(PG.DANAL) // 결제할 PG 사
83-
.setMethod(Method.PHONE)
83+
.setMethod(Method.CARD)
8484
// .setEasyPayUserToken("wef")
8585
// .setMethodList(Arrays.asList(Method.EASY_CARD, Method.PHONE, Method.BANK, Method.CARD, Method.VBANK))
8686
.setBootExtra(bootExtra)

0 commit comments

Comments
 (0)