Web View的登录错误 - Mercadopago

时间:2018-06-17 14:10:07

标签: angular nativescript angular2-nativescript mercadopago mercadopagosdk

我试图用Nativescript做一个简单的Mercadopago付费按钮(基本结账)。由于付费按钮是一个HTML代码我已经决定在WebView中做一个简单的测试。当我想用mercadopago帐户付款时问题就开始了,因为我无法登录。我用浏览器尝试相同的过程,我没有问题。

如何解决这个问题?

更确切地说,我做了这个例子。

整个示例是测试用户。请不要使用标准帐户

以下是付费按钮https://ds4fcw2w0otda.cloudfront.net/index_mp.html。如果您使用浏览器打开,则无法登录(请使用测试用户)。

但如果您使用webview Nativescript-Angular组件执行相同的过程,则无法登录。



@Component({
    moduleId: module.id,
    templateUrl: "./mercadopago.component.html",
    styleUrls:["./mercadopago.component.css"]
})

export class MercadopagoComponent{ 
    webview: WebView
    
    public webViewSrc: string = "https://ds4fcw2w0otda.cloudfront.net/index_mp.html";


}

<ActionBar title="MERCADOPAGO" automationText="ActionBar">
  <NavigationButton android.systemIcon="ic_menu_back" (tap)="home()" automationText="GoBack"></NavigationButton>    
</ActionBar>
<GridLayout width="100%" rows="0,auto">
  <WebView row="1" [src]="webViewSrc"></WebView>
</GridLayout>
&#13;
&#13;
&#13;

注意:我怀疑问题可能类似this,但我不知道如何解决我的特定问题

日志

当我使用网页视图加载按钮时

chromium:[INFO:library_loader_hooks.cc(36)]启用了Chromium日志记录:level = 0,默认verbosity = 0 06-18 00:48:42.466 27226 27226我cr_BrowserStartup:初始化chrome进程,singleProcess = false

06-18 00:48:42.673 27226 27226我是艺术:拒绝重新初始化以前失败的类java.lang.Class:java.lang.NoClassDefFoundError:失败的解析:Landroid / webkit / RenderProcessGoneDetail;

06-18 00:48:42.673 27226 27226我是艺术:at void com.android.webview.chromium.WebViewChromium.init(java.util.Map,boolean)(WebViewChromium.java:48)

06-18 00:48:42.673 27226 27226 I art:at java.lang.Object com.tns.Runtime.callJSMethodNative(int,int,java.lang.String,int,boolean,java.lang.Object [ ])(Runtime.java:-2)

06-18 00:48:42.673 27226 27226 I art:at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int,java.lang.String,boolean,long,java.lang.Class,java。 lang.Object [])(Runtime.java:1101)

06-18 00:48:42.673 27226 27226我是艺术:at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:983)

06-18 00:48:42.673 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:970)

06-18 00:48:42.673 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, java.lang.Object [])(Runtime.java:954)

06-18 00:48:42.673 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,java。 lang.Object [])(Runtime.java:946)

06-18 00:48:42.673 27226 27226我是艺术:at void com.android.webview.chromium.WebViewChromium.init(java.util.Map,boolean)(WebViewChromium.java:48)

06-18 00:48:42.673 27226 27226 I art:at java.lang.Object com.tns.Runtime.callJSMethodNative(int,int,java.lang.String,int,boolean,java.lang.Object [ ])(Runtime.java:-2)

06-18 00:48:42.674 27226 27226 I art:at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int,java.lang.String,boolean,long,java.lang.Class,java。 lang.Object [])(Runtime.java:1101)

06-18 00:48:42.674 27226 27226我是艺术:at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:983)

06-18 00:48:42.674 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:970)

06-18 00:48:42.674 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, java.lang.Object [])(Runtime.java:954)

06-18 00:48:42.674 27226 27226 I art:at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,java。 lang.Object [])(Runtime.java:946)

06-18 00:48:42.677 27226 27226我是艺术:拒绝重新初始化以前失败的类java.lang.Class:java.lang.NoClassDefFoundError:解析失败:Landroid / webkit / SafeBrowsingResponse;

06-18 00:48:42.677 27226 27226我是艺术:at void com.android.webview.chromium.WebViewChromium.init(java.util.Map,boolean)(WebViewChromium.java:48)

06-18 00:48:42.677 27226 27226我是艺术:at java.lang.Object com.tns.Runtime.callJSMethodNative(int,int,java.lang.String,int,boolean,java.lang.Object [ ])(Runtime.java:-2)

06-18 00:48:42.677 27226 27226 I art:at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int,java.lang.String,boolean,long,java.lang.Class,java。 lang.Object [])(Runtime.java:1101)

06-18 00:48:42.677 27226 27226 I art:at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:983)

06-18 00:48:42.677 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:970)

06-18 00:48:42.677 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, java.lang.Object [])(Runtime.java:954)

06-18 00:48:42.677 27226 27226 I art:at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,java。 lang.Object [])(Runtime.java:946)

06-18 00:48:42.677 27226 27226我是艺术:at void com.android.webview.chromium.WebViewChromium.init(java.util.Map,boolean)(WebViewChromium.java:48)

06-18 00:48:42.677 27226 27226我是艺术:at java.lang.Object com.tns.Runtime.callJSMethodNative(int,int,java.lang.String,int,boolean,java.lang.Object [ ])(Runtime.java:-2)

06-18 00:48:42.677 27226 27226 I art:at java.lang.Object com.tns.Runtime.dispatchCallJSMethodNative(int,java.lang.String,boolean,long,java.lang.Class,java。 lang.Object [])(Runtime.java:1101)

06-18 00:48:42.677 27226 27226 I art:at java.lang.Object com.tns.Runtime.callJSMethodImpl(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:983)

06-18 00:48:42.677 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, long,java.lang.Object [])(Runtime.java:970)

06-18 00:48:42.677 27226 27226我是艺术:在java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,boolean, java.lang.Object [])(Runtime.java:954)

06-18 00:48:42.677 27226 27226 I art:at java.lang.Object com.tns.Runtime.callJSMethod(java.lang.Object,java.lang.String,java.lang.Class,java。 lang.Object [])(Runtime.java:946)

当我按下&#34; Pagar&#34; BUTTOM

chromium:[INFO:CONSOLE(0)]&#34;用于从https://data.mercadolibre.com加载资源的SSL证书将来会受到不信任。一旦不信任,将阻止用户加载这些资源。有关详细信息,请参阅https://g.co/chrome/symantecpkicerts。&#34;,来源:https://www.mercadopago.com.ar/cuotas?seller_id=269515452&marketplace=NONE&iframe=true(0)

当我填写用户名

铬:[信息:控制台(6)]&#34;未捕获的TypeError:无法读取属性&#39; toString&#39;未定义&#34;,来源:https://www.mercadopago.com/mla/checkout/pay?pref_id=269515452-257c5142-68a0-4bb7-ac9f-d1eac5883ee3&flowId=472d573f-569e-4168-9947-f33642372dcd&logout=true(6)

但是当我登录时我什么也听不见。只有我用webview.on()方法捕获一些日志。如果我提交到“开始加载事件”和“完成加载事件”,则日志为

铬:[信息:控制台(6)]&#34;未捕获的TypeError:无法读取属性&#39; toString&#39;未定义&#34;,来源:https://www.mercadopago.com/mla/checkout/pay?pref_id=269515452-257c5142-68a0-4bb7-ac9f-d1eac5883ee3&flowId=472d573f-569e-4168-9947-f33642372dcd&logout=true(6)

JS:WebView loadStartedEvent- WebView开始加载https://www.mercadolibre.com/jms/mla/lgz/login/authenticate

JS:WebView loadStartedEvent- WebView开始加载https://www.mercadopago.com/mla/checkout/pay?execution=e7s1&_eventId=next&errors.invalid_attempts=6&errors.user=email_not_found&errors.user_id=not_found&platform_id=mp&site_id=mla&go=https%3A%2F%2Fwww.mercadopago.com%2Fmla%2Fcheckout%2Fpay%3Fexecution%3De7s1%26_eventId%3Dnext&user_id=test_user_1038255%40testuser.com&remember_me=true&loginType=DEFAULT&registered=true

JS:WebView loadFinishedEvent - WebView完成加载https://www.mercadopago.com/mla/checkout/pay?execution=e7s1&_eventId=next&errors.invalid_attempts=6&errors.user=email_not_found&errors.user_id=not_found&platform_id=mp&site_id=mla&go=https%3A%2F%2Fwww.mercadopago.com%2Fmla%2Fcheckout%2Fpay%3Fexecution%3De7s1%26_eventId%3Dnext&user_id=test_user_1038255%40testuser.com&remember_me=true&loginType=DEFAULT&registered=true#login

JS:WebView loadFinishedEvent - WebView完成加载https://www.mercadopago.com/mla/checkout/pay?execution=e7s1&_eventId=next&errors.invalid_attempts=6&errors.user=email_not_found&errors.user_id=not_found&platform_id=mp&site_id=mla&go=https%3A%2F%2Fwww.mercadopago.com%2Fmla%2Fcheckout%2Fpay%3Fexecution%3De7s1%26_eventId%3Dnext&user_id=test_user_1038255%40testuser.com&remember_me=true&loginType=DEFAULT&registered=true#login

0 个答案:

没有答案