智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/54/54bf88152860b6410b77539b449...

30 lines
759 B

import {
invoke
} from '../../bridge'
export function requestPayment (params, callbackId) {
const provider = params.provider
plus.payment.getChannels(services => {
const service = services.find(({
id
}) => id === provider)
if (!service) {
invoke(callbackId, {
errMsg: 'requestPayment:fail:支付服务[' + provider + ']不存在'
})
} else {
plus.payment.request(service, params.orderInfo, res => {
res.errMsg = 'requestPayment:ok'
invoke(callbackId, res)
}, err => {
invoke(callbackId, {
errMsg: 'requestPayment:fail:' + err.message
})
})
}
}, err => {
invoke(callbackId, {
errMsg: 'requestPayment:fail:' + err.message
})
})
}