public PayResponseData GetPay(PayRequestHeader payRequestHeader, PayRequestBody payRequestBody) { var client = new RestClient(OpenAPI.Payments.EWallets.Pay(_remoteServiceBaseUrl)) { Timeout = -1 }; var request = new RestRequest(Method.POST); request.AddHeader("content-type", payRequestHeader.ContentType); request.AddHeader("resourceOwnerId", payRequestHeader.ResourceOwnerId); request.AddHeader("requestUId", payRequestHeader.RequestUId); request.AddHeader("authorization", payRequestHeader.Authorization); request.AddHeader("accept-language", payRequestHeader.AcceptLanguage); request.AddJsonBody(JsonConvert.SerializeObject(payRequestBody)); IRestResponse response = client.Execute(request); var responseContent = JsonConvert.DeserializeObject <PayResponseData>(response.Content); var responseJsonString = JsonConvert.DeserializeObject(response.Content); var results = responseContent; results.jsonString = responseJsonString; return(results); }
/// <summary> /// This endpoint supports QR code generation from the merchant end of Alipay and WeChatPay for consumers to scan and pay (B scan C). /// </summary> /// <param name="payRequestHeader">Request Header</param> /// <param name="payRequestBody">Request Body</param> /// <returns>The merchant end of Alipay and WeChatPay for consumers to scan and pay (B scan C)</returns> public async Task <PayResponseData> GetPayAsync(PayRequestHeader payRequestHeader, PayRequestBody payRequestBody) { return(await _eWalletsService.GetPayAsync(payRequestHeader, payRequestBody)); }
/// <summary> /// This endpoint supports QR code generation from the merchant end of Alipay and WeChatPay for consumers to scan and pay (B scan C). /// </summary> /// <param name="payRequestHeader">Request Header</param> /// <param name="payRequestBody">Request Body</param> /// <returns>The merchant end of Alipay and WeChatPay for consumers to scan and pay (B scan C)</returns> public PayResponseData GetPay(PayRequestHeader payRequestHeader, PayRequestBody payRequestBody) { return(_eWalletsService.GetPay(payRequestHeader, payRequestBody)); }