123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- /**
- * 这是支付相关的业务逻辑的服务
- */
- export default class PayService {
- constructor(AjaxService) {
- Object.assign(this, { AjaxService })
- this.name = 'PayService'
- }
- /* 小程序支付-查询线上支付开关状态 */
- PayOrderOnLineSwitch (data = {}) {
- return this.AjaxService.get({
- url:'/order/pay/online/switch',
- data,
- isLoading: false ,
-
- })
- }
- /* 根据主订单查询子订单信息 */
- PayOrderShoporders (data = {}) {
- return this.AjaxService.get({
- url:'/order/pay/shoporders',
- data,
- isLoading: true ,
-
- })
- }
- /* 小程序支付-初始化收银台 */
- PayOrderCheckoutCounter (data = {}) {
- return this.AjaxService.get({
- url:'/order/pay/checkout/counter',
- data,
- isLoading: true ,
-
- })
- }
- /* 小程序支付-初始化子订单收银台 shopOrderId*/
- PayOrderCheckoutShoporders (data = {}) {
- return this.AjaxService.get({
- url:'/order/pay/checkout/shoporders',
- data,
- isLoading: true ,
-
- })
- }
- /**
- *小程序支付-米花微信支付
- *@param amount支付金额,单位分,必须大于2
- *@param payWay银联:UNIONPAY,微信:WEIXIN,支付宝:ALIPAY
- *@param payType 微信小程序支付: MINIAPP_WEIXIN ,微信公众号支付: JSAPI_WEIXIN
- *@param code 微信小程序code,微信小程序支付使用
- *@param orderId 主订单ID
- */
- WeChatMiniWxPay (data = {}) {
- return this.AjaxService.post({
- url:'/order/pay/wechat',
- data,
- isLoading: true ,
- loadText:'请求支付中...'
- })
- }
- /**
- *小程序支付-合利宝微信支付
- *@param amount支付金额,单位分,必须大于2
- *@param payWay银联:UNIONPAY,微信:WEIXIN,支付宝:ALIPAY
- *@param payType 微信小程序支付: MINIAPP_WEIXIN ,微信公众号支付: JSAPI_WEIXIN
- *@param code 微信小程序code,微信小程序支付使用
- *@param orderId 主订单ID
- */
- WeChatScanMiniWxPay (data = {}) {
- console.log('合利宝微信支付')
- return this.AjaxService.post({
- url:'/order/pay/online',
- data,
- isLoading: true ,
- loadText:'请求支付中...'
- })
- }
- /**
- *小程序支付-微信支付
- *@param payWay银联:UNIONPAY,微信:WEIXIN,支付宝:ALIPAY
- *@param payType 微信小程序支付: MINIAPP_WEIXIN ,微信公众号支付: JSAPI_WEIXIN
- *@param code 微信小程序code,微信小程序支付使用
- *@param userId 用户Id
- *@param couponId 优惠券Id
- */
- WeChatCouponMiniWxPay (data = {}) {
- return this.AjaxService.post({
- url:'/order/pay/coupon/wechat',
- data,
- isLoading: true ,
- loadText:'请求支付中...'
- })
- }
- /**
- *购买优惠券生成记录Id
- *@param userId 用户Id
- *@param couponId 优惠券Id
- */
- WeChatCouponRecord (data = {}) {
- return this.AjaxService.post({
- url:'/order/pay/coupon/record',
- data,
- isLoading: false ,
- })
- }
- /**
- *生成支付链接
- *@param unpaidAmount 本次待付款金额
- *@param orderId 主订单ID
- */
- PayOrderPayLink (data = {}) {
- return this.AjaxService.post({
- url:'/order/pay/link',
- data, isLoading: true ,
-
- })
- }
- /**
- *@param 二手发布支付
- *@param orderId 主订单ID
- */
- SecondHandPay (data = {}) {
- return this.AjaxService.post({
- url:'/order/pay/second/wechat',
- data,
- isLoading: true ,
-
- })
- }
- /**
- *@param 采美豆抵扣开通超级会员
- *@param orderId 主订单ID
- */
- getUserRegisterSuperBeans (data = {}) {
- return this.AjaxService.get({
- url:'/user/register/super/beans',
- data,
- isLoading: true ,
-
- })
- }
- /**
- *@在线支付开通超级会员
- */
- getUserRegisterSuperPay (data = {}) {
- return this.AjaxService.get({
- url:'/user/register/super/pay',
- data,
- isLoading: true,
-
- })
- }
- /**
- *@param 微信支付开通超级会员
- *@param vipId 套餐ID
- *@param userId 用户D
- *@param code wechatCode
- */
- PayOrderVipWechat (data = {}) {
- return this.AjaxService.post({
- url:'/order/pay/vip/wechat',
- data,
- isLoading: true ,
-
- })
- }
- /**
- *@param 订单支付大额网银转账
- *@param payAmount 转账金额
- *@param orderId 订单ID
- */
- PayOrderTransferUnion (data = {}) {
- return this.AjaxService.post({
- url:'/order/pay/transfer/union',
- data,
- isLoading: true ,
-
- })
- }
- /**
- *@param 校验是否网银转账成功
- *@param mbOrderId 交易订单号
- */
- PayOrderFindOrderStatus (data = {}) {
- return this.AjaxService.get({
- url:'/order/pay/result/json',
- data,
- isLoading: true ,
-
- })
- }
- }
|