2626import android .webkit .CookieManager ;
2727import android .webkit .ValueCallback ;
2828import android .webkit .WebChromeClient ;
29+ import android .webkit .WebSettings ;
2930import android .webkit .WebView ;
3031import android .webkit .WebViewClient ;
3132import android .widget .LinearLayout ;
@@ -86,6 +87,8 @@ public class MOLPayActivity extends AppCompatActivity {
8687 public final static String mp_non_3DS = "mp_non_3DS" ;
8788 public final static String mp_card_list_disabled = "mp_card_list_disabled" ;
8889 public final static String mp_disabled_channels = "mp_disabled_channels" ;
90+ public final static String mp_dpa_id = "mp_dpa_id" ;
91+ public final static String mp_company = "mp_company" ;
8992
9093 public final static String MOLPAY = "MOLPAY" ;
9194 private final static String mpopenmolpaywindow = "mpopenmolpaywindow://" ;
@@ -95,7 +98,7 @@ public class MOLPayActivity extends AppCompatActivity {
9598 private final static String mppinstructioncapture = "mppinstructioncapture://" ;
9699 private final static String module_id = "module_id" ;
97100 private final static String wrapper_version = "wrapper_version" ;
98- private final static String wrapperVersion = "6 " ;
101+ private final static String wrapperVersion = "0 " ;
99102
100103 private String base64Img ;
101104 private String filename ;
@@ -179,11 +182,19 @@ protected void onCreate(Bundle savedInstanceState) {
179182 mpMOLPayUI .setVisibility (View .GONE );
180183
181184 // Load the main ui
185+ mpMainUI .getSettings ().setCacheMode (WebSettings .LOAD_CACHE_ELSE_NETWORK );
182186 mpMainUI .getSettings ().setAllowUniversalAccessFromFileURLs (true );
183187 mpMainUI .setWebViewClient (new MPMainUIWebClient ());
188+ CookieManager cookieManager = CookieManager .getInstance ();
189+ cookieManager .setAcceptCookie (true );
190+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ){
191+ cookieManager .setAcceptThirdPartyCookies (mpMainUI , true );
192+ cookieManager .setAcceptThirdPartyCookies (mpMOLPayUI , true );
193+ }
184194 mpMainUI .loadUrl ("file:///android_asset/molpay-mobile-xdk-www/index.html" );
185195
186196 // Configure MOLPay ui
197+ mpMOLPayUI .getSettings ().setCacheMode (WebSettings .LOAD_CACHE_ELSE_NETWORK );
187198 mpMOLPayUI .getSettings ().setAllowUniversalAccessFromFileURLs (true );
188199 mpMOLPayUI .getSettings ().setJavaScriptCanOpenWindowsAutomatically (true );
189200 mpMOLPayUI .getSettings ().setSupportMultipleWindows (true );
@@ -368,6 +379,7 @@ public boolean onCreateWindow(WebView view, boolean dialog, boolean userGesture,
368379 mpBankUI = new WebView (MOLPayActivity .this );
369380
370381 mpBankUI .getSettings ().setJavaScriptEnabled (true );
382+ mpBankUI .getSettings ().setCacheMode (WebSettings .LOAD_CACHE_ELSE_NETWORK );
371383 mpBankUI .getSettings ().setAllowUniversalAccessFromFileURLs (true );
372384 mpBankUI .getSettings ().setJavaScriptCanOpenWindowsAutomatically (true );
373385 mpBankUI .getSettings ().setSupportMultipleWindows (true );
0 commit comments