示例#1
0
        public static CaptureResponse CaptureAction(OffAmazonPaymentsServicePropertyCollection propertiesCollection,
                                                    IOffAmazonPaymentsService service, string amazonAuthorizationId, string orderAmount, string orderReferenceId, int indicator, string providerId, string creditAmountString)
        {
            //initiate the capture request
            CaptureRequest captureRequest = new CaptureRequest();

            captureRequest.SellerId = propertiesCollection.MerchantID;
            captureRequest.AmazonAuthorizationId = amazonAuthorizationId;

            Price price = new Price();

            price.Amount       = orderAmount;
            price.CurrencyCode = propertiesCollection.CurrencyCode;

            captureRequest.CaptureAmount      = price;
            captureRequest.CaptureReferenceId = orderReferenceId.Replace('-', 'c') + "captureRef" + indicator.ToString();
            if (!String.IsNullOrEmpty(providerId) && !String.IsNullOrEmpty(creditAmountString))
            {
                ProviderCredit providerCredit = new ProviderCredit();
                providerCredit.ProviderId = providerId;
                Price creditAmount = new Price();
                creditAmount.Amount         = creditAmountString;
                creditAmount.CurrencyCode   = propertiesCollection.CurrencyCode;
                providerCredit.CreditAmount = creditAmount;
                ProviderCreditList providerCreditList = new ProviderCreditList();
                providerCreditList.member = new List <ProviderCredit>();
                providerCreditList.member.Add(providerCredit);
                captureRequest.ProviderCreditList = providerCreditList;
            }

            return(CaptureSample.InvokeCapture(service, captureRequest));
        }
        public static CaptureResponse CaptureAction(OffAmazonPaymentsServicePropertyCollection propertiesCollection,
            IOffAmazonPaymentsService service, string amazonAuthorizationId, string orderAmount, string orderReferenceId, int indicator, string providerId, string creditAmountString)
        {
            //initiate the capture request
            CaptureRequest captureRequest = new CaptureRequest();
            captureRequest.SellerId = propertiesCollection.MerchantID;
            captureRequest.AmazonAuthorizationId = amazonAuthorizationId;

            Price price = new Price();
            price.Amount = orderAmount;
            price.CurrencyCode = propertiesCollection.CurrencyCode;

            captureRequest.CaptureAmount = price;
            captureRequest.CaptureReferenceId = orderReferenceId.Replace('-', 'c') + "captureRef" + indicator.ToString();
            if (!String.IsNullOrEmpty(providerId) && !String.IsNullOrEmpty(creditAmountString))
            {
                ProviderCredit providerCredit = new ProviderCredit();
                providerCredit.ProviderId= providerId;
                Price creditAmount = new Price();
                creditAmount.Amount = creditAmountString;
                creditAmount.CurrencyCode = propertiesCollection.CurrencyCode;
                providerCredit.CreditAmount= creditAmount;
                ProviderCreditList providerCreditList = new ProviderCreditList();
                providerCreditList.member = new List<ProviderCredit>();
                providerCreditList.member.Add(providerCredit);
                captureRequest.ProviderCreditList = providerCreditList;
            }

            return CaptureSample.InvokeCapture(service, captureRequest);
        }