money.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. // c:\Users\zhu\Desktop\Practice Project\new-88live\features\mall\gateway\money.js
  2. // 支付相关接口
  3. import { get, post } from '@/core/http/http-client'
  4. import { buildRestPath } from '@/core/config/api-paths'
  5. /** 获取用户余额 */
  6. export async function getBalance() {
  7. const { data } = await post(buildRestPath('pay/getBalance'))
  8. return data
  9. }
  10. /** 获取支付信息 */
  11. export async function getPayInfo(params) {
  12. const { data } = await post(buildRestPath('pay/getPay'), params)
  13. return data
  14. }
  15. /** 发起支付 */
  16. export async function postPayment(params) {
  17. const { data } = await post(buildRestPath('pay/payment'), params)
  18. return data
  19. }
  20. /** 获取线下支付配置 */
  21. export async function getOfflinePaymentConfig() {
  22. const { data } = await get('/common/corporatepayment')
  23. return data
  24. }
  25. /** 获取PayZ支付方式列表 */
  26. export async function getPayZData() {
  27. const { data } = await get('/common/getpayzdata')
  28. return data
  29. }
  30. /** 获取钻石余额 */
  31. export async function getDiamondBalance() {
  32. const { data } = await get('/user/getdiamondnum')
  33. return data
  34. }
  35. /** 获取赏金余额 */
  36. export async function getTipWallet() {
  37. const { data } = await get('/user/gettipwallet')
  38. return data
  39. }
  40. /** 获取提现初始化数据 */
  41. export async function getWithdrawInit(type) {
  42. const { data } = await post(buildRestPath('pay/initialWithdraw'), { type })
  43. return data
  44. }
  45. /** 执行提现 */
  46. export async function postWithdraw(params) {
  47. const { data } = await post(buildRestPath('pay/withdraw'), params)
  48. return data
  49. }
  50. /** 获取提现记录 */
  51. export async function getWithdrawLog(params) {
  52. const { data } = await post(buildRestPath('pay/withdrawLog'), params)
  53. return data
  54. }
  55. /** 获取赏金明细列表 */
  56. export async function getTipWalletLog(params) {
  57. const { data } = await post(buildRestPath('tipwalletlog/list'), params)
  58. return data
  59. }
  60. /** 获取账单明细列表 */
  61. export async function getMoneyLog(params) {
  62. const { data } = await post(buildRestPath('pay/moneyLog'), params)
  63. return data
  64. }
  65. /** 获取银行卡列表 */
  66. export async function getBankList() {
  67. const { data } = await post(buildRestPath('pay/getPayAccount'))
  68. return data
  69. }
  70. /** 添加银行卡 */
  71. export async function addBankAccount(params) {
  72. const { data } = await post(buildRestPath('pay/addPayAccount'), params)
  73. return data
  74. }
  75. /** 删除银行卡 */
  76. export async function deleteBankAccount(ids) {
  77. const { data } = await get('/wanlshop/pay/delPayAccount', { ids })
  78. return data
  79. }
  80. /** 获取钻石充值套餐列表 */
  81. export async function getDiamondList(type) {
  82. const { data } = await get('/wanlshop/diamond/list', { type })
  83. return data
  84. }
  85. /** 获取钻石明细列表 */
  86. export async function getDiamondLog(params) {
  87. const { data } = await post('/wanlshop/diamondlog/list', params)
  88. return data
  89. }
  90. /** 钻石充值:获取支付信息 */
  91. export async function getDiamondRecharge(params) {
  92. const res = await post(buildRestPath('pay/recharge'), params)
  93. return res.data || {}
  94. }
  95. /** 钻石充值:通知服务器Google Play支付成功 */
  96. export async function notifyGooglePayPurchase(params) {
  97. return post('/wanlshop/callback/ingoogalpay', params)
  98. }
  99. /** 钻石充值:通知服务器Apple IAP购买成功 */
  100. export async function notifyAppleIAPPurchase(params) {
  101. return post('/wanlshop/callback/iniospay', params)
  102. }
  103. /** 获取关于/配置信息 */
  104. export async function getAboutConfig() {
  105. const { data } = await get('/wanlshop/common/about')
  106. return data
  107. }
  108. /** 上报错误日志 */
  109. export async function saveErrorLog(params) {
  110. return post('/index/saveerror', params)
  111. }
  112. /**
  113. * 获取Stripe支付配置
  114. * @returns {Promise<Object>} Stripe支付配置
  115. */
  116. export async function getStripePaymentConfig() {
  117. const response = await get('/common/gettripepayment')
  118. return response.data
  119. }