/** * 应用汇生成订单。 * * @param accountID 账号ID * @param money 充值金额(分) * @param channel 用户渠道号 * @return 订单号 * @throws PartnerException */ public static String getOrder(int accountID, int money, String channel) throws PartnerException { String[] orderInfo = BillingAPI.billingCall( "yingyonghui2_get_order", new String[] { "id", String.valueOf(accountID), "money", String.valueOf(money), "gamecode", BillingAPI.chargeCode, "channel", channel, "partition", BillingAPI.getPartition() }); return orderInfo[0]; }
public static String[] login(String ticket, String model, String version) throws PartnerException { String[] userInfo = BillingAPI.billingCall( "yingyonghui2_login", new String[] { "gamecode", BillingAPI.chargeCode, "ticket", ticket, "partition", BillingAPI.getPartition() }, true); String accountName = PartnerAPI.PREFIX_YINGYONGHUI2 + userInfo[0]; if (!PartnerAPI.registerPartnerAccount(accountName, model, version)) { throw new PartnerException(PartnerMessage.FATAL_ERROR); } return new String[] {accountName, PartnerAPI.DEFAULT_PASS}; }
/** * 生成订单。 * * @param accountID 账号ID * @param money 充值金额(分) * @param channel 用户渠道号 * @return 订单ID和订单通知地址 * @throws PartnerException */ public static String getOrder(int accountID, int money, String channel, String clientId) throws PartnerException { String[] orderInfo = BillingAPI.billingCall( "unicom_get_order", new String[] { "id", String.valueOf(accountID), "money", String.valueOf(money), "gamecode", BillingAPI.chargeCode, "channel", channel, "partition", BillingAPI.getPartition(), "clientId", clientId }); return orderInfo[0] + "\n" + orderInfo[1]; }