更新充值支付接口
This commit is contained in:
@@ -15,11 +15,9 @@ import {RadioGroup} from '@/components/ui/radio-group'
|
||||
import Image from 'next/image'
|
||||
import {zodResolver} from '@hookform/resolvers/zod'
|
||||
import {toast} from 'sonner'
|
||||
import wechat from '@/components/composites/purchase/_assets/wechat.svg'
|
||||
import alipay from '@/components/composites/purchase/_assets/alipay.svg'
|
||||
import {useEffect, useMemo, useRef, useState} from 'react'
|
||||
import {Loader} from 'lucide-react'
|
||||
import {RechargeByPay, RechargeByAlipayConfirm, RechargeByWechat, RechargeByWechatConfirm} from '@/actions/user'
|
||||
import {RechargeComplete, RechargePrepare} from '@/actions/user'
|
||||
import * as qrcode from 'qrcode'
|
||||
import {useProfileStore} from '@/app/stores'
|
||||
import {merge} from '@/lib/utils'
|
||||
@@ -103,12 +101,7 @@ export default function RechargeModal(props: RechargeModelProps) {
|
||||
}
|
||||
console.log(resp, 'resp')
|
||||
|
||||
// const result = await RechargeByPay({
|
||||
// amount: data.amount.toString(),
|
||||
// platform: platform,
|
||||
// method: parseInt(paymentMethod[0]) as PaymentMethod,
|
||||
// })
|
||||
const result = await RechargeByPay(resp)
|
||||
const result = await RechargePrepare(resp)
|
||||
console.log(result, 'result')
|
||||
|
||||
if (result.success) {
|
||||
@@ -136,7 +129,7 @@ export default function RechargeModal(props: RechargeModelProps) {
|
||||
try {
|
||||
switch (method) {
|
||||
case 'alipay':
|
||||
const aliRes = await RechargeByAlipayConfirm({
|
||||
const aliRes = await RechargeComplete({
|
||||
trade_no: payInfo.trade_no,
|
||||
})
|
||||
if (!aliRes.success) {
|
||||
@@ -144,7 +137,7 @@ export default function RechargeModal(props: RechargeModelProps) {
|
||||
}
|
||||
break
|
||||
case 'wechat':
|
||||
const weRes = await RechargeByWechatConfirm({
|
||||
const weRes = await RechargeComplete({
|
||||
trade_no: payInfo.trade_no,
|
||||
})
|
||||
if (!weRes.success) {
|
||||
|
||||
Reference in New Issue
Block a user