shinnosuke
2026-09-10 65b57875700bf42ebd17eafa01a265e5690ce271
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package com.talentcard.server.business.payment.huifu;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
 
@ConfigurationProperties(prefix = "app.payment.huifu")
public class HuifuPaymentProperties {
 
    private boolean enabled;
    private String environment = "test";
    private String systemId = "";
    private String productId = "";
    private String merchantId = "";
    private String miniProgramAppId = "";
    private String privateKey = "";
    private String platformPublicKey = "";
    private String notifyUrl = "";
    private String withdrawalProductId = "";
    private String withdrawalNotifyUrl = "";
    private String merchantBusinessNotifyUrl = "";
    private String merchantOnboardingNotifyUrl = "";
    private String merchantWechatConfigNotifyUrl = "";
    private String merchantBusinessOpenNotifyUrl = "";
    private String onboardingUpperHuifuId = "";
    private String merchantWechatFeeRate = "0.60";
    private String merchantOnlineBusinessType = "H5311L";
    private String merchantOnlineMediaName = "东区人才卡";
    private String merchantAgreementUrl = "https://cloudpnrcdn.oss-cn-shanghai.aliyuncs.com/opps/api/prod/download_file/PaymentServiceAgreement.htm";
    private String withdrawalIntoAccountDateType = "DM";
    private boolean delayAccount;
 
    public boolean isEnabled() { return enabled; }
    public void setEnabled(boolean enabled) { this.enabled = enabled; }
    public String getEnvironment() { return environment; }
    public void setEnvironment(String environment) { this.environment = environment; }
    public String getSystemId() { return systemId; }
    public void setSystemId(String systemId) { this.systemId = systemId; }
    public String getProductId() { return productId; }
    public void setProductId(String productId) { this.productId = productId; }
    public String getMerchantId() { return merchantId; }
    public void setMerchantId(String merchantId) { this.merchantId = merchantId; }
    public String getMiniProgramAppId() { return miniProgramAppId; }
    public void setMiniProgramAppId(String miniProgramAppId) { this.miniProgramAppId = miniProgramAppId; }
    public String getPrivateKey() { return privateKey; }
    public void setPrivateKey(String privateKey) { this.privateKey = privateKey; }
    public String getPlatformPublicKey() { return platformPublicKey; }
    public void setPlatformPublicKey(String platformPublicKey) { this.platformPublicKey = platformPublicKey; }
    public String getNotifyUrl() { return notifyUrl; }
    public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; }
    public String getWithdrawalProductId() { return withdrawalProductId; }
    public void setWithdrawalProductId(String withdrawalProductId) { this.withdrawalProductId = withdrawalProductId; }
    public String getWithdrawalNotifyUrl() { return withdrawalNotifyUrl; }
    public void setWithdrawalNotifyUrl(String withdrawalNotifyUrl) { this.withdrawalNotifyUrl = withdrawalNotifyUrl; }
    public String getMerchantBusinessNotifyUrl() {
        if (merchantBusinessNotifyUrl != null && !merchantBusinessNotifyUrl.isBlank()) return merchantBusinessNotifyUrl;
        return withdrawalNotifyUrl == null ? "" : withdrawalNotifyUrl.replace("/withdrawal-notify", "/merchant-business-notify");
    }
    public void setMerchantBusinessNotifyUrl(String merchantBusinessNotifyUrl) { this.merchantBusinessNotifyUrl = merchantBusinessNotifyUrl; }
    public String getMerchantOnboardingNotifyUrl() {
        if (merchantOnboardingNotifyUrl != null && !merchantOnboardingNotifyUrl.isBlank()) return merchantOnboardingNotifyUrl;
        return withdrawalNotifyUrl == null ? "" : withdrawalNotifyUrl.replace("/withdrawal-notify", "/merchant-onboarding-notify");
    }
    public void setMerchantOnboardingNotifyUrl(String merchantOnboardingNotifyUrl) { this.merchantOnboardingNotifyUrl = merchantOnboardingNotifyUrl; }
    public String getMerchantWechatConfigNotifyUrl() {
        if (merchantWechatConfigNotifyUrl != null && !merchantWechatConfigNotifyUrl.isBlank()) return merchantWechatConfigNotifyUrl;
        return callbackUrl("merchant-wechat-config-notify");
    }
    public void setMerchantWechatConfigNotifyUrl(String merchantWechatConfigNotifyUrl) { this.merchantWechatConfigNotifyUrl = merchantWechatConfigNotifyUrl; }
    public String getMerchantBusinessOpenNotifyUrl() {
        if (merchantBusinessOpenNotifyUrl != null && !merchantBusinessOpenNotifyUrl.isBlank()) return merchantBusinessOpenNotifyUrl;
        return callbackUrl("merchant-business-open-notify");
    }
    public void setMerchantBusinessOpenNotifyUrl(String merchantBusinessOpenNotifyUrl) { this.merchantBusinessOpenNotifyUrl = merchantBusinessOpenNotifyUrl; }
    public String getOnboardingUpperHuifuId() {
        if (onboardingUpperHuifuId != null && !onboardingUpperHuifuId.isBlank()) return onboardingUpperHuifuId;
        return merchantId;
    }
    public void setOnboardingUpperHuifuId(String onboardingUpperHuifuId) { this.onboardingUpperHuifuId = onboardingUpperHuifuId; }
    public String getMerchantWechatFeeRate() { return merchantWechatFeeRate; }
    public void setMerchantWechatFeeRate(String merchantWechatFeeRate) { this.merchantWechatFeeRate = merchantWechatFeeRate; }
    public String getMerchantOnlineBusinessType() { return merchantOnlineBusinessType; }
    public void setMerchantOnlineBusinessType(String merchantOnlineBusinessType) { this.merchantOnlineBusinessType = merchantOnlineBusinessType; }
    public String getMerchantOnlineMediaName() { return merchantOnlineMediaName; }
    public void setMerchantOnlineMediaName(String merchantOnlineMediaName) { this.merchantOnlineMediaName = merchantOnlineMediaName; }
    public String getMerchantAgreementUrl() { return merchantAgreementUrl; }
    public void setMerchantAgreementUrl(String merchantAgreementUrl) { this.merchantAgreementUrl = merchantAgreementUrl; }
    public String getWithdrawalIntoAccountDateType() { return withdrawalIntoAccountDateType; }
    public void setWithdrawalIntoAccountDateType(String withdrawalIntoAccountDateType) { this.withdrawalIntoAccountDateType = withdrawalIntoAccountDateType; }
    public boolean isDelayAccount() { return delayAccount; }
    public void setDelayAccount(boolean delayAccount) { this.delayAccount = delayAccount; }
 
    private String callbackUrl(String endpoint) {
        if (withdrawalNotifyUrl == null || withdrawalNotifyUrl.isBlank()) return "";
        int slash = withdrawalNotifyUrl.lastIndexOf('/');
        return slash < 0 ? "" : withdrawalNotifyUrl.substring(0, slash + 1) + endpoint;
    }
}