소스 검색

添加角色上报接口,支付接口。

kaiweicai 2 년 전
부모
커밋
180d509a1d
35개의 변경된 파일1021개의 추가작업 그리고 158개의 파일을 삭제
  1. 10 14
      demo/src/main/java/com/yyxx/commsdk/demo/DemoActivity.kt
  2. 3 3
      library_base/src/main/java/cn/yyxx/commsdk/base/YYXXCommSdk.java
  3. 2 1
      library_base/src/main/java/cn/yyxx/commsdk/base/YYXXWelcomeActivity.java
  4. 4 6
      library_base/src/main/java/cn/yyxx/commsdk/base/constants/Constants.java
  5. 2 0
      library_base/src/main/java/cn/yyxx/commsdk/base/entity/Function.java
  6. 31 0
      library_base/src/main/java/cn/yyxx/commsdk/base/entity/SdkChargeInfo.java
  7. 86 0
      library_base/src/main/java/cn/yyxx/commsdk/base/entity/SdkOrderInfo.java
  8. 7 1
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IFeature.java
  9. 11 1
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IOrder.java
  10. 0 17
      library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IRoleData.java
  11. 20 2
      library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkImpl.java
  12. 32 5
      library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdkYYXX.java
  13. 8 14
      library_core/src/main/java/cn/yyxx/commsdk/core/SdkBridge.java
  14. 109 5
      library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java
  15. 6 1
      library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java
  16. 41 6
      library_core/src/main/java/cn/yyxx/commsdk/core/impl/SdkBridgeImpl.java
  17. 2 2
      library_core/src/main/java/cn/yyxx/commsdk/core/network/Hosts.java
  18. 155 54
      library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java
  19. 167 0
      library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/CommPayDialog.java
  20. 1 4
      library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/PrivacyPolicyDialog.java
  21. 39 0
      library_core/src/main/res/layout/yyxx_comm_p_webview.xml
  22. BIN
      library_core/src/main/res/mipmap-hdpi/yyxx_comm_close.png
  23. 1 0
      library_core/src/main/res/values/yyxx_comm_strings.xml
  24. 32 5
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/SdkPlatformBridge.java
  25. 171 0
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/HnPayDialog.java
  26. 39 4
      library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/impl/SdkPlatformImpl.java
  27. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_edittext_style.xml
  28. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_email_dialog.xml
  29. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_p_webview.xml
  30. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_register_dialog.xml
  31. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_user_list_item.xml
  32. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_usercenter_dialog.xml
  33. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_usercenter_portait_dialog.xml
  34. 1 1
      library_platform/platform_hnyy/src/main/res/layout/hnyy_webview_common_dialog.xml
  35. 34 5
      library_platform/src/main/java/cn/yyxx/commsdk/platform/PlatformSdk.java

+ 10 - 14
demo/src/main/java/com/yyxx/commsdk/demo/DemoActivity.kt

@@ -15,6 +15,7 @@ import android.view.KeyEvent
 import android.view.View
 import android.widget.*
 import cn.yyxx.commsdk.base.YYXXCommSdk
+import cn.yyxx.commsdk.base.constants.Constants
 import cn.yyxx.commsdk.base.entity.ResultInfo
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo
 import cn.yyxx.commsdk.base.entity.SdkRoleInfo
@@ -145,25 +146,14 @@ class DemoActivity : Activity(), View.OnClickListener {
                     YYXXCommSdk.getInstance().logout()
                 }
                 3 -> {
-                    YYXXCommSdk.getInstance().roleCreate(this@DemoActivity,getGameRoleInfo()) { code, result ->
-                        if (code == ResultInfo.CODE_SUCCESS) {
-
-                        }
-                    }
+                    YYXXCommSdk.getInstance().uploadRoleInfo(this@DemoActivity,Constants.UPLOAD_TYPE_CREATE_ROLE,getGameRoleInfo())
                 }
                 4 -> {
-                    YYXXCommSdk.getInstance().roleLauncher(this@DemoActivity,getGameRoleInfo()) { code, result ->
-                        if (code == ResultInfo.CODE_SUCCESS) {
+                    YYXXCommSdk.getInstance().uploadRoleInfo(this@DemoActivity,Constants.UPLOAD_TYPE_ENTER_GAME,getGameRoleInfo())
 
-                        }
-                    }
                 }
                 5 -> {
-                    YYXXCommSdk.getInstance().roleUpgrade(this@DemoActivity,getGameRoleInfo()) { code, result ->
-                        if (code == ResultInfo.CODE_SUCCESS) {
-
-                        }
-                    }
+                    YYXXCommSdk.getInstance().uploadRoleInfo(this@DemoActivity,Constants.UPLOAD_TYPE_LEVEL_UPGRADE,getGameRoleInfo())
 
                 }
                 6 -> {
@@ -304,6 +294,12 @@ class DemoActivity : Activity(), View.OnClickListener {
         roleInfo.partyId  = "3399"
         roleInfo.partyName = "子湖"
         roleInfo.reincarnationCount = "0"
+        roleInfo.rolePower = "101839303844302"
+        roleInfo.profession = "法师"
+
+        var  time = System.currentTimeMillis() / 1000
+        roleInfo.roleCreateTime ="$time"
+
         cacheRoleInfo = roleInfo
         return roleInfo
     }

+ 3 - 3
library_base/src/main/java/cn/yyxx/commsdk/base/YYXXCommSdk.java

@@ -256,15 +256,15 @@ public final class YYXXCommSdk {
      * @param type     上报场景
      * @param roleInfo 角色信息
      */
-    public void roleCreate(Activity activity, String type,SdkRoleInfo roleInfo) {
+    public void uploadRoleInfo(Activity activity, String type,SdkRoleInfo roleInfo) {
         if (checkSdkBridgeNull(Function.UPLOAD_ROLE_INFO, null)) {
             return;
         }
 
-        if (checkSdkNonInit(Function.UPLOAD_ROLE_INFO, callback)) {
+        if (checkSdkNonInit(Function.UPLOAD_ROLE_INFO, null)) {
             return;
         }
-        SdkBridgeManager.call(Function.UPLOAD_ROLE_INFO, new Class[]{Activity.class, SdkRoleInfo.class, ICallback.class}, new Object[]{activity, roleInfo, callback});
+        SdkBridgeManager.call(Function.UPLOAD_ROLE_INFO, new Class[]{Activity.class,String.class, SdkRoleInfo.class}, new Object[]{activity,type,roleInfo});
     }
 
 

+ 2 - 1
library_base/src/main/java/cn/yyxx/commsdk/base/YYXXWelcomeActivity.java

@@ -15,6 +15,7 @@ import android.widget.LinearLayout;
 
 import java.util.List;
 
+import cn.yyxx.commsdk.base.entity.ResultInfo;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.support.AppUtils;
@@ -61,7 +62,7 @@ public class YYXXWelcomeActivity extends Activity {
             public void onResult(int code, String result) {
                 Logger.logHandler("result : " + result + "\n");
 
-                if (code == 0) {
+                if (code == ResultInfo.CODE_SUCCESS) {
                     if (layout == null){
                         handler.sendEmptyMessage(CODE_GO_GAME_ACTIVITY);
                     }else{

+ 4 - 6
library_base/src/main/java/cn/yyxx/commsdk/base/constants/Constants.java

@@ -2,9 +2,9 @@ package cn.yyxx.commsdk.base.constants;
 
 public class Constants {
 
-    public static final String UPLOADTYPE_CREATEROLE = "UPLOADTYPE_CREATEROLE";					//创建角色
-    public static final String UPLOADTYPE_ENTERGAME = "UPLOADTYPE_ENTERGAME";
-    public static final String UPLOADTYPE_LEVELUP = "UPLOADTYPE_LEVELUP";
+    public static final String UPLOAD_TYPE_CREATE_ROLE = "createRole";					//创建角色
+    public static final String UPLOAD_TYPE_ENTER_GAME = "enterGame";
+    public static final String UPLOAD_TYPE_LEVEL_UPGRADE = "roleUpgrade";
 
 
     public static final String LOGIN = "LOGIN";
@@ -13,9 +13,7 @@ public class Constants {
 
 
 
-    public static final long CLICK_INTERVAL = 2000L;
-
-
 
+    public static final long CLICK_INTERVAL = 2000L;
 
 }

+ 2 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/entity/Function.java

@@ -17,7 +17,9 @@ public @interface Function {
     String INITIALIZE_SUCCESS = "initializeSuccess";
     String LOGIN = "login";
     String LOGOUT = "logout";
+    String GET_ORDER_INFO = "getOrderInfo";
     String CHARGE = "charge";
+    String GET_CHANNEL_ORDER_EXT = "getChannelOrderExt";
     String UPLOAD_ROLE_INFO = "uploadRoleInfo";
 
     String HAS_EXIT_VIEW = "hasExitView";

+ 31 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/entity/SdkChargeInfo.java

@@ -15,6 +15,37 @@ public class SdkChargeInfo {
     String role_name;
     String ext;
     String order_desc;
+    String sdk_params;
+
+    public String getSdk_params() {
+        return this.sdk_params;
+    }
+
+    public void setSdk_params(final String sdk_params) {
+        this.sdk_params = sdk_params;
+    }
+
+
+
+    public String getRoleCreateTime() {
+        return this.roleCreateTime;
+    }
+
+    public void setRoleCreateTime(final String roleCreateTime) {
+        this.roleCreateTime = roleCreateTime;
+    }
+
+    String roleCreateTime;
+
+    public String getOrder_name() {
+        return this.order_name;
+    }
+
+    public void setOrder_name(final String order_name) {
+        this.order_name = order_name;
+    }
+
+    String order_name;
     String product_name;
     String product_id;
     String vip_level;

+ 86 - 0
library_base/src/main/java/cn/yyxx/commsdk/base/entity/SdkOrderInfo.java

@@ -0,0 +1,86 @@
+package cn.yyxx.commsdk.base.entity;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import cn.yyxx.support.JsonUtils;
+
+public class SdkOrderInfo {
+    public String getPay_web_url() {
+        return this.pay_web_url;
+    }
+
+    public void setPay_web_url(final String pay_web_url) {
+        this.pay_web_url = pay_web_url;
+    }
+
+    public String getOrder_id() {
+        return this.order_id;
+    }
+
+    public void setOrder_id(final String order_id) {
+        this.order_id = order_id;
+    }
+
+    public String getOrder_ext() {
+        return this.order_ext;
+    }
+
+    public void setOrder_ext(final String order_ext) {
+        this.order_ext = order_ext;
+    }
+
+    public String getQuery_params() {
+        return this.query_params;
+    }
+
+    public void setQuery_params(final String query_params) {
+        this.query_params = query_params;
+    }
+
+    public SdkChargeInfo getSdkChargeInfo() {
+        return this.sdkChargeInfo;
+    }
+
+    public void setSdkChargeInfo(final SdkChargeInfo sdkChargeInfo) {
+        this.sdkChargeInfo = sdkChargeInfo;
+    }
+
+    public int getSdk_pay() {
+        return this.sdk_pay;
+    }
+
+    public void setSdk_pay(final int sdk_pay) {
+        this.sdk_pay = sdk_pay;
+    }
+
+    String pay_web_url,order_id,order_ext,query_params;
+    SdkChargeInfo sdkChargeInfo;
+    int sdk_pay = 1;
+
+    public void initOrderInfo(SdkChargeInfo sdkChargeInfo,String orderInfo){
+        this.sdkChargeInfo = sdkChargeInfo;
+
+        JSONObject info = null;
+        try {
+            info = new JSONObject(orderInfo);
+            if (JsonUtils.hasJsonKey(info, "query_params")) {
+                query_params = info.optString("query_params");
+             }
+            if (JsonUtils.hasJsonKey(info, "pay_web_url")) {
+                pay_web_url = info.optString("pay_web_url");
+            }
+            if (JsonUtils.hasJsonKey(info, "sdk_pay")) {
+                sdk_pay = info.optInt("sdk_pay",1);
+            }if (JsonUtils.hasJsonKey(info, "3rdext")) {
+                order_ext = info.optString("3rdext");
+            }
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
+
+    }
+
+
+}

+ 7 - 1
library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IFeature.java

@@ -2,7 +2,10 @@ package cn.yyxx.commsdk.base.internal.feature;
 
 import android.app.Activity;
 
+import org.json.JSONObject;
+
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
 
@@ -22,11 +25,14 @@ public interface IFeature {
 
     void logout();
 
-    void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback);
+
 
     boolean hasExitView(Activity activity);
 
     void openExitView(Activity activity, ICallback callback);
 
+    void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo);
+
+    void reportGameEvent(String event, JSONObject message);
 
 }

+ 11 - 1
library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IOrder.java

@@ -3,6 +3,8 @@ package cn.yyxx.commsdk.base.internal.feature;
 import android.app.Activity;
 
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.IRequestCallback;
 
 /**
@@ -19,5 +21,13 @@ public interface IOrder {
      * @param sdkChargeInfo
      * @param requestCallback
      */
-    void getOrderId(Activity activity, SdkChargeInfo sdkChargeInfo, IRequestCallback requestCallback);
+    void getOrderInfo(Activity activity, SdkChargeInfo sdkChargeInfo, IRequestCallback requestCallback);
+
+
+    void charge(Activity activity, SdkOrderInfo sdkOrderInfo, ICallback callback);
+    /**
+     * 获取下单时所需参数
+     * @return
+     */
+    String getChannelOrderExt();
 }

+ 0 - 17
library_base/src/main/java/cn/yyxx/commsdk/base/internal/feature/IRoleData.java

@@ -1,17 +0,0 @@
-package cn.yyxx.commsdk.base.internal.feature;
-
-import android.app.Activity;
-
-import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
-import cn.yyxx.commsdk.base.internal.ICallback;
-
-/**
- * @author #Suyghur.
- * Created on 2021/12/26
- */
-public interface IRoleData {
-
-    void uploadRoleInfo(Activity activity,String type,SdkRoleInfo roleInfo);
-
-
-}

+ 20 - 2
library_channel/src/main/java/cn/yyxx/commsdk/impl/ChannelSdkImpl.java

@@ -11,11 +11,14 @@ import android.os.Bundle;
 
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
 
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
 import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
 
 
 /**
@@ -63,14 +66,29 @@ public class ChannelSdkImpl {
         impl.logout();
     }
 
-    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
-        impl.charge(activity, chargeInfo, callback);
+    public void charge(Activity activity, SdkOrderInfo sdkOrderInfo, ICallback callback) {
+        if (impl instanceof IOrder) {
+            ((IOrder) impl).charge(activity,sdkOrderInfo,callback);
+        }
+
+
     }
 
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo){
+        impl.uploadRoleInfo(activity,type,roleInfo);
+    };
+
     public boolean hasExitView(Activity activity) {
         return impl.hasExitView(activity);
     }
 
+    public String getChannelOrderExt(){
+        if (impl instanceof IOrder) {
+            return ((IOrder) impl).getChannelOrderExt();
+        }
+        return "";
+     }
+
     public void openExitView(Activity activity, final ICallback callback) {
         impl.openExitView(activity, callback);
     }

+ 32 - 5
library_channel/src/main/java/cn/yyxx/commsdk/impl/channel/ChannelSdkYYXX.java

@@ -7,12 +7,18 @@ import android.content.Intent;
 import android.content.res.Configuration;
 import android.os.Bundle;
 
+import org.json.JSONObject;
+
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.IRequestCallback;
 import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
 import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
 import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.platform.PlatformSdk;
 
@@ -20,7 +26,7 @@ import cn.yyxx.commsdk.platform.PlatformSdk;
  * @author #Suyghur.
  * Created on 2021/12/26
  */
-public class ChannelSdkYYXX implements IFeature, ILifeCycle, IApplication {
+public class ChannelSdkYYXX implements IFeature, ILifeCycle, IOrder,IApplication {
 
     private Activity activity;
 
@@ -58,10 +64,6 @@ public class ChannelSdkYYXX implements IFeature, ILifeCycle, IApplication {
     }
 
 
-    @Override
-    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
-
-    }
 
     @Override
     public boolean hasExitView(Activity activity) {
@@ -75,6 +77,16 @@ public class ChannelSdkYYXX implements IFeature, ILifeCycle, IApplication {
 
     }
 
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+        PlatformSdk.getInstance(activity).uploadRoleInfo(activity,type,roleInfo);
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+        PlatformSdk.getInstance(activity).reportGameEvent(event,message);
+    }
+
     @Override
     public void onDestroy(Activity activity) {
         PlatformSdk.getInstance(activity).onDestroy(activity);
@@ -139,4 +151,19 @@ public class ChannelSdkYYXX implements IFeature, ILifeCycle, IApplication {
     public void initApplication(Application application) {
         PlatformSdk.getInstance(application).initApplication(application);
     }
+
+    @Override
+    public void getOrderInfo(Activity activity, SdkChargeInfo sdkChargeInfo, IRequestCallback requestCallback) {
+
+    }
+
+    @Override
+    public void charge(Activity activity, SdkOrderInfo sdkOrderInfo, ICallback callback) {
+        PlatformSdk.getInstance(activity).charge(activity,sdkOrderInfo,callback);
+    }
+
+    @Override
+    public String getChannelOrderExt() {
+        return PlatformSdk.getInstance(activity).getChannelOrderExt();
+    }
 }

+ 8 - 14
library_core/src/main/java/cn/yyxx/commsdk/core/SdkBridge.java

@@ -9,11 +9,13 @@ import android.os.Bundle;
 
 import java.util.List;
 
+
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
 import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
-import cn.yyxx.commsdk.base.entity.bean.InitBean;
+
 import cn.yyxx.commsdk.base.internal.ICallback;
-import cn.yyxx.commsdk.base.internal.IInitialize;
+
 import cn.yyxx.commsdk.core.impl.SdkBridgeImpl;
 
 /**
@@ -59,20 +61,12 @@ public final class SdkBridge {
     }
 
     public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
-        impl.charge(activity, chargeInfo, callback);
-    }
-
-    public void roleCreate(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        impl.roleCreate(activity, roleInfo, callback);
-    }
-
-    public void roleLauncher(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        impl.roleLauncher(activity, roleInfo, callback);
+        impl.getOrderInfo(activity,chargeInfo,callback);
     }
 
-    public void roleUpgrade(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-        impl.roleUpgrade(activity, roleInfo, callback);
-    }
+    public void uploadRoleInfo(Activity activity, String type,SdkRoleInfo roleInfo) {
+        impl.uploadRoleInfo(activity,type,roleInfo);
+       }
 
     public boolean hasExitView(Activity activity) {
         return impl.hasExitView(activity);

+ 109 - 5
library_core/src/main/java/cn/yyxx/commsdk/core/common/CommonOperationManager.java

@@ -1,5 +1,7 @@
 package cn.yyxx.commsdk.core.common;
 
+import static cn.yyxx.commsdk.base.constants.Constants.UPLOAD_TYPE_LEVEL_UPGRADE;
+
 import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.app.Application;
@@ -20,13 +22,16 @@ import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import cn.yyxx.commsdk.base.entity.ResultInfo;
+import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.IMsaDeviceCallback;
 import cn.yyxx.commsdk.base.internal.IRequestCallback;
 import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.SdkDrive;
-import cn.yyxx.commsdk.base.constants.Constants;
+
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
+import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
 import cn.yyxx.commsdk.core.network.SdkRequest;
 import cn.yyxx.commsdk.core.ui.dialog.LoadingDialogUtils;
 import cn.yyxx.commsdk.core.ui.dialog.PrivacyPolicyDialog;
@@ -37,6 +42,7 @@ import cn.yyxx.commsdk.core.utils.ParamsUtils;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
 import cn.yyxx.support.JsonUtils;
 
+import cn.yyxx.support.hawkeye.ToastUtils;
 import cn.yyxx.support.permission.IPermissionCallback;
 import cn.yyxx.support.permission.Permission;
 import cn.yyxx.support.permission.PermissionKit;
@@ -116,7 +122,7 @@ public class CommonOperationManager {
 
                         @Override
                         public void onUserDisagreePolicy() {
-                            callback.onResult(Constants.CODE_FAIL,"User disagree policy");
+                            callback.onResult(ResultInfo.CODE_FAIL,"User disagree policy");
                         }
                     }).show();
                 }
@@ -353,11 +359,11 @@ public class CommonOperationManager {
 
         // 直接跳过,不申请权限
         if (!ManifestUtils.getMetaDataValue(activity,"yyxx.SkipPermission").isEmpty()){
-            callback.onResult(Constants.CODE_SUCCESS,"User skip permission required");
+            callback.onResult(ResultInfo.CODE_SUCCESS,"User skip permission required");
         }
         //第二次打开,不再申请权限
         else if (!MMKVUtils.getInstance().commonKV.decodeString("yyxx.StopRequestPermission","").isEmpty()){
-            callback.onResult(Constants.CODE_SUCCESS,"No more permissions required");
+            callback.onResult(ResultInfo.CODE_SUCCESS,"No more permissions required");
         }
         //申请权限
         else{
@@ -369,7 +375,7 @@ public class CommonOperationManager {
                         if(!ManifestUtils.getMetaDataValue(activity,"yyxx.StopRequestPermission").isEmpty()){
                             MMKVUtils.getInstance().commonKV.encode("yyxx.StopRequestPermission","1");
                         }
-                        callback.onResult(Constants.CODE_SUCCESS,"The permission application is complete");
+                        callback.onResult(ResultInfo.CODE_SUCCESS,"The permission application is complete");
                     }
                 }
             });
@@ -432,4 +438,102 @@ public class CommonOperationManager {
         STOP,
         FINISH
     }
+
+
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().uname)) {
+
+            ToastUtils.toastInfo(activity,"请先登录");
+
+            return;
+        }
+
+        
+        if (TextUtils.isEmpty(roleInfo.getCharge())){
+            roleInfo.setCharge("0");
+        }
+
+        if (TextUtils.isEmpty(roleInfo.getRoleId()) || TextUtils.isEmpty(roleInfo.getRoleName())
+                || TextUtils.isEmpty(roleInfo.getRoleLevel())
+                || TextUtils.isEmpty(roleInfo.getGender())
+                || TextUtils.isEmpty(roleInfo.getServerId())
+                || TextUtils.isEmpty(roleInfo.getServerName())
+                || TextUtils.isEmpty(roleInfo.getHasGold())
+                || TextUtils.isEmpty(roleInfo.getVipLevel())
+                || TextUtils.isEmpty(roleInfo.getRoleCreateTime())
+                || TextUtils.isEmpty(roleInfo.getRolePower())
+                || TextUtils.isEmpty(roleInfo.getReincarnationCount())) {
+
+            Logger.i("上报参数有空值,请检查: "+ roleInfo.toString());
+
+        }
+        
+        
+        
+
+        if (roleInfo.getRoleCreateTime().length() != 10) {
+
+            ToastUtils.toastInfo(activity,activity.getString(ResourceUtil.getStringId(activity,"yyxx_comm_ctime_format_error")));
+
+            return;
+        }
+
+
+
+
+        if (type.equals(UPLOAD_TYPE_LEVEL_UPGRADE)) {
+            Logger.i("上报角色成功");
+             return;
+        }else{
+            SdkRequest.getInstance().uploadRoleInfo(activity, type, roleInfo, new IRequestCallback() {
+                @Override
+                public void onResponse(ResultInfo resultInfo) {
+                    if (resultInfo.code == ResultInfo.CODE_SUCCESS){
+                        Logger.i("上报角色成功");
+                    }else{
+                        Logger.i("上报角色失败");
+                    }
+                }
+            });
+        }
+
+    }
+
+
+    public void getOrderInfo(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
+
+
+        if (TextUtils.isEmpty(SdkLoginInfo.getInstance().uname)){
+
+            ToastUtils.toastInfo(activity,"请先登录");
+
+            return;
+        }
+        if (TextUtils.isEmpty(chargeInfo.getGame_no()) || TextUtils.isEmpty(chargeInfo.getPay_money())
+                || TextUtils.isEmpty(chargeInfo.getServer_id())
+                || TextUtils.isEmpty(chargeInfo.getServer_name())
+                || TextUtils.isEmpty(chargeInfo.getRole_id())
+                || TextUtils.isEmpty(chargeInfo.getRole_level())
+                || TextUtils.isEmpty(chargeInfo.getRole_name())
+                || TextUtils.isEmpty(chargeInfo.getExt())
+                || TextUtils.isEmpty(chargeInfo.getOrder_desc())
+                || TextUtils.isEmpty(chargeInfo.getProduct_id())) {
+
+            Logger.i("下单参数有空值,请检查: "+ chargeInfo);
+        }
+
+        SdkRequest.getInstance().charge(activity, chargeInfo, new IRequestCallback() {
+            @Override
+            public void onResponse(ResultInfo resultInfo) {
+
+                    callback.onResult(resultInfo.code,resultInfo.data);
+
+
+            }
+        });
+
+    }
+
+
 }

+ 6 - 1
library_core/src/main/java/cn/yyxx/commsdk/core/entity/SdkLoginInfo.java

@@ -9,7 +9,7 @@ public class SdkLoginInfo {
 
     private static SdkLoginInfo mInstance;
 
-    public String authentication = "",user_center= "",login_token= "",rn_si= "",uname= "",token= "";
+    public String authentication = "",user_center= "",login_token= "",rn_si= "",uname= "",channel_uid ="",token= "";
 
     private SdkLoginInfo() {
 
@@ -33,6 +33,7 @@ public class SdkLoginInfo {
         rn_si= "";
         uname= "";
         token= "";
+        channel_uid = "";
 
     }
 
@@ -59,6 +60,9 @@ public class SdkLoginInfo {
             if (JsonUtils.hasJsonKey(jsonObject, "token")) {
                 token = jsonObject.optString("token");
             }
+            if (JsonUtils.hasJsonKey(jsonObject, "channel_uid")) {
+                channel_uid = jsonObject.optString("channel_uid");
+            }
 
 
         } catch (JSONException e) {
@@ -75,6 +79,7 @@ public class SdkLoginInfo {
                 ", login_token='" + login_token + '\'' +
                 ", rn_si='" + rn_si + '\'' +
                 ", uname='" + uname + '\'' +
+                ", channel_uid='" + channel_uid + '\'' +
                 ", token='" + token + '\'' +
                 '}';
     }

+ 41 - 6
library_core/src/main/java/cn/yyxx/commsdk/core/impl/SdkBridgeImpl.java

@@ -6,6 +6,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
 import android.os.Bundle;
+import android.text.TextUtils;
 
 import org.json.JSONArray;
 import org.json.JSONException;
@@ -18,6 +19,7 @@ import java.util.List;
 import cn.yyxx.commsdk.base.entity.Function;
 import cn.yyxx.commsdk.base.entity.ResultInfo;
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
 import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
@@ -26,7 +28,9 @@ import cn.yyxx.commsdk.base.utils.Logger;
 
 import cn.yyxx.commsdk.core.common.CommonOperationManager;
 
+import cn.yyxx.commsdk.core.ui.dialog.CommPayDialog;
 import cn.yyxx.commsdk.core.utils.MMKVUtils;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
 import cn.yyxx.support.permission.IPermissionCallback;
 import cn.yyxx.support.permission.PermissionKit;
 
@@ -123,18 +127,49 @@ public final class SdkBridgeImpl {
 
     }
 
-    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
-    }
 
-    public void roleCreate(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
-    }
+    public void getOrderInfo(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
 
-    public void roleLauncher(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
+        String  sdk_params = (String) SdkProxyManager.callback(Function.GET_CHANNEL_ORDER_EXT,new Class[]{}, new Object[]{});
+        chargeInfo.setSdk_params(sdk_params);
+        ICallback iChargeCallBack = new ICallback() {
+            @Override
+            public void onResult(int code, String result) {
+                if (code == ResultInfo.CODE_SUCCESS){
+                    SdkOrderInfo sdkOrderInfo = new SdkOrderInfo();
+                    sdkOrderInfo.initOrderInfo(chargeInfo,result);
+                    if (sdkOrderInfo.getSdk_pay() == 1){
+                        charge(activity,sdkOrderInfo,callback);
+                    }else{
+                        if (!TextUtils.isEmpty(sdkOrderInfo.getPay_web_url())){
+                            new CommPayDialog(activity, ResourceUtil.getStyleId(activity, "hnyy_base_dialog"),sdkOrderInfo).show();
+                        }
+                    }
+                }else{
+                    callback.onResult(ResultInfo.CODE_FAIL,result);
+                }
+            }
+        };
+        CommonOperationManager.getInstance().getOrderInfo(activity,chargeInfo,iChargeCallBack);
     }
 
-    public void roleUpgrade(Activity activity, SdkRoleInfo roleInfo, ICallback callback) {
+
+
+     public void charge(Activity activity, SdkOrderInfo sdkOrderInfo, ICallback callback) {
+
+
+         SdkProxyManager.call(Function.CHARGE,  new Class[]{Activity.class,SdkOrderInfo.class,ICallback.class}, new Object[]{activity,sdkOrderInfo,callback});
+
+     }
+
+    public void uploadRoleInfo(Activity activity, String type,SdkRoleInfo roleInfo) {
+        CommonOperationManager.getInstance().uploadRoleInfo(activity,type,roleInfo);
+        SdkProxyManager.call(Function.UPLOAD_ROLE_INFO,  new Class[]{Activity.class,String.class,SdkRoleInfo.class}, new Object[]{activity,type,roleInfo});
+
     }
 
+
+
     public boolean hasExitView(Activity activity) {
          return (boolean)SdkProxyManager.callback(Function.HAS_EXIT_VIEW,new Class[]{Activity.class}, new Object[]{activity});
     }

+ 2 - 2
library_core/src/main/java/cn/yyxx/commsdk/core/network/Hosts.java

@@ -15,8 +15,8 @@ public class Hosts {
 
     public static final String  BASIC_URL_FAST_REGISTER = "fast_register";
     public static final String  BASIC_URL_USER_LOGIN =  "user_login";
-    public static final String  BASIC_URL_UPLOAD_ROLEINFO = HOST +  "/report_role_info";
-    public static final String  BASIC_URL_RECHARGE_INIT= HOST +  "/recharge_init";
+    public static final String  BASIC_URL_UPLOAD_ROLEINFO =   "report_role_info";
+    public static final String  BASIC_URL_RECHARGE_INIT= "recharge_init";
     public static final String  BASIC_URL_CHANNEL_LOGIN = HOST +  "/channel_login";
     public static final String  BASIC_URL_GET_CAPTCHA = "phone_captcha";
     public static final String  BASIC_URL_PHONE_REGISTER =  "phone_register";

+ 155 - 54
library_core/src/main/java/cn/yyxx/commsdk/core/network/SdkRequest.java

@@ -10,14 +10,18 @@ import android.util.Log;
 import org.json.JSONException;
 import org.json.JSONObject;
 
+import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.internal.IRequestCallback;
 
 import cn.yyxx.commsdk.base.utils.Logger;
 import cn.yyxx.commsdk.core.SdkDrive;
 import cn.yyxx.commsdk.core.common.CommonOperationManager;
+import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
 import cn.yyxx.commsdk.core.utils.ManifestUtils;
 import cn.yyxx.commsdk.core.utils.SignUtils;
+import cn.yyxx.support.AppUtils;
 import cn.yyxx.support.PropertiesUtils;
 import cn.yyxx.support.device.DeviceInfoUtils;
 import cn.yyxx.support.encryption.aes.AesUtils;
@@ -26,23 +30,25 @@ import cn.yyxx.support.encryption.rsa.RsaUtils;
 public class SdkRequest {
     private static volatile SdkRequest mInstance;
 
-    private SdkRequest(){}
-    public static SdkRequest getInstance(){
-        if (mInstance == null){
-            synchronized (SdkRequest.class){
+    private SdkRequest() {
+    }
+
+    public static SdkRequest getInstance() {
+        if (mInstance == null) {
+            synchronized (SdkRequest.class) {
                 mInstance = new SdkRequest();
             }
         }
         return mInstance;
     }
 
-    public void initAgreement(Context context, IRequestCallback callback){
-        String game_code = PropertiesUtils.getValue4Properties(context,"yyxx_cfg.properties","yyxx_game","YYXX_GAME_CODE");
-        String gcp_code = ManifestUtils.getMetaDataValue(context,"gcp_code");
+    public void initAgreement(Context context, IRequestCallback callback) {
+        String game_code = PropertiesUtils.getValue4Properties(context, "yyxx_cfg.properties", "yyxx_game", "YYXX_GAME_CODE");
+        String gcp_code = ManifestUtils.getMetaDataValue(context, "gcp_code");
         JSONObject json = new JSONObject();
         try {
-            json.put("game_code",game_code);
-            json.put("gcp_code",gcp_code);
+            json.put("game_code", game_code);
+            json.put("gcp_code", gcp_code);
             json.put("route_path", Hosts.BASIC_URL_INIT_AGREEMENT);
 
         } catch (JSONException e) {
@@ -50,59 +56,59 @@ public class SdkRequest {
         }
 
         String paramText = SdkDrive.getInstance().invokeJobWithoutParams(json.toString());
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
     }
-    public void  initSdk(Context context, IRequestCallback callback){
+
+    public void initSdk(Context context, IRequestCallback callback) {
 
         JSONObject ifa_info = CommonOperationManager.getInstance().getIfa(context);
 
         try {
-            ifa_info.put("route_path",Hosts.BASIC_URL_INIT_SDK);
+            ifa_info.put("route_path", Hosts.BASIC_URL_INIT_SDK);
         } catch (JSONException e) {
             e.printStackTrace();
         }
 
         String paramText = SdkDrive.getInstance().invokeJob(ifa_info.toString());
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
     }
 
-    public void reigsterAccount(Context context, String account,String password,IRequestCallback callback){
+    public void reigsterAccount(Context context, String account, String password, IRequestCallback callback) {
 
         JSONObject json = new JSONObject();
 
-        String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" +password);
+        String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" + password);
 
         try {
-            json.put("route_path",Hosts.BASIC_URL_FAST_REGISTER);
-            json.put("smt_type",CommonOperationManager.initBean.isEmulator);
-            json.put("uname_pwd",uname_pwd);
+            json.put("route_path", Hosts.BASIC_URL_FAST_REGISTER);
+            json.put("smt_type", CommonOperationManager.initBean.isEmulator);
+            json.put("uname_pwd", uname_pwd);
         } catch (JSONException e) {
             e.printStackTrace();
         }
 
 
-
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
     }
 
-    public void accountLogin(Context context, String account,String password,String login_token,IRequestCallback callback){
+    public void accountLogin(Context context, String account, String password, String login_token, IRequestCallback callback) {
 
         JSONObject json = new JSONObject();
 
         try {
-            json.put("route_path",Hosts.BASIC_URL_USER_LOGIN);
-            json.put("smt_type",CommonOperationManager.initBean.isEmulator);
+            json.put("route_path", Hosts.BASIC_URL_USER_LOGIN);
+            json.put("smt_type", CommonOperationManager.initBean.isEmulator);
 
-            if (TextUtils.isEmpty(password)){
+            if (TextUtils.isEmpty(password)) {
 
-                json.put("login_token",login_token);
+                json.put("login_token", login_token);
 
-            }else{
+            } else {
 
-                String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" +password);
-                json.put("uname_pwd",uname_pwd);
+                String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" + password);
+                json.put("uname_pwd", uname_pwd);
             }
 
         } catch (JSONException e) {
@@ -110,93 +116,188 @@ public class SdkRequest {
         }
 
 
-
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
     }
 
-    public void getPhoneCaptcha(Context context,String phoneNum,String action,IRequestCallback callback){
+    public void getPhoneCaptcha(Context context, String phoneNum, String action, IRequestCallback callback) {
         JSONObject json = new JSONObject();
 
         try {
-            json.put("route_path",Hosts.BASIC_URL_GET_CAPTCHA);
-            json.put("phone",phoneNum);
-            json.put("action",action);
+            json.put("route_path", Hosts.BASIC_URL_GET_CAPTCHA);
+            json.put("phone", phoneNum);
+            json.put("action", action);
 
         } catch (JSONException e) {
             e.printStackTrace();
         }
 
 
-
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
     }
 
 
-    public void phoneLoginWithSms(Context context,String phoneNum,String code,IRequestCallback callback){
+    public void phoneLoginWithSms(Context context, String phoneNum, String code, IRequestCallback callback) {
         JSONObject json = new JSONObject();
 
         try {
-            json.put("route_path",Hosts.BASIC_URL_SMS_LOGIN);
-            json.put("phone",phoneNum);
-            json.put("sms",code);
+            json.put("route_path", Hosts.BASIC_URL_SMS_LOGIN);
+            json.put("phone", phoneNum);
+            json.put("sms", code);
 
         } catch (JSONException e) {
             e.printStackTrace();
         }
 
 
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context, HOST, paramText, callback);
+    }
+
+    public void setPassword(Context context, String account, String password, String code, IRequestCallback callback) {
+
+        JSONObject json = new JSONObject();
+
+        String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" + password);
+
+        try {
+            json.put("route_path", Hosts.BASIC_URL_PHONE_REGISTER);
+            json.put("smt_type", CommonOperationManager.initBean.isEmulator);
+            json.put("sms", code);
+            json.put("uname_pwd", uname_pwd);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
+
     }
 
-    public void setPassword(Context context, String account, String password,String code, IRequestCallback callback){
+    public void resetPassword(Context context, String phoneNum, String password, String code, IRequestCallback callback) {
 
         JSONObject json = new JSONObject();
 
-        String uname_pwd = SdkDrive.getInstance().invokeEncryptRsa(account + "|" +password);
+        String phone_pwd = SdkDrive.getInstance().invokeEncryptRsa(phoneNum + "|" + password + "|" + code);
 
         try {
-            json.put("route_path",Hosts.BASIC_URL_PHONE_REGISTER);
-            json.put("smt_type",CommonOperationManager.initBean.isEmulator);
-            json.put("sms",code);
-            json.put("uname_pwd",uname_pwd);
+            json.put("route_path", Hosts.BASIC_URL_PHONE_RESETPWD);
+            json.put("phone_pwd", phone_pwd);
         } catch (JSONException e) {
             e.printStackTrace();
         }
 
 
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context, HOST, paramText, callback);
+
+    }
+
+
+    public void uploadRoleInfo(Context context, String type, SdkRoleInfo roleInfo, IRequestCallback callback) {
+
+        JSONObject json = new JSONObject();
+
+        try {
+            json.put("route_path", Hosts.BASIC_URL_UPLOAD_ROLEINFO);
+            json.put("report_role_type", type);
+
+            json.put("uname", SdkLoginInfo.getInstance().uname);
+            json.put("channel_uid", SdkLoginInfo.getInstance().channel_uid);
+            json.put("party_id", roleInfo.getPartyId());
+            json.put("party_name", roleInfo.getPartyName());
+            json.put("server_id", roleInfo.getServerId());
+            json.put("server_name", roleInfo.getServerName());
+            json.put("role_id", roleInfo.getRoleId());
+            json.put("role_name", roleInfo.getRoleName());
+            json.put("role_level", roleInfo.getRoleLevel());
+            json.put("vip_level", roleInfo.getVipLevel());
+            json.put("role_power", roleInfo.getVipLevel());
+            json.put("role_gold", roleInfo.getHasGold());
+            json.put("role_ctime", roleInfo.getRoleCreateTime());
+
+            json.put("role_charge", roleInfo.getCharge());
+
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
 
     }
 
-    public void resetPassword(Context context, String phoneNum, String password,String code, IRequestCallback callback){
+
+    public void charge(Context context, SdkChargeInfo chargeInfo, IRequestCallback callback) {
 
         JSONObject json = new JSONObject();
 
-        String phone_pwd = SdkDrive.getInstance().invokeEncryptRsa(phoneNum + "|" +password + "|" +code);
 
         try {
-            json.put("route_path",Hosts.BASIC_URL_PHONE_RESETPWD);
-            json.put("phone_pwd",phone_pwd);
+            json.put("route_path", Hosts.BASIC_URL_RECHARGE_INIT);
+            json.put("uname", SdkLoginInfo.getInstance().uname);
+            json.put("channel_uid", SdkLoginInfo.getInstance().channel_uid);
+            json.put("cp_order_id", chargeInfo.getGame_no());
+            json.put("money", chargeInfo.getPay_money());
+            json.put("server_id", chargeInfo.getServer_id());
+            json.put("server_name", chargeInfo.getServer_name());
+            json.put("role_id", chargeInfo.getRole_id());
+            json.put("role_name", chargeInfo.getRole_name());
+            json.put("role_level", chargeInfo.getRole_level());
+            json.put("ext", chargeInfo.getExt());
+            json.put("order_name", chargeInfo.getOrder_name());
+            json.put("app_name", AppUtils.getAppName(context));
+
+            json.put("role_ctime", chargeInfo.getRoleCreateTime());
+            json.put("product_id", chargeInfo.getProduct_id());
+            if (!TextUtils.isEmpty(chargeInfo.getSdk_params())){
+                json.put("sdk_params", chargeInfo.getSdk_params());
+            }
+            
         } catch (JSONException e) {
             e.printStackTrace();
         }
 
+        String paramText = SdkDrive.getInstance().invokeJob(json.toString());
+
+        VolleyRequest.post(context, HOST, paramText, callback);
+    }
 
+    public void queryOrder(Context context, String order_id,String query_params, IRequestCallback callback) {
+        JSONObject json = new JSONObject();
+        try {
+            json.put("order_id",order_id);
+            json.put("query_params",query_params);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
 
         String paramText = SdkDrive.getInstance().invokeJob(json.toString());
 
-        VolleyRequest.post(context,HOST,paramText,callback);
+        VolleyRequest.post(context, HOST, paramText, callback);
 
     }
-
 }
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 167 - 0
library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/CommPayDialog.java

@@ -0,0 +1,167 @@
+package cn.yyxx.commsdk.core.ui.dialog;
+
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.View;
+import android.webkit.DownloadListener;
+import android.webkit.JavascriptInterface;
+import android.webkit.WebChromeClient;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.support.AppUtils;
+
+
+public class CommPayDialog extends Dialog implements View.OnClickListener{
+
+
+    private Context context;
+    private WebView webView;
+    private WebSettings webSettings;
+    private String orderId;
+    private ImageView iv_reback_close;
+    private SdkOrderInfo sdkOrderInfo;
+
+
+
+    public CommPayDialog(Context context, int theme, SdkOrderInfo sdkOrderInfo) {
+        super(context, theme);
+        this.context = context;
+         this.sdkOrderInfo = sdkOrderInfo;
+
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(ResourceUtil.getLayoutId(context,
+                "yyxx_comm_p_webview"));
+
+
+        if (!AppUtils.isLandscape(context)){
+            LinearLayout ll_p_wb = findViewById(ResourceUtil.getId(context, "ll_p_wb"));
+
+            ll_p_wb.setScaleX(0.9f);
+            ll_p_wb.setScaleY(0.9f);
+        }
+
+        iv_reback_close = findViewById(ResourceUtil.getId(context,
+                "iv_reback_close"));
+        iv_reback_close.setOnClickListener(this);
+
+        webView = findViewById(ResourceUtil.getId(context,
+                "wb_with_xd"));
+
+
+
+        webSettings = webView.getSettings();
+        webSettings.setAllowFileAccess(true);
+        webSettings.setJavaScriptEnabled(true);
+        webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
+
+        webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
+        webSettings.setBuiltInZoomControls(false);// 设置支持缩放
+        webSettings.setDomStorageEnabled(true);
+
+        webView.addJavascriptInterface(new Object(){
+            @JavascriptInterface
+            public void zfColse() {   //提供给js调用的方法
+                dismiss();
+            }
+            @JavascriptInterface
+            public void zfOrder(String message) {
+                orderId = message;
+            }
+        }, "yyrhsdk");
+
+        webView.setHorizontalScrollBarEnabled(false);//水平不显示
+        webView.setVerticalScrollBarEnabled(false); //垂直不显示
+        webView.setWebChromeClient(new WebChromeClient());
+        webView.setWebViewClient(new WebViewClient(){
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                String httpHead = url.substring(0, 5);
+                if (httpHead.equals("http:") || httpHead.equals("https")) {
+                    return super.shouldOverrideUrlLoading(view, url);
+                } else if (url.equals("yyrhsdk://pay_close")) {
+
+                    dismiss();
+
+                    return true;
+
+                } else if (url.equals("yyrhsdk://pay_success")) {
+                    dismiss();
+                    return true;
+                } else {
+                    if (httpHead.equals("yyrhsdk")) {
+
+                        return true;
+                    } else {
+                        openPay(url);
+                        return true;
+                    }
+                }
+            }
+
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                super.onPageFinished(view, url);
+
+            }
+
+
+
+            private void openPay(String code_url) {
+                try {
+                    Intent it = new Intent(Intent.ACTION_VIEW);
+                    it.setData(Uri.parse(code_url));
+                    context.startActivity(it);
+                } catch (Exception e) {
+
+                }
+            }
+        });
+
+        webView.setDownloadListener(new DownloadListener() {
+            @Override
+            public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
+                Uri uri = Uri.parse(url);
+                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+                context.startActivity(intent);
+            }
+        });
+
+
+        webView.loadUrl(sdkOrderInfo.getPay_web_url());
+    }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == ResourceUtil.getId(context, "iv_reback_close")) {
+            dismiss();
+
+        }
+    }
+
+    @Override
+    public void dismiss() {
+        super.dismiss();
+
+    }
+
+
+
+
+
+}

+ 1 - 4
library_core/src/main/java/cn/yyxx/commsdk/core/ui/dialog/PrivacyPolicyDialog.java

@@ -25,10 +25,7 @@ public class PrivacyPolicyDialog extends Dialog {
     String url;
     private Button btn_disagree,btn_agree;
 
-    public PrivacyPolicyDialog(Context context) {
-        super(context);
-    }
-    public PrivacyPolicyDialog(Context context,String url,OnClosePageListener listener) {
+     public PrivacyPolicyDialog(Context context,String url,OnClosePageListener listener) {
         super(context);
         this.context = context;
         this.url = url;

+ 39 - 0
library_core/src/main/res/layout/yyxx_comm_p_webview.xml

@@ -0,0 +1,39 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="360dp"
+    android:layout_height="320dp"
+    android:gravity="center"
+    android:background="@drawable/yyxx_comm_background"
+    android:orientation="vertical"
+    android:id="@+id/ll_p_wb"
+    >
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="20dp"
+            android:layout_weight="1.0"
+            android:orientation="horizontal">
+
+            <WebView
+                android:id="@+id/wb_with_xd"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:scrollbars="none"
+                android:layout_margin="10dp"
+                />
+
+            <ImageView
+                android:id="@+id/iv_reback_close"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="15dp"
+                android:layout_marginRight="5dp"
+                android:padding="10dp"
+                android:src="@mipmap/yyxx_comm_close"
+                android:layout_alignParentRight="true"
+
+                />
+
+        </RelativeLayout>
+
+
+    </LinearLayout>
+

BIN
library_core/src/main/res/mipmap-hdpi/yyxx_comm_close.png


+ 1 - 0
library_core/src/main/res/values/yyxx_comm_strings.xml

@@ -11,4 +11,5 @@
     <string name="yyxx_comm_initing">正在初始化...</string>
     <string name="yyxx_comm_init_success">初始化成功</string>
     <string name="yyxx_comm_init_fail">初始化失败</string>
+    <string name="yyxx_comm_ctime_format_error">角色创建时间格式错误,需10位数精度为秒</string>
 </resources>

+ 32 - 5
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/SdkPlatformBridge.java

@@ -8,15 +8,21 @@ import android.content.res.Configuration;
 import android.os.Bundle;
 
 
+import org.json.JSONObject;
+
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.IRequestCallback;
 import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
 import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
 import cn.yyxx.commsdk.platform.hnyy.impl.SdkPlatformImpl;
 
-public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication {
+public class SdkPlatformBridge implements IFeature, ILifeCycle, IOrder, IApplication {
 
     private SdkPlatformImpl impl = null;
 
@@ -65,10 +71,7 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication {
         impl.logout();
     }
 
-    @Override
-    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
-        impl.charge(activity,chargeInfo,callback);
-    }
+
 
     @Override
     public boolean hasExitView(Activity activity) {
@@ -80,6 +83,16 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication {
         impl.openExitView(activity,callback);
     }
 
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+        impl.uploadRoleInfo(activity,type,roleInfo);
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+        impl.reportGameEvent(event,message);
+    }
+
 
     @Override
     public void onStart(Activity activity) {
@@ -136,4 +149,18 @@ public class SdkPlatformBridge implements IFeature, ILifeCycle, IApplication {
     public void onCreate(Activity activity, Bundle savedInstanceState) {
         impl.onCreate(activity,savedInstanceState);
     }
+
+    @Override
+    public void getOrderInfo(Activity activity, SdkChargeInfo sdkChargeInfo, IRequestCallback requestCallback) {
+    }
+
+    @Override
+    public void charge(Activity activity, SdkOrderInfo sdkOrderInfo, ICallback callback) {
+        impl.charge(activity,sdkOrderInfo,callback);
+    }
+
+    @Override
+    public String getChannelOrderExt() {
+        return  impl.getChannelOrderExt();
+    }
 }

+ 171 - 0
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/dialog/HnPayDialog.java

@@ -0,0 +1,171 @@
+package cn.yyxx.commsdk.platform.hnyy.dialog;
+
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.View;
+import android.webkit.DownloadListener;
+import android.webkit.WebChromeClient;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+
+
+import java.util.HashMap;
+
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.core.utils.ResourceUtil;
+import cn.yyxx.commsdk.platform.hnyy.action.PageJsInteraction;
+import cn.yyxx.commsdk.platform.hnyy.fragment.widget.TosUtil;
+import cn.yyxx.support.AppUtils;
+
+
+public class HnPayDialog extends JsBaseDialog implements View.OnClickListener{
+
+
+    private Context context;
+    private WebView webView;
+    private WebSettings webSettings;
+    private String orderId;
+    private ImageView iv_reback_close;
+    private SdkOrderInfo sdkOrderInfo;
+
+
+
+    public HnPayDialog(Context context, int theme, SdkOrderInfo sdkOrderInfo) {
+        super(context, theme);
+        this.context = context;
+        this.sdkOrderInfo = sdkOrderInfo;
+
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(ResourceUtil.getLayoutId(context,
+                "hnyy_p_webview"));
+
+
+        if (!AppUtils.isLandscape(context)){
+            LinearLayout ll_p_wb = findViewById(ResourceUtil.getId(context, "ll_p_wb"));
+
+            ll_p_wb.setScaleX(0.9f);
+            ll_p_wb.setScaleY(0.9f);
+        }
+
+        iv_reback_close = findViewById(ResourceUtil.getId(context,
+                "iv_reback_close"));
+        iv_reback_close.setOnClickListener(this);
+
+        webView = findViewById(ResourceUtil.getId(context,
+                "wb_with_xd"));
+
+
+
+        webSettings = webView.getSettings();
+        webSettings.setAllowFileAccess(true);
+        webSettings.setJavaScriptEnabled(true);
+        webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
+
+        webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
+        webSettings.setBuiltInZoomControls(false);// 设置支持缩放
+        webSettings.setDomStorageEnabled(true);
+        webView.addJavascriptInterface(new PageJsInteraction(this), "yyrhsdk");
+        webView.setHorizontalScrollBarEnabled(false);//水平不显示
+        webView.setVerticalScrollBarEnabled(false); //垂直不显示
+        webView.setWebChromeClient(new WebChromeClient());
+        webView.setWebViewClient(new WebViewClient(){
+            @Override
+            public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                String httpHead = url.substring(0, 5);
+                if (httpHead.equals("http:") || httpHead.equals("https")) {
+                    return super.shouldOverrideUrlLoading(view, url);
+                } else if (url.equals("yyrhsdk://pay_close")) {
+
+                    dismiss();
+
+                    return true;
+
+                } else if (url.equals("yyrhsdk://pay_success")) {
+                    dismiss();
+                    return true;
+                } else {
+                    if (httpHead.equals("yyrhsdk")) {
+
+                        return true;
+                    } else {
+                        openWXPay(url);
+                        return true;
+                    }
+                }
+            }
+
+            @Override
+            public void onPageFinished(WebView view, String url) {
+                super.onPageFinished(view, url);
+
+            }
+
+            private void openWXPay(String code_url) {
+                try {
+                    Intent it = new Intent(Intent.ACTION_VIEW);
+                    it.setData(Uri.parse(code_url));
+                    context.startActivity(it);
+                } catch (Exception e) {
+
+                }
+            }
+        });
+
+        webView.setDownloadListener(new DownloadListener() {
+            @Override
+            public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
+                Uri uri = Uri.parse(url);
+                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+                context.startActivity(intent);
+            }
+        });
+
+
+        webView.loadUrl(sdkOrderInfo.getPay_web_url());
+    }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == ResourceUtil.getId(context, "iv_reback_close")) {
+            dismiss();
+
+        }
+    }
+
+    @Override
+    public void dismiss() {
+        super.dismiss();
+
+    }
+
+
+    @Override
+    public void zfOrder(String message) {
+        super.zfOrder(message);
+        orderId = message;
+    }
+
+    @Override
+    public void zfColse() {
+        super.zfColse();
+        dismiss();
+    }
+
+    @Override
+    public void showJsMsg(String message) {
+        super.showJsMsg(message);
+        new TosUtil(context,TosUtil.TOAST_ERROR,  message).show();
+    }
+}

+ 39 - 4
library_platform/platform_hnyy/src/main/java/cn/yyxx/commsdk/platform/hnyy/impl/SdkPlatformImpl.java

@@ -7,22 +7,31 @@ import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.res.Configuration;
 import android.os.Bundle;
+import android.text.TextUtils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
 
 import cn.yyxx.commsdk.base.entity.ResultInfo;
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
 import cn.yyxx.commsdk.base.internal.ICallback;
+import cn.yyxx.commsdk.base.internal.IRequestCallback;
 import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
 import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
 import cn.yyxx.commsdk.core.entity.SdkLoginInfo;
 import cn.yyxx.commsdk.core.utils.ResourceUtil;
 import cn.yyxx.commsdk.platform.PlatformSdk;
 import cn.yyxx.commsdk.platform.hnyy.HNYYLoginActivity;
 import cn.yyxx.commsdk.platform.hnyy.dialog.CustomExitGameDialog;
+import cn.yyxx.commsdk.platform.hnyy.dialog.HnPayDialog;
 import cn.yyxx.commsdk.platform.hnyy.floating.FloatViewManager;
 
-public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
+public class SdkPlatformImpl implements IFeature, ILifeCycle, IOrder, IApplication {
     public static InitBean initConfig = null ;
 
     private static SdkPlatformImpl manager;
@@ -74,10 +83,7 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
         hideFloat();
     }
 
-    @Override
-    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
 
-    }
 
     @Override
     public boolean hasExitView(Activity activity) {
@@ -113,6 +119,16 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
         }
     }
 
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+
+    }
+
 
     public static SdkPlatformImpl getInstance(Context context){
         if (manager == null) {
@@ -190,4 +206,23 @@ public class SdkPlatformImpl implements IFeature, ILifeCycle, IApplication {
     public void releaseFloat(){
         FloatViewManager.getInstance(activity).releaseFloat();
     }
+
+    @Override
+    public void getOrderInfo(Activity activity, SdkChargeInfo sdkChargeInfo, IRequestCallback requestCallback) {
+
+    }
+
+    @Override
+    public void charge(Activity activity, SdkOrderInfo sdkOrderInfo, ICallback callback) {
+        if (!TextUtils.isEmpty(sdkOrderInfo.getPay_web_url())){
+            new HnPayDialog(activity, ResourceUtil.getStyleId(activity, "hnyy_base_dialog"),sdkOrderInfo).show();
+
+        }
+
+    }
+
+    @Override
+    public String getChannelOrderExt() {
+        return "";
+    }
 }

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_edittext_style.xml

@@ -38,7 +38,7 @@ android:layout_height="wrap_content"
         android:layout_width="13dp"
         android:layout_height="13dp"
         android:layout_marginLeft="5dp"
-        android:background="@mipmap/hnyy_close"
+        android:background="@mipmap/yyxx_comm_close"
         android:layout_centerVertical="true"
         />
 

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_email_dialog.xml

@@ -29,7 +29,7 @@
             android:layout_width="28dp"
             android:layout_height="28dp"
 
-            android:src="@mipmap/hnyy_close"
+            android:src="@mipmap/yyxx_comm_close"
             android:layout_alignParentRight="true"
             android:layout_marginRight="15dp"
             android:layout_marginTop="15dp"

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_p_webview.xml

@@ -27,7 +27,7 @@
                 android:layout_marginTop="15dp"
                 android:layout_marginRight="5dp"
                 android:padding="10dp"
-                android:src="@mipmap/hnyy_close"
+                android:src="@mipmap/yyxx_comm_close"
                 android:layout_alignParentRight="true"
 
                 />

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_register_dialog.xml

@@ -72,7 +72,7 @@
             android:layout_alignRight="@id/reg_account_edit"
             android:layout_width="40dp"
             android:layout_height="40dp"
-            android:src="@mipmap/hnyy_close"
+            android:src="@mipmap/yyxx_comm_close"
             android:padding="13dp"
             android:layout_marginRight="3dp"
             />

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_user_list_item.xml

@@ -23,7 +23,7 @@
         android:layout_alignParentRight="true"
         android:layout_marginRight="10dp"
         android:layout_centerVertical="true"
-        android:src="@mipmap/hnyy_close"
+        android:src="@mipmap/yyxx_comm_close"
         android:padding="10dp"/>
     <View
         android:layout_width="match_parent"

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_usercenter_dialog.xml

@@ -39,7 +39,7 @@
             android:layout_width="25dp"
             android:layout_height="25dp"
             android:layout_toRightOf="@id/wb_user_info"
-            android:background="@mipmap/hnyy_close"
+            android:background="@mipmap/yyxx_comm_close"
             android:layout_marginTop="15dp"
             android:layout_marginLeft="15dp"
 

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_usercenter_portait_dialog.xml

@@ -41,7 +41,7 @@
             android:layout_alignTop="@id/wb_user_info"
             android:layout_marginTop="12dp"
             android:layout_marginRight="12dp"
-            android:src="@mipmap/hnyy_close"
+            android:src="@mipmap/yyxx_comm_close"
             android:padding="5dp"
 
             />

+ 1 - 1
library_platform/platform_hnyy/src/main/res/layout/hnyy_webview_common_dialog.xml

@@ -32,7 +32,7 @@
             android:layout_width="28dp"
             android:layout_height="28dp"
 
-            android:src="@mipmap/hnyy_close"
+            android:src="@mipmap/yyxx_comm_close"
             android:layout_alignParentRight="true"
             android:layout_marginRight="15dp"
             android:layout_marginTop="15dp"

+ 34 - 5
library_platform/src/main/java/cn/yyxx/commsdk/platform/PlatformSdk.java

@@ -6,24 +6,31 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
 import android.os.Bundle;
+import android.os.NetworkOnMainThreadException;
 
 
+import org.json.JSONObject;
+
 import cn.yyxx.commsdk.base.entity.Function;
 
 
 import cn.yyxx.commsdk.base.entity.SdkChargeInfo;
+import cn.yyxx.commsdk.base.entity.SdkOrderInfo;
+import cn.yyxx.commsdk.base.entity.SdkRoleInfo;
 import cn.yyxx.commsdk.base.internal.ICallback;
 import cn.yyxx.commsdk.base.entity.bean.InitBean;
+import cn.yyxx.commsdk.base.internal.IRequestCallback;
 import cn.yyxx.commsdk.base.internal.feature.IApplication;
 import cn.yyxx.commsdk.base.internal.feature.IFeature;
 import cn.yyxx.commsdk.base.internal.feature.ILifeCycle;
+import cn.yyxx.commsdk.base.internal.feature.IOrder;
 
 
 /**
  * @author #Suyghur.
  * Created on 2021/12/25
  */
-public class PlatformSdk implements IFeature,ILifeCycle, IApplication {
+public class PlatformSdk implements IFeature,ILifeCycle, IOrder, IApplication {
 
     private static PlatformSdk platformSdk;
 
@@ -95,10 +102,6 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication {
 
     }
 
-    @Override
-    public void charge(Activity activity, SdkChargeInfo chargeInfo, ICallback callback) {
-
-    }
 
     @Override
     public boolean hasExitView(Activity activity) {
@@ -113,6 +116,17 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication {
 
     }
 
+    @Override
+    public void uploadRoleInfo(Activity activity, String type, SdkRoleInfo roleInfo) {
+        checkSdkBridgeNull();
+        SdkProxyOperationManager.call(Function.UPLOAD_ROLE_INFO, new Class[]{Activity.class, String.class,SdkRoleInfo.class}, new Object[]{activity,type,roleInfo});
+
+    }
+
+    @Override
+    public void reportGameEvent(String event, JSONObject message) {
+
+    }
 
 
     @Override
@@ -207,4 +221,19 @@ public class PlatformSdk implements IFeature,ILifeCycle, IApplication {
         SdkProxyOperationManager.call(Function.ON_CREATE, new Class[]{Activity.class, Bundle.class}, new Object[]{activity, savedInstanceState});
 
     }
+
+    @Override
+    public void getOrderInfo(Activity activity, SdkChargeInfo sdkChargeInfo, IRequestCallback requestCallback) {
+
+    }
+
+    @Override
+    public void charge(Activity activity, SdkOrderInfo sdkOrderInfo, ICallback callback) {
+        SdkProxyOperationManager.call(Function.CHARGE, new Class[]{Activity.class, SdkOrderInfo.class,ICallback.class}, new Object[]{activity, sdkOrderInfo,callback});
+     }
+
+    @Override
+    public String getChannelOrderExt() {
+        return (String) SdkProxyOperationManager.callback(Function.GET_CHANNEL_ORDER_EXT, new Class[]{},new Object[]{});
+    }
 }