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); }
public RefundRequestBuilder(PaymentRefundDataDto paymentRefundData) { _PaymentRefundDataDto = paymentRefundData; }
public OrderDetailsResponseSentToMerchant DoRefund(EnumEnvironment environment, PaymentRefundDataDto paymentRefundData) { string url = GenericUtility.GetRefundURL(environment, paymentRefundData.AggPaymentId); var orderDetailsResponse = this.apiClient.DoRefundAtRapidPay(paymentRefundData, url); return(orderDetailsResponse); }