@@ -57,6 +57,7 @@ public class BootpayBuilder {
5757 private CancelListener cancel ;
5858 private ConfirmListener confirm ;
5959 private BootpayDialog dialog ;
60+ private BootpayDialogX dialogX ;
6061// private BootpayBioDialog bioDialog;
6162 private ApiPresenter presenter ;
6263// boolean isBioIntent = false;
@@ -425,7 +426,7 @@ private void validCheck() {
425426 if (ux == null || ux == UX .NONE ) { request .setUX (UX .PG_DIALOG ); }
426427 ux = request .getUX ();
427428 if (ux == UX .PG_DIALOG ) {
428- if (fm == null || fm .isDestroyed ()) { error ("fragment 값은 null 이 될 수 없습니다." ); }
429+ if (( fm == null || fm .isDestroyed ()) && ( fmx == null || fmx . isDestroyed () )) { error ("fragment 값은 null 이 될 수 없습니다." ); }
429430
430431 } else if (ux == UX .APP2APP_CARD_SIMPLE
431432 || ux == UX .APP2APP_NFC
@@ -530,38 +531,43 @@ private void requestBioActivity() {
530531
531532
532533 private void requestDialog () {
533- dialog = new BootpayDialog ().setRequest (request )
534- .setOnResponseListener (listener != null ? listener : new EventListener () {
535- @ Override
536- public void onClose (String data ) {
537- if (close != null ) close .onClose (data );
538- }
539-
540- @ Override
541- public void onReady (String data ) {
542- if (ready != null ) ready .onReady (data );
543- }
544-
545- @ Override
546- public void onError (String data ) {
547- if (error != null ) error .onError (data );
548- }
549-
550- @ Override
551- public void onCancel (String data ) {
552- if (cancel != null ) cancel .onCancel (data );
553- }
554-
555- @ Override
556- public void onConfirm (String data ) {
557- if (confirm != null ) confirm .onConfirm (data );
558- }
534+ if (this .fm != null ) { requestDialogCall (); }
535+ else if (this .fmx != null ) { requestDialogXCall (); }
536+ }
559537
560- @ Override
561- public void onDone (String data ) {
562- if (done != null ) done .onDone (data );
563- }
564- });
538+ private void requestDialogCall () {
539+ dialog = new BootpayDialog ().setRequest (request )
540+ .setOnResponseListener (listener != null ? listener : new EventListener () {
541+ @ Override
542+ public void onClose (String data ) {
543+ if (close != null ) close .onClose (data );
544+ }
545+
546+ @ Override
547+ public void onReady (String data ) {
548+ if (ready != null ) ready .onReady (data );
549+ }
550+
551+ @ Override
552+ public void onError (String data ) {
553+ if (error != null ) error .onError (data );
554+ }
555+
556+ @ Override
557+ public void onCancel (String data ) {
558+ if (cancel != null ) cancel .onCancel (data );
559+ }
560+
561+ @ Override
562+ public void onConfirm (String data ) {
563+ if (confirm != null ) confirm .onConfirm (data );
564+ }
565+
566+ @ Override
567+ public void onDone (String data ) {
568+ if (done != null ) done .onDone (data );
569+ }
570+ });
565571
566572 dialog .onCancel (new DialogInterface () {
567573 @ Override
@@ -583,8 +589,68 @@ public void dismiss() {
583589 }
584590 });
585591
586- if (dialog != null ) dialog .show (fm , "bootpay" );
587- // System.currentTimeMillis()
592+ if (dialog != null ) {
593+ dialog .show (fm , "bootpay" );
594+ }
595+ }
596+
597+ private void requestDialogXCall () {
598+ dialogX = new BootpayDialogX ().setRequest (request )
599+ .setOnResponseListener (listener != null ? listener : new EventListener () {
600+ @ Override
601+ public void onClose (String data ) {
602+ if (close != null ) close .onClose (data );
603+ }
604+
605+ @ Override
606+ public void onReady (String data ) {
607+ if (ready != null ) ready .onReady (data );
608+ }
609+
610+ @ Override
611+ public void onError (String data ) {
612+ if (error != null ) error .onError (data );
613+ }
614+
615+ @ Override
616+ public void onCancel (String data ) {
617+ if (cancel != null ) cancel .onCancel (data );
618+ }
619+
620+ @ Override
621+ public void onConfirm (String data ) {
622+ if (confirm != null ) confirm .onConfirm (data );
623+ }
624+
625+ @ Override
626+ public void onDone (String data ) {
627+ if (done != null ) done .onDone (data );
628+ }
629+ });
630+
631+ dialogX .onCancel (new DialogInterface () {
632+ @ Override
633+ public void cancel () {
634+ if (dialogX != null && dialogX .bootpay != null )
635+ dialogX .bootpay .destroy ();
636+ dialogX = null ;
637+ UserInfo .getInstance (context ).finish ();
638+ Bootpay .finish ();
639+ }
640+
641+ @ Override
642+ public void dismiss () {
643+ if (dialogX != null && dialogX .bootpay != null )
644+ dialogX .bootpay .destroy ();
645+ dialogX = null ;
646+ UserInfo .getInstance (context ).finish ();
647+ Bootpay .finish ();
648+ }
649+ });
650+
651+ if (dialogX != null ) {
652+ dialogX .show (fmx , "bootpay" );
653+ }
588654 }
589655
590656 private void requestApi () {
@@ -602,6 +668,9 @@ public void transactionConfirm(String data) {
602668 if (dialog != null )
603669 dialog .transactionConfirm (data );
604670
671+ if (dialogX != null )
672+ dialogX .transactionConfirm (data );
673+
605674 if (CurrentBioRequest .getInstance ().activity != null )
606675 CurrentBioRequest .getInstance ().activity .transactionConfirm (data );
607676
@@ -617,11 +686,16 @@ public void transactionConfirm(String data) {
617686 public void removePaymentWindow () {
618687 if (dialog != null )
619688 dialog .removePaymentWindow ();
689+
690+ if (dialogX != null )
691+ dialogX .removePaymentWindow ();
620692 }
621693
622694 public void dismiss () {
623695 if (dialog != null ) dialog .dismiss ();
624696
697+ if (dialogX != null ) dialogX .dismiss ();
698+
625699 if (CurrentBioRequest .getInstance ().activity != null )
626700 CurrentBioRequest .getInstance ().activity .activityFinish ();
627701
@@ -642,6 +716,4 @@ private boolean isEmpty(String value) {
642716 private void error (String message ) {
643717 throw new RuntimeException (message );
644718 }
645-
646-
647719}
0 commit comments