package com.secondworld.sdk.command; 
 | 
  
 | 
  
 | 
import android.widget.Toast; 
 | 
  
 | 
import com.secondworld.sdk.GameAppProxy; 
 | 
import com.secondworld.sdk.QuickSdkMgr; 
 | 
import com.secondworld.sdk.utils.CodeU2A; 
 | 
import com.smwl.smsdk.bean.PayInfo; 
 | 
import org.json.JSONObject; 
 | 
import java.net.URLEncoder; 
 | 
  
 | 
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")); 
 | 
  
 | 
        final PayInfo mPayInfo = new PayInfo (); 
 | 
        mPayInfo.setExtends_info_data (URLEncoder.encode(extraData.toString(), "utf-8").replace(" ","")); 
 | 
        mPayInfo.setGame_level (json.getString("level")); 
 | 
        mPayInfo.setGame_role_id (json.getString("roleID")); 
 | 
        mPayInfo.setGame_role_name (json.getString("roleName").trim().replace(" ", "")); 
 | 
        // 测试账号:x7demo 密码:123456(选择小号1进入游戏) 
 | 
        mPayInfo.setGame_area (json.getString("sid")); 
 | 
        // 测试账号:x7demo 密码:123456(选择小号1进入游戏) 小号名称:小号1  :对应的game_guid:2018642 
 | 
        mPayInfo.setGame_guid (json.getString("game_guid")); 
 | 
        mPayInfo.setGame_orderid (json.getString("orderId")); 
 | 
        mPayInfo.setGame_price (json.getString("mount")); 
 | 
        mPayInfo.setNotify_id (json.getString("notify_id")); 
 | 
        mPayInfo.setSubject (json.getString("title")); 
 | 
        mPayInfo.setGame_sign (json.getString("game_sign")); 
 | 
  
 | 
        QuickSdkMgr.I.pay(mPayInfo); 
 | 
  
 | 
    } 
 | 
} 
 |