public static GetCaptureDetailsResponse GetCaptureDetails(OffAmazonPaymentsServicePropertyCollection propertiesCollection,
                                                                  IOffAmazonPaymentsService service, string amazonCaptureId)
        {
            GetCaptureDetailsRequest getCaptureDetailsRequest = new GetCaptureDetailsRequest();

            getCaptureDetailsRequest.AmazonCaptureId = amazonCaptureId;
            getCaptureDetailsRequest.SellerId        = propertiesCollection.MerchantID;
            return(GetCaptureDetailsSample.InvokeGetCaptureDetails(service, getCaptureDetailsRequest));
        }
        public static ProviderCreditSummaryList CheckCaptureForProviderCreditSummaryList(string amazonCaptureId, OffAmazonPaymentsServicePropertyCollection propertiesCollection, IOffAmazonPaymentsService service)
        {
            //used to check if the ProviderCreditSummaryList is available
            TimeSpan startTime = DateTime.Now.TimeOfDay;
            GetCaptureDetailsResponse getCaptureDetailsResponse = GetCaptureDetailsSample.GetCaptureDetails(propertiesCollection, service, amazonCaptureId);

            while (getCaptureDetailsResponse.IsSetGetCaptureDetailsResult() && (!getCaptureDetailsResponse.GetCaptureDetailsResult.CaptureDetails.IsSetProviderCreditSummaryList() || getCaptureDetailsResponse.GetCaptureDetailsResult.CaptureDetails.ProviderCreditSummaryList.member.Count < 1))
            {
                if (DateTime.Now.TimeOfDay.Milliseconds - startTime.Milliseconds > 60000)
                {
                    throw new OffAmazonPaymentsServiceException("The ProviderCreditSummaryList not found.");
                }
                System.Threading.Thread.Sleep(8000);
                Console.WriteLine("Waiting until ProviderCreditSummaryList is found in GetCaptureDetailsResponse");
                getCaptureDetailsResponse = GetCaptureDetailsSample.GetCaptureDetails(propertiesCollection, service, amazonCaptureId);
            }
            return(getCaptureDetailsResponse.GetCaptureDetailsResult.CaptureDetails.ProviderCreditSummaryList);
        }
 //Invoke the GetCaptureDetails method
 public GetCaptureDetailsResponse GetCaptureDetails(CaptureResponse captureReponse)
 {
     return(GetCaptureDetailsSample.GetCaptureDetails(propertiesCollection, service, captureReponse.CaptureResult.CaptureDetails.AmazonCaptureId));
 }
Ejemplo n.º 4
0
 //Use a loop to check for the ProviderCreditSummaryList in the CaptureDetails. Once found, return it.
 public ProviderCreditSummaryList CheckCaptureForProviderCreditSummaryList(CaptureResponse captureResponse)
 {
     return(GetCaptureDetailsSample.CheckCaptureForProviderCreditSummaryList(captureResponse.CaptureResult.CaptureDetails.AmazonCaptureId, propertiesCollection, service));
 }