package com.secondworld.sdk.command; import android.util.Base64; import com.cy.yyjia.sdk.center.SdkManager; import com.secondworld.sdk.GameAppProxy; import com.secondworld.sdk.utils.CodeU2A; import org.json.JSONObject; import java.nio.charset.StandardCharsets; public class CmdPlatformPay implements ICommand { @Override public int getCode() { return CodeU2A.PlatformPay; } @Override public void process(JSONObject json) throws Exception { JSONObject extraData = new JSONObject(); extraData.put("appid", GameAppProxy.appId); extraData.put("cpinfo", json.getString("cpInfo")); extraData.put("cporderid", json.getString("orderId")); byte[] bytes = extraData.toString().getBytes(StandardCharsets.UTF_8); SdkManager.getInstance() .pay(json.getString("sid"),//服务器编号 json.getString("roleID"),//角色编号 json.getString("cpInfo"),//商品id json.getString("title"),//商品名称 json.getString("mount"),//充值金额 json.getString("orderId"),//Cp订单号 Base64.encodeToString(bytes,Base64.DEFAULT));//扩展信息 } }