public static PtsV2PaymentsVoidsPost201Response Run() { var id = RefundPayment.Run().Id; string clientReferenceInformationCode = "test_void"; Ptsv2paymentsidreversalsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsidreversalsClientReferenceInformation( Code: clientReferenceInformationCode ); var requestObj = new VoidRefundRequest( ClientReferenceInformation: clientReferenceInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new VoidApi(clientConfig); PtsV2PaymentsVoidsPost201Response result = apiInstance.VoidRefund(requestObj, id); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static void Run() { var refundPaymentId = RefundEcheckPayment.Run().Id; var clientReferenceInformationObj = new Ptsv2paymentsidreversalsClientReferenceInformation("test_refund_void"); var requestBody = new VoidRefundRequest(clientReferenceInformationObj); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new VoidApi(clientConfig); var result = apiInstance.VoidRefund(requestBody, refundPaymentId); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var clientReferenceInformationObj = new V2paymentsidreversalsClientReferenceInformation("test_void"); var requestBody = new VoidRefundRequest(clientReferenceInformationObj); var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/refunds/5335461889256917903529/voids", RequestJsonData = JsonConvert.SerializeObject(requestBody) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new VoidApi(configurationSwagger); var result = apiInstance.VoidRefund(requestBody, "5335461889256917903529"); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }