Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v3新商户,只有公钥。没有公钥证书,会导致publicKey为空。 #3738

@liquanyu123

Description

@liquanyu123
Image

这是我的config

@bean
@ConditionalOnMissingBean
public WxPayService wxService() {
WxPayConfig payConfig = new WxPayConfig();
payConfig.setAppId(StringUtils.trimToNull(this.properties.getAppId()));//V3商户模式需要
payConfig.setMchId(StringUtils.trimToNull(this.properties.getMchId()));//V3商户模式需要
payConfig.setMchKey(StringUtils.trimToNull(this.properties.getMchKey()));
payConfig.setKeyPath(StringUtils.trimToNull(this.properties.getKeyPath()));
payConfig.setApiV3Key(StringUtils.trimToNull(this.properties.getApiV3Key()));//V3商户模式需要
payConfig.setCertSerialNo(StringUtils.trimToNull(this.properties.getCertSerialNo()));//V3商户模式需要
payConfig.setPrivateCertPath(StringUtils.trimToNull(this.properties.getPrivateCertPath()));//V3商户模式需要
payConfig.setPrivateKeyPath(StringUtils.trimToNull(this.properties.getPrivateKeyPath()));//V3商户模式需要
payConfig.setPublicKeyId(StringUtils.trimToNull(this.properties.getPublicKeyId()));//V3商户模式需要

payConfig.setFullPublicKeyModel(true);
payConfig.setStrictlyNeedWechatPaySerial(true);


WxPayService wxPayService = new WxPayServiceImpl();
wxPayService.setConfig(payConfig);
return wxPayService;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions