Code Monkey home page Code Monkey logo

Comments (6)

egzosn avatar egzosn commented on August 31, 2024

文档没有说明nonce_str 是转账支付完成之后返回参数吧,你在进行查询的时候返回什么异常信息,能否提供一下,或者能否说下你是怎么进行矫正的

from pay-java-parent.

99246255 avatar 99246255 commented on August 31, 2024

文档没有说明nonce_str 是转账支付完成之后返回参数吧,你在进行查询的时候返回什么异常信息,能否提供一下,或者能否说下你是怎么进行矫正的
service.transferQuery("XXXX", WxTransferType.GETTRANSFERINFO.name());
后来看了下好像确实这个参数可以是随机的,但是缺少appId

from pay-java-parent.

egzosn avatar egzosn commented on August 31, 2024

你在配置的时候没有设置appid嘛,
图片

from pay-java-parent.

99246255 avatar 99246255 commented on August 31, 2024

你在配置的时候没有设置appid嘛,
图片

单元测试如下


public static void main(String[] args) {
			WxPayConfigStorage wxPayConfigStorage = new WxPayConfigStorage();
			wxPayConfigStorage.setMchId("XXX");
			wxPayConfigStorage.setAppid("XXX");
			wxPayConfigStorage.setKeyPrivate("XXX");
			wxPayConfigStorage.setKeyPublic("XXX");
			wxPayConfigStorage.setPayType("wxPay");
			wxPayConfigStorage.setSignType("MD5");
			wxPayConfigStorage.setInputCharset("utf-8");

			HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
			httpConfigStorage.setStorePassword("XX");
			String certPath = "XXX";
			httpConfigStorage.setKeystore(certPath);
			//设置ssl证书对应的存储方式输入流,这里默认为文件地址
			httpConfigStorage.setCertStoreType(CertStoreType.PATH);

                        // 有问题的
			WxPayService service = new WxPayService(wxPayConfigStorage, httpConfigStorage);
			Map<String, Object> map = service.transferQuery("XXX", WxTransferType.GETTRANSFERINFO.name());

                        //  没有问题的方式
                        Map<String, Object> parameters = new TreeMap();
			WxPayConfigStorage payConfigStorage = service.getPayConfigStorage();
			parameters.put("appid", payConfigStorage.getAppid());
			parameters.put("mch_id", payConfigStorage.getPid());
			parameters.put("partner_trade_no", "XXX");
			parameters.put("nonce_str", SignUtils.randomStr());
			parameters.put("sign", service.createSign(SignUtils.parameterText(parameters, "&", new String[]{"sign"}), payConfigStorage.getInputCharset()));
			map = (Map) service.getHttpRequestTemplate().postForObject(service.getReqUrl(WxTransferType.GETTRANSFERINFO), XML.getMap2Xml(parameters), JSONObject.class, new Object[0]);
	}

from pay-java-parent.

egzosn avatar egzosn commented on August 31, 2024

对不住,只实现了转账到卡的实现

from pay-java-parent.

egzosn avatar egzosn commented on August 31, 2024

之前已经修复,关闭

from pay-java-parent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.