Skip to content

simplepeng/EasyPay

Repository files navigation

EasyPay

fork from EasyPay,做了一些优化,迁移到jitpack

导入

使用

//支付宝
val aliPay = AliPay()
val alipayInfo = AlipayInfo()
alipayInfo.orderInfo = ""
EasyPay.pay(this, aliPay, alipayInfo, object : IPayCallback {
    override fun success() {
        showToast("支付成功")
    }

    override fun failed(code: Int, message: String?) {
        showToast("支付失败 -$code - $message")
    }

    override fun cancel() {
        showToast("支付取消")
    }
})
// 微信
val wxPay = WXPay.getInstance()
val wxPayInfo = WXPayInfo().apply {
    this.appId = ""
    this.partnerId = ""
    this.prepayId = ""
    this.packageValue = ""
    this.nonceStr = ""
    this.timestamp = ""
    this.sign = ""
}
EasyPay.pay(this, wxPay, wxPayInfo, object : IPayCallback {
    override fun success() {
        showToast("支付成功")
    }

    override fun failed(code: Int, message: String?) {
        showToast("支付失败 -$code - $message")
    }

    override fun cancel() {
        showToast("支付取消")
    }
})

更新

  • v1.0.0:首次上传

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors