public static PtsV2PaymentsVoidsPost201Response Run() { var id = CapturePayment.Run().Id; string clientReferenceInformationCode = "test_void"; Ptsv2paymentsidreversalsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsidreversalsClientReferenceInformation( Code: clientReferenceInformationCode ); var requestObj = new VoidCaptureRequest( ClientReferenceInformation: clientReferenceInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new VoidApi(clientConfig); PtsV2PaymentsVoidsPost201Response result = apiInstance.VoidCapture(requestObj, id); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsVoidsPost201Response Run() { AuthorizationCaptureForTimeoutVoidFlow.Run(); string clientReferenceInformationTransactionId = SampleCode.TimeoutVoidTransactionId; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( TransactionId: clientReferenceInformationTransactionId ); var requestObj = new MitVoidRequest( ClientReferenceInformation: clientReferenceInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new VoidApi(clientConfig); PtsV2PaymentsVoidsPost201Response result = apiInstance.MitVoid(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }