Beispiel #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));
        }
Beispiel #2
0
 //Invoke the Capture method with Provider Credit
 public CaptureResponse CaptureActionWithProviderCredit(AuthorizeResponse authResponse, string orderAmount, string providerId, string creditAmount)
 {
     return(CaptureSample.CaptureAction(propertiesCollection, service, authResponse.AuthorizeResult.AuthorizationDetails.AmazonAuthorizationId, orderAmount, orderReferenceId, 0, providerId, creditAmount));
 }
 //Invoke the Capture method.
 public CaptureResponse CaptureAction(AuthorizeResponse authResponse, string orderAmount)
 {
     return(CaptureSample.CaptureAction(propertiesCollection, service, authResponse.AuthorizeResult.AuthorizationDetails.AmazonAuthorizationId, orderAmount, orderReferenceId, 0, null, null));
 }
 //Invoke the Capture method
 public CaptureResponse Capture(AuthorizeOnBillingAgreementResponse authResponse, string captureAmount, int indicator)
 {
     return(CaptureSample.CaptureAction(propertiesCollection, service, authResponse.AuthorizeOnBillingAgreementResult.AuthorizationDetails.AmazonAuthorizationId, captureAmount, billingAgreementId, indicator, null, null));
 }