uni.login and the WeChat phone-number authorization API during sign-in.openid, and issues a talent access session.openid.POST /v3/trade/payment/jspay with trade_type=T_MINIAPP.pay_info; the client receives its appId, timeStamp, nonceStr, package, signType, and paySign fields and calls uni.requestPayment.resp_data and sign to the callback URL. The server verifies the original resp_data with SHA256WithRSA.POST /api/app/pending-orders/{orderNo}/paymentAuthorization: Bearer {talentAccessToken} and requires the session talent to equal the body talentId.X-Idempotency-Key (required, 1-128 characters){ "talentId": 1, "priceVersion": 1 }paymentNo, paymentStatus, and provider paymentParams.GET /api/app/pending-orders/{orderNo}/payment?talentId={id}&paymentNo={paymentNo}NOT_STARTED, PAYMENT_PENDING, PAYMENT_CREATE_FAILED, or PAID.POST /api/payments/huifu/notifyapplication/x-www-form-urlencoded data with resp_data and sign.RECV_ORD_ID_{req_seq_id}.POST /api/app/auth/login{ "wechatCode": "...", "phoneCode": "...", "agreementVersion": "v1", "agreedAt": 0 }.talentId, accessToken, refreshToken, and expireAt.POST /api/app/auth/refreshThe legacy /pay endpoint now rejects calls so a client cannot convert an order to paid state without a verified payment result.
Store these values in the deployment secret manager and expose them as environment variables. Do not add keys to application.yml.
HUIFU_ENABLED=true
HUIFU_ENVIRONMENT=test|prod
HUIFU_SYSTEM_ID=... # sys_id from Huifu provisioning
HUIFU_PRODUCT_ID=... # product_id from Huifu provisioning
HUIFU_MERCHANT_ID=...
HUIFU_MINI_PROGRAM_APP_ID=...
HUIFU_PRIVATE_KEY=...
HUIFU_PLATFORM_PUBLIC_KEY=...
HUIFU_NOTIFY_URL=https://api.example.com/api/payments/huifu/notify
HUIFU_DELAY_ACCOUNT=false # Enable only after delayed-transaction confirmation is implemented.
WECHAT_MINI_PROGRAM_APP_ID=... # Usually the same app id used by the Huifu mini-program product.
WECHAT_MINI_PROGRAM_APP_SECRET=... # WeChat Mini Program AppSecret, from the WeChat admin console.
The callback address must be publicly reachable over HTTPS. Configure the same address with Huifu. Enable the provider only after the Huifu product, merchant, mini-program relationship, signing keys and callback reachability have been verified in the sandbox.
WECHAT_MINI_PROGRAM_APP_SECRET on the server process. Do not put it in the client or commit it to source control.talent_session; verify GET /actuator/health is UP.talent_user.payment_transaction and the app opens the native WeChat payment sheet.select payment_no, status, amount, provider_transaction_no, paid_at
from payment_transaction order by id desc;
select provider_request_no, signature_valid, process_status, received_at
from payment_callback_event order by id desc;
Expected successful values: transaction SUCCEEDED; callback signature_valid = 1, process_status = PROCESSED; corresponding benefit_order.order_status = 1.
The server records verified callback audit events, then uses the provider query API as a second confirmation path for payments and refunds that remain pending. It never converts an order to paid from a client request or a local timer result alone.
Set these values only after sandbox verification. The scheduler is deliberately off by default so a local startup does not call the real provider:
HUIFU_RECONCILIATION_ENABLED=true
HUIFU_RECONCILIATION_FIXED_DELAY_MS=300000
HUIFU_RECONCILIATION_PENDING_AFTER_MINUTES=5
The scheduler checks up to 100 old pending payments and 100 old pending refunds per run. It writes non-sensitive exceptions to payment_reconciliation_issue: pending timeout, provider-declared failure, and query failure. It does not store callback bodies, signatures, OpenID values, card numbers, or keys.
Administrators can use Payment reconciliation in the management console to inspect open issues, run a one-off check, and mark a confirmed issue as resolved or ignored. Marking a row resolved does not alter payment or refund state; it is an audit action only.
HUIFU_NOTIFY_URL as a public HTTPS URL in both deployment configuration and the Huifu console. Confirm that the ingress/WAF permits POST /api/payments/huifu/notify with form data and does not rewrite resp_data or sign.payment_transaction.status = SUCCEEDED, a callback event with signature_valid = 1, and benefit_order.order_status = 1.order_refund.refund_status = 2.