feat(payment): 虎皮椒聚合支付 - 官方插件与跨平台可执行文件
新增 xunhupay 官方包,支付 RPC 与宿主只保留订单和验签边界;官方支付包同时带上各系统 provider,避免把 Linux ELF 当成本机入口。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
23
web/src/components/payment-checkout-code.css
Normal file
23
web/src/components/payment-checkout-code.css
Normal file
@@ -0,0 +1,23 @@
|
||||
.payment-checkout-code {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
box-sizing: border-box;
|
||||
width: 232px;
|
||||
height: 232px;
|
||||
padding: 12px;
|
||||
border-radius: 16px;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.payment-checkout-code img,
|
||||
.payment-checkout-code canvas,
|
||||
.payment-checkout-code svg {
|
||||
display: block;
|
||||
width: 208px;
|
||||
height: 208px;
|
||||
}
|
||||
|
||||
.payment-checkout-code img {
|
||||
object-fit: contain;
|
||||
background: #ffffff;
|
||||
}
|
||||
24
web/src/components/payment-checkout-code.tsx
Normal file
24
web/src/components/payment-checkout-code.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { QRCode } from "antd";
|
||||
|
||||
import { isPaymentQrImageURL } from "@/lib/payment-checkout-code";
|
||||
|
||||
import "./payment-checkout-code.css";
|
||||
|
||||
const QR_SIZE = 208;
|
||||
const QR_DARK = "#111111";
|
||||
const QR_LIGHT = "#ffffff";
|
||||
|
||||
export function PaymentCheckoutCode({ value }: { value: string }) {
|
||||
if (isPaymentQrImageURL(value)) {
|
||||
return (
|
||||
<div className="payment-checkout-code">
|
||||
<img src={value} alt="支付二维码" width={QR_SIZE} height={QR_SIZE} referrerPolicy="no-referrer" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="payment-checkout-code">
|
||||
<QRCode value={value} size={QR_SIZE} bordered={false} color={QR_DARK} bgColor={QR_LIGHT} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user