本文整理汇总了Java中com.alipay.sdk.app.PayTask.fetchOrderInfoFromH5PayUrl方法的典型用法代码示例。如果您正苦于以下问题:Java PayTask.fetchOrderInfoFromH5PayUrl方法的具体用法?Java PayTask.fetchOrderInfoFromH5PayUrl怎么用?Java PayTask.fetchOrderInfoFromH5PayUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alipay.sdk.app.PayTask
的用法示例。
在下文中一共展示了PayTask.fetchOrderInfoFromH5PayUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isAlipay
import com.alipay.sdk.app.PayTask; //导入方法依赖的package包/类
private boolean isAlipay(final WebView view, String url) {
Activity mActivity=null;
if((mActivity=mWeakReference.get())==null)
return false;
final PayTask task = new PayTask(mActivity);
final String ex = task.fetchOrderInfoFromH5PayUrl(url);
LogUtils.i("Info", "alipay:" + ex);
if (!TextUtils.isEmpty(ex)) {
//System.out.println("paytask:::::" + url);
AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
public void run() {
System.out.println("payTask:::" + ex);
final H5PayResultModel result = task.h5Pay(ex, true);
if (!TextUtils.isEmpty(result.getReturnUrl())) {
AgentWebX5Utils.runInUiThread(new Runnable() {
@Override
public void run() {
view.loadUrl(result.getReturnUrl());
}
});
}
}
});
return true;
}
return false;
}
示例2: shouldOverrideUrlLoading
import com.alipay.sdk.app.PayTask; //导入方法依赖的package包/类
@Override
public boolean shouldOverrideUrlLoading(final WebView view, String url) {
if (!(url.startsWith("http") || url.startsWith("https"))) {
return true;
}
final PayTask task = new PayTask(H5PayDemoActivity.this);
final String ex = task.fetchOrderInfoFromH5PayUrl(url);
if (!TextUtils.isEmpty(ex)) {
System.out.println("paytask:::::" + url);
new Thread(new Runnable() {
public void run() {
System.out.println("payTask:::" + ex);
final H5PayResultModel result = task.h5Pay(ex, true);
if (!TextUtils.isEmpty(result.getReturnUrl())) {
H5PayDemoActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
view.loadUrl(result.getReturnUrl());
}
});
}
}
}).start();
} else {
view.loadUrl(url);
}
return true;
}