package com.yidianling.ydlcommon.custom.pay

import com.tencent.mm.opensdk.openapi.IWXAPI
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.yidianling.ydlcommon.core.base.BaseApplication


/**
 * 微信支付接口自定义工厂
 * Created by zqk on 17-9-12.
 */
object YdlWXAPIFactory {
    fun createWXAPI(): IWXAPI {
        val msgApi = WXAPIFactory.createWXAPI(BaseApplication.getApp(), null)
        val packageName = BaseApplication.getApp().packageName
        when {
            packageName.endsWith("yidianling") -> msgApi.registerApp("wx57a9d930270498c7")
            packageName.endsWith("yidianling_atk_3") -> msgApi.registerApp("wx306289ecfe20f6ae")
            packageName.endsWith("yidianling_atk4") -> msgApi.registerApp("wx82d801f5762fc66d")
            packageName.endsWith("yidianling_atk5") -> msgApi.registerApp("wxf95b97fc0d11ae5e")
            packageName.endsWith("yidianling_atk6") -> msgApi.registerApp("wx7fe55ba2ae53c047")
            packageName.endsWith("yidianling_atk7") -> msgApi.registerApp("wx35596e07c394b2ed")
            packageName.endsWith("xinlizixun") -> msgApi.registerApp("wx1c6af5a11b5f531f")
        }
        return msgApi
    }
}