public OrderDetailsResponseSentToMerchant DoOrderInquiryAtRapidPay(string url, int MerchantId, string MerchantAccessCode) { OrderDetailsResponseSentToMerchant orderInquiryResponse = null; string xVerifyResponse = String.Empty; try { using (HttpClient client = new HttpClient()) { System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; orderInquiryResponse = CoreApiClient.DoGetAsync <HttpClient, OrderDetailsResponseSentToMerchant>(client, url, MerchantId.ToString(), MerchantAccessCode, xVerifyResponse).Result; orderInquiryResponse.CustomHeader = xVerifyResponse; } } catch (HttpRequestException httpRequestEx) { } catch (Exception ex) { } return(orderInquiryResponse); }
public OrderDetailsResponseSentToMerchant DoRefundAtRapidPay(PaymentRefundDataDto paymentRefundData, string url) { OrderDetailsResponseSentToMerchant rapidPayRefundResponseDto = null; try { using (HttpClient client = new HttpClient()) { System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(string.Format("{0}:{1}", paymentRefundData.MerchantId, paymentRefundData.MerchantAccessCode)))); rapidPayRefundResponseDto = CoreApiClient.DoPostRequestJsonAsync <HttpClient, PaymentRefundDataDto, OrderDetailsResponseSentToMerchant>(client, url, paymentRefundData).Result; } } catch (HttpRequestException httpRequestEx) { } catch (Exception ex) { } return(rapidPayRefundResponseDto); }