feat: add payment

This commit is contained in:
imeepos
2025-09-28 11:34:51 +08:00
parent be24e28fc4
commit 3322bdda7f
7 changed files with 80 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
import { useServerSdk } from "../../hooks";
import { Payment } from "../types/payment";
export class H5Payment extends Payment {
async pay(templateCode: string, imageUrl: string) {
const sdk = useServerSdk()
const response = await sdk.payTemplateCode(templateCode, imageUrl)
if (response.url) {
window.location.href = response.url;
}
throw new Error(`payment error: ${response}`)
}
}