|  |  |  | 
|---|
|  |  |  | package com.secondworld.sdk.command; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import android.util.Base64; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.cy.yyjia.sdk.center.SdkManager; | 
|---|
|  |  |  | import com.secondworld.sdk.GameApp; | 
|---|
|  |  |  | import com.secondworld.sdk.GameAppProxy; | 
|---|
|  |  |  | import com.secondworld.sdk.utils.CodeU2A; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import org.json.JSONObject; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.nio.charset.StandardCharsets; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public class CmdPlatformPay implements ICommand { | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void process(JSONObject json) throws Exception { | 
|---|
|  |  |  | JSONObject extraData = new JSONObject(); | 
|---|
|  |  |  | extraData.put("appid", GameApp.I.appId); | 
|---|
|  |  |  | 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("title"),//商品名称 | 
|---|
|  |  |  | json.getString("mount"),//充值金额 | 
|---|
|  |  |  | json.getString("orderId"),//Cp订单号 | 
|---|
|  |  |  | URLEncoder.encode(extraData.toString(), "utf-8"));//扩展信息 | 
|---|
|  |  |  | Base64.encodeToString(bytes,Base64.DEFAULT));//扩展信息 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|