hch
5 天以前 e8d63e91d80cc59d7947ad026149c2b752ce9364
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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));//扩展信息
    }
}