示例#1
0
        // 获取公钥
        public async Task <PayPublicKey> GetPublicKey()
        {
            var req = new WeChatPayRiskGetPublicKeyRequest();
            var res = await client.ExecuteAsync(req, options.Value);

            return(new PayPublicKey
            {
                MchId = res.MchId,
                PubKey = res.PubKey
            });
        }
示例#2
0
        public async Task <IActionResult> GetPublicKey()
        {
            if (Request.Method == "POST")
            {
                var request  = new WeChatPayRiskGetPublicKeyRequest();
                var response = await _client.ExecuteAsync(request, _optionsAccessor.Value);

                return(Ok(response.Body));
            }

            return(Ok());
        }
示例#3
0
        // 获取公钥
        public async Task <WeChatPayRiskGetPublicKeyResponse> GetPublicKey()
        {
            var req = new WeChatPayRiskGetPublicKeyRequest();

            return(await client.ExecuteAsync(req, options.Value));
        }