Exemplo n.º 1
0
    public string DoCaptureCode(string authorization_id, string amount)
    {
        CallerServices caller = new CallerServices();

        IAPIProfile profile = ProfileFactory.createSSLAPIProfile();

        profile.APIUsername     = "******";
        profile.APIPassword     = "******";
        profile.CertificateFile = @"~\MyTestCertificate.txt";
        profile.Environment     = "sandbox";
        caller.APIProfile       = profile;

        DoCaptureRequestType pp_request = new DoCaptureRequestType();

        pp_request.Version = "51.0";

        pp_request.AuthorizationID   = authorization_id;
        pp_request.Amount            = new BasicAmountType();
        pp_request.Amount.Value      = amount;
        pp_request.Amount.currencyID = CurrencyCodeType.GBP;
        pp_request.CompleteType      = CompleteCodeType.Complete;

        DoCaptureResponseType pp_response = new DoCaptureResponseType();

        pp_response = (DoCaptureResponseType)caller.Call("DoCapture", pp_request);
        return(pp_response.Ack.ToString());
    }
Exemplo n.º 2
0
        public DoCaptureResponseType DoCapture(string authorizationId, string note, string value, CurrencyCodeType currencyId, string invoiceId)
        {
            DoCaptureRequestType pp_request = new DoCaptureRequestType();

            pp_request.AuthorizationID   = authorizationId;
            pp_request.Note              = note;
            pp_request.Amount            = new BasicAmountType();
            pp_request.Amount.Value      = value;
            pp_request.Amount.currencyID = currencyId;
            pp_request.InvoiceID         = invoiceId;
            return((DoCaptureResponseType)caller.Call("DoCapture", pp_request));
        }
        /// <summary>
        /// Captures an authorized payment.
        /// </summary>
        /// <para>
        /// See API doc here https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/DoCapture_API_Operation_SOAP/
        /// </para>
        /// <param name="orderGroup">The order group to process.</param>
        /// <param name="payment">The payment to process</param>
        /// <returns>return false and set the message will make the WorkFlow activity raise PaymentExcetion(message)</returns>
        private PaymentProcessingResult ProcessPaymentCapture(IOrderGroup orderGroup, IPayment payment)
        {
            // Implement refund feature logic for current payment gateway
            var captureAmount = payment.Amount;
            var purchaseOrder = orderGroup as IPurchaseOrder;

            if (purchaseOrder == null || captureAmount <= 0)
            {
                return(PaymentProcessingResult.CreateUnsuccessfulResult("Nothing to capture"));
            }

            var captureRequest = new DoCaptureRequestType
            {
                AuthorizationID = payment.TransactionID,                                               // original transactionID (which PayPal gave us when DoExpressCheckoutPayment, DoDirectPayment, or CheckOut)
                Amount          = _payPalAPIHelper.ToPayPalAmount(captureAmount, orderGroup.Currency), // if refund with Partial, we have to set the Amount
                CompleteType    = payment.Amount >= purchaseOrder.GetTotal().Amount ? CompleteCodeType.COMPLETE : CompleteCodeType.NOTCOMPLETE,
                InvoiceID       = purchaseOrder.OrderNumber
            };

            captureRequest.Note = $"[{payment.PaymentMethodName}-{payment.TransactionID}] captured {captureAmount}{captureRequest.Amount.currencyID} for [PurchaseOrder-{purchaseOrder.OrderNumber}]";

            var caller       = PayPalAPIHelper.GetPayPalAPICallerServices(_paymentMethodConfiguration);
            var doCaptureReq = new DoCaptureReq {
                DoCaptureRequest = captureRequest
            };
            var captureResponse = caller.DoCapture(doCaptureReq);

            var errorCheck = _payPalAPIHelper.CheckErrors(captureResponse);

            if (!string.IsNullOrEmpty(errorCheck))
            {
                _logger.Error(errorCheck);
                return(PaymentProcessingResult.CreateUnsuccessfulResult(PaymentTransactionFailedMessage));
            }

            var captureResponseDetails = captureResponse.DoCaptureResponseDetails;
            var paymentInfo            = captureResponseDetails.PaymentInfo;

            // Extract the response details.
            payment.ProviderTransactionID = paymentInfo.TransactionID;
            payment.Status = paymentInfo.PaymentStatus.ToString();

            var message = $"[{payment.PaymentMethodName}] [Capture payment-{paymentInfo.TransactionID}] [Status: {paymentInfo.PaymentStatus.ToString()}] " +
                          $".Response: {captureResponse.Ack.ToString()} at Timestamp={captureResponse.Timestamp.ToString()}: {paymentInfo.GrossAmount.value}{paymentInfo.GrossAmount.currencyID}";

            // add a new order note about this capture
            AddNoteToPurchaseOrder("CAPTURE", message, purchaseOrder.CustomerId, purchaseOrder);

            _orderRepository.Save(purchaseOrder);

            return(PaymentProcessingResult.CreateSuccessfulResult(message));
        }
Exemplo n.º 4
0
        public DoCaptureResponseType DoCapture(string authorizationId, string note, string value,
                                               CurrencyCodeType currencyId, string invoiceId)
        {
            var pp_request = new DoCaptureRequestType
            {
                AuthorizationID = authorizationId,
                Note            = note,
                Amount          = new BasicAmountType
                {
                    Value      = value,
                    currencyID = currencyId
                },
                InvoiceID = invoiceId
            };

            return((DoCaptureResponseType)caller.Call("DoCapture", pp_request));
        }
        /// <summary>
        /// The capture success.
        /// </summary>
        /// <param name="invoice">
        /// The invoice.
        /// </param>
        /// <param name="payment">
        /// The payment.
        /// </param>
        /// <param name="amount">
        /// The amount.
        /// </param>
        /// <param name="isPartialPayment">
        /// The is partial payment.
        /// </param>
        /// <returns>
        /// The <see cref="ExpressCheckoutResponse"/>.
        /// </returns>
        public PayPalExpressTransactionRecord Capture(IInvoice invoice, IPayment payment, decimal amount, bool isPartialPayment)
        {
            // Get the transaction record
            var record = payment.GetPayPalTransactionRecord();

            ExpressCheckoutResponse result = null;

            try
            {
                var amountFactory = new PayPalBasicAmountTypeFactory(PayPalApiHelper.GetPayPalCurrencyCode(invoice.CurrencyCode));

                var authorizationId = record.Data.AuthorizationTransactionId;

                // do express checkout
                var request = new DoCaptureRequestType()
                {
                    AuthorizationID = authorizationId,
                    Amount          = amountFactory.Build(amount),
                    CompleteType    = isPartialPayment ? CompleteCodeType.NOTCOMPLETE : CompleteCodeType.COMPLETE
                };

                var doCaptureReq = new DoCaptureReq()
                {
                    DoCaptureRequest = request
                };

                var service           = GetPayPalService();
                var doCaptureResponse = service.DoCapture(doCaptureReq);
                result = _responseFactory.Build(doCaptureResponse, record.Data.Token);

                if (result.Success())
                {
                    var transactionId = doCaptureResponse.DoCaptureResponseDetails.PaymentInfo.TransactionID;
                    record.Data.CaptureTransactionId = transactionId;
                }
            }
            catch (Exception ex)
            {
                result = _responseFactory.Build(ex);
            }

            record.DoCapture = result;
            record.Success   = result.Success();
            return(record);
        }
Exemplo n.º 6
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object

            DoCaptureRequestType request =
                new DoCaptureRequestType();

            request.AuthorizationID = authorizationId.Value;
            CurrencyCodeType currency = (CurrencyCodeType)
                                        Enum.Parse(typeof(CurrencyCodeType), currencyCode.SelectedValue);

            request.Amount = new BasicAmountType(currency, amount.Value);
            if (completeType.SelectedIndex != 0)
            {
                request.CompleteType = (CompleteCodeType)
                                       Enum.Parse(typeof(CompleteCodeType), completeType.SelectedValue);
            }
            if (note.Value != "")
            {
                request.Note = note.Value;
            }
            if (invoiceId.Value != "")
            {
                request.InvoiceID = invoiceId.Value;
            }
            if (softDescriptor.Value != "")
            {
                request.Descriptor = softDescriptor.Value;
            }

            // Invoke the API
            DoCaptureReq wrapper = new DoCaptureReq();

            wrapper.DoCaptureRequest = request;
            PayPalAPIInterfaceServiceService service           = new PayPalAPIInterfaceServiceService();
            DoCaptureResponseType            doCaptureResponse =
                service.DoCapture(wrapper);


            // Check for API return status
            setKeyResponseObjects(service, doCaptureResponse);
        }
Exemplo n.º 7
0
        public IPaymentResult CapturePayment(IInvoice invoice, IPayment payment, decimal amount, bool isPartialPayment)
        {
            var service          = GetPayPalService();
            var authorizationId  = payment.ExtendedData.GetValue(Constants.ExtendedDataKeys.AuthorizationId);
            var currency         = PayPalCurrency(invoice.CurrencyCode());
            var currencyDecimals = CurrencyDecimals(currency);

            // do express checkout
            var doCaptureRequest = new DoCaptureRequestType()
            {
                AuthorizationID = authorizationId,
                Amount          = new BasicAmountType(currency, PriceToString(amount, currencyDecimals)),
                CompleteType    = (isPartialPayment ? CompleteCodeType.NOTCOMPLETE : CompleteCodeType.COMPLETE)
            };
            var doCaptureReq = new DoCaptureReq()
            {
                DoCaptureRequest = doCaptureRequest
            };

            //if (payment.ExtendedData.GetValue(Constants.ExtendedDataKeys.PaymentCaptured) != "true") {
            DoCaptureResponseType doCaptureResponse;

            try {
                doCaptureResponse = service.DoCapture(doCaptureReq);
                if (doCaptureResponse.Ack != AckCodeType.SUCCESS && doCaptureResponse.Ack != AckCodeType.SUCCESSWITHWARNING)
                {
                    return(new PaymentResult(Attempt <IPayment> .Fail(payment, CreateErrorResult(doCaptureResponse.Errors)), invoice, false));
                }
            } catch (Exception ex) {
                return(new PaymentResult(Attempt <IPayment> .Fail(payment, ex), invoice, false));
            }

            payment.ExtendedData.SetValue(Constants.ExtendedDataKeys.TransactionId, doCaptureResponse.DoCaptureResponseDetails.PaymentInfo.TransactionID);
            payment.ExtendedData.SetValue(Constants.ExtendedDataKeys.PaymentCaptured, "true");
            //}

            payment.Authorized = true;
            payment.Collected  = true;
            return(new PaymentResult(Attempt <IPayment> .Succeed(payment), invoice, true));
        }
Exemplo n.º 8
0
        public DoCaptureResponseType CapturePayment(IPayment payment, IOrderGroup orderGroup, out string errorMessage)
        {
            var po            = (IPurchaseOrder)orderGroup;
            var captureAmount = payment.Amount;
            var currency      = _countryService.GetCurrencyCode(payment, orderGroup.Currency);

            var captureRequest = new DoCaptureRequestType
            {
                AuthorizationID = payment.TransactionID,
                Amount          = captureAmount.ToPayPalAmount(currency)
            };

            // original transactionID (which PayPal gave us when DoExpressCheckoutPayment, DoDirectPayment, or CheckOut)
            // if refund with Partial, we have to set the Amount

            captureRequest.CompleteType = payment.Amount >= _orderGroupCalculator.GetTotal(po).Amount
                ? CompleteCodeType.COMPLETE
                : CompleteCodeType.NOTCOMPLETE;

            captureRequest.InvoiceID = po.OrderNumber;

            captureRequest.Note = string.Format("[{2}-{3}] captured {0}{1} for [PurchaseOrder-{4}]",
                                                captureAmount, currency,
                                                payment.PaymentMethodName, payment.TransactionID,
                                                po.OrderNumber
                                                );

            var caller       = GetPayPalAPICallerServices();
            var doCaptureReq = new DoCaptureReq
            {
                DoCaptureRequest = captureRequest
            };

            var captureResponse = caller.DoCapture(doCaptureReq);

            errorMessage = captureResponse.CheckErrors();

            return(captureResponse);
        }
Exemplo n.º 9
0
        public override string CaptureOrder(Order o)
        {
            String result = String.Empty;

            o.CaptureTXCommand = "";
            o.CaptureTXResult  = "";

            // check for ReauthorizationID first, if doesn't exist, use original AuthorizationID
            String TransID = Regex.Match(o.AuthorizationPNREF, "(?<=REAU=)[0-9A-Z]+", RegexOptions.Compiled).ToString();

            if (TransID.Length == 0)
            {
                TransID = Regex.Match(o.AuthorizationPNREF, "(?<=AUTH=)[0-9A-Z]+", RegexOptions.Compiled).ToString();
            }

            Decimal OrderTotal = o.OrderBalance;

            if (TransID.Length == 0 || TransID == "0")
            {
                result = "Invalid or Empty Transaction ID";
            }
            else
            {
                try
                {
                    DoCaptureReq          CaptureReq         = new DoCaptureReq();
                    DoCaptureRequestType  CaptureRequestType = new DoCaptureRequestType();
                    DoCaptureResponseType CaptureResponse;

                    BasicAmountType totalAmount = new BasicAmountType();
                    totalAmount.Value      = Localization.CurrencyStringForGatewayWithoutExchangeRate(OrderTotal);
                    totalAmount.currencyID = (CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), AppLogic.AppConfig("Localization.StoreCurrency"), true);

                    CaptureRequestType.Amount          = totalAmount;
                    CaptureRequestType.AuthorizationID = TransID;

                    CaptureRequestType.CompleteType = CompleteCodeType.Complete;
                    CaptureRequestType.Version      = API_VER;

                    CaptureReq.DoCaptureRequest = CaptureRequestType;

                    o.CaptureTXCommand = XmlCommon.SerializeObject(CaptureReq, CaptureReq.GetType());                     //"Not Available For PayPal";

                    CaptureResponse = (DoCaptureResponseType)IPayPal.DoCapture(CaptureReq);

                    //if (LogToErrorTable)
                    //{
                    //    PayPalController.Log(XmlCommon.SerializeObject(CaptureReq, CaptureReq.GetType()), "DoCapture Request");
                    //    PayPalController.Log(XmlCommon.SerializeObject(CaptureResponse, CaptureResponse.GetType()), "DoCapture Response");
                    //}

                    o.CaptureTXResult = XmlCommon.SerializeObject(CaptureResponse, CaptureResponse.GetType());

                    if (CaptureResponse != null && CaptureResponse.Ack.ToString().StartsWith("success", StringComparison.InvariantCultureIgnoreCase))
                    {
                        result = AppLogic.ro_OK;
                        String CaptureTransID = CaptureResponse.DoCaptureResponseDetails.PaymentInfo.TransactionID;
                        o.AuthorizationPNREF = o.AuthorizationPNREF + "|CAPTURE=" + CaptureTransID;
                    }
                    else
                    {
                        if (CaptureResponse.Errors != null)
                        {
                            bool first = true;
                            for (int ix = 0; ix < CaptureResponse.Errors.Length; ix++)
                            {
                                if (!first)
                                {
                                    result += ", ";
                                }
                                result += "Error: [" + CaptureResponse.Errors[ix].ErrorCode + "] " + CaptureResponse.Errors[ix].LongMessage;
                                first   = false;
                            }
                        }
                    }
                }
                catch
                {
                    result = "NO RESPONSE FROM GATEWAY!";
                }
            }
            return(result);
        }
    // # DoCapture API Operation
    // Captures an authorized payment.
    public DoCaptureResponseType DoCaptureAPIOperation()
    {
        // Create the DoCaptureResponseType object
        DoCaptureResponseType responseDoCaptureResponseType = new DoCaptureResponseType();

        try
        {
            // Create the DoCapture object
            DoCaptureReq doCapture = new DoCaptureReq();

            // `Amount` to capture which takes mandatory params:
            //
            // * `currencyCode`
            // * `amount`
            BasicAmountType amount = new BasicAmountType(CurrencyCodeType.USD, "4.00");

            // `DoCaptureRequest` which takes mandatory params:
            //
            // * `Authorization ID` - Authorization identification number of the
            // payment you want to capture. This is the transaction ID returned from
            // DoExpressCheckoutPayment, DoDirectPayment, or CheckOut. For
            // point-of-sale transactions, this is the transaction ID returned by
            // the CheckOut call when the payment action is Authorization.
            // * `amount` - Amount to capture
            // * `CompleteCode` - Indicates whether or not this is your last capture.
            // It is one of the following values:
            // * Complete – This is the last capture you intend to make.
            // * NotComplete – You intend to make additional captures.
            // `Note:
            // If Complete, any remaining amount of the original authorized
            // transaction is automatically voided and all remaining open
            // authorizations are voided.`
            DoCaptureRequestType doCaptureRequest = new DoCaptureRequestType("O-4VR15106P7416533H", amount, CompleteCodeType.NOTCOMPLETE);
            doCapture.DoCaptureRequest = doCaptureRequest;

            // Create the service wrapper object to make the API call
            PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();

            // # API call
            // Invoke the DoCapture method in service wrapper object
            responseDoCaptureResponseType = service.DoCapture(doCapture);

            if (responseDoCaptureResponseType != null)
            {
                // Response envelope acknowledgement
                string acknowledgement = "DoCapture API Operation - ";
                acknowledgement += responseDoCaptureResponseType.Ack.ToString();
                logger.Info(acknowledgement + "\n");
                Console.WriteLine(acknowledgement + "\n");

                // # Success values
                if (responseDoCaptureResponseType.Ack.ToString().Trim().ToUpper().Equals("SUCCESS"))
                {
                    // Authorization identification number
                    logger.Info("Authorization ID : " + responseDoCaptureResponseType.DoCaptureResponseDetails.AuthorizationID + "\n");
                    Console.WriteLine("Authorization ID : " + responseDoCaptureResponseType.DoCaptureResponseDetails.AuthorizationID + "\n");
                }
                // # Error Values
                else
                {
                    List <ErrorType> errorMessages = responseDoCaptureResponseType.Errors;
                    foreach (ErrorType error in errorMessages)
                    {
                        logger.Debug("API Error Message : " + error.LongMessage);
                        Console.WriteLine("API Error Message : " + error.LongMessage + "\n");
                    }
                }
            }
        }
        // # Exception log
        catch (System.Exception ex)
        {
            // Log the exception message
            logger.Debug("Error Message : " + ex.Message);
            Console.WriteLine("Error Message : " + ex.Message);
        }
        return(responseDoCaptureResponseType);
    }
Exemplo n.º 11
0
 public DoCaptureResponseType DoCapture(string authorizationId, string note, string value, CurrencyCodeType currencyId, string invoiceId)
 {
     DoCaptureRequestType pp_request = new DoCaptureRequestType();
     pp_request.AuthorizationID = authorizationId;
     pp_request.Note = note;
     pp_request.Amount = new BasicAmountType();
     pp_request.Amount.Value = value;
     pp_request.Amount.currencyID = currencyId;
     pp_request.InvoiceID = invoiceId;
     return (DoCaptureResponseType)caller.Call("DoCapture", pp_request);
 }
Exemplo n.º 12
0
        /// <summary>
        /// The capture success.
        /// </summary>
        /// <param name="invoice">
        /// The invoice.
        /// </param>
        /// <param name="payment">
        /// The payment.
        /// </param>
        /// <param name="amount">
        /// The amount.
        /// </param>
        /// <param name="isPartialPayment">
        /// The is partial payment.
        /// </param>
        /// <returns>
        /// The <see cref="ExpressCheckoutResponse"/>.
        /// </returns>
        public PayPalExpressTransactionRecord Capture(IInvoice invoice, IPayment payment, decimal amount, bool isPartialPayment)
        {
            // Get the transaction record
            var record = payment.GetPayPalTransactionRecord();

            ExpressCheckoutResponse result = null;

            try
            {
                var amountFactory = new PayPalBasicAmountTypeFactory(PayPalApiHelper.GetPayPalCurrencyCode(invoice.CurrencyCode));

                var authorizationId = record.Data.AuthorizationTransactionId;

                // do express checkout
                var request = new DoCaptureRequestType()
                {
                    AuthorizationID = authorizationId,
                    Amount = amountFactory.Build(amount),
                    CompleteType = isPartialPayment ? CompleteCodeType.NOTCOMPLETE : CompleteCodeType.COMPLETE
                };

                var doCaptureReq = new DoCaptureReq() { DoCaptureRequest = request };

                var service = GetPayPalService();
                var doCaptureResponse = service.DoCapture(doCaptureReq);
                result = _responseFactory.Build(doCaptureResponse, record.Data.Token);

                if (result.Success())
                {
                    var transactionId = doCaptureResponse.DoCaptureResponseDetails.PaymentInfo.TransactionID;
                    record.Data.CaptureTransactionId = transactionId;
                }
            }
            catch (Exception ex)
            {
                result = _responseFactory.Build(ex);
            }

            record.DoCapture = result;
            record.Success = result.Success();
            return record;
        }
Exemplo n.º 13
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object

            DoCaptureRequestType request =
                new DoCaptureRequestType();

            // (Required) Authorization identification number of the payment you want to capture. This is the transaction ID returned from DoExpressCheckoutPayment, DoDirectPayment, or CheckOut. For point-of-sale transactions, this is the transaction ID returned by the CheckOut call when the payment action is Authorization.
            request.AuthorizationID = authorizationId.Value;

            // (Required) Amount to capture.
            // Note: You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies.
            CurrencyCodeType currency = (CurrencyCodeType)
                                        Enum.Parse(typeof(CurrencyCodeType), currencyCode.SelectedValue);

            request.Amount = new BasicAmountType(currency, amount.Value);

            // (Required) Indicates whether or not this is your last capture. It is one of the following values:
            // * Complete – This is the last capture you intend to make.
            // * NotComplete – You intend to make additional captures.
            if (completeType.SelectedIndex != 0)
            {
                request.CompleteType = (CompleteCodeType)
                                       Enum.Parse(typeof(CompleteCodeType), completeType.SelectedValue);
            }
            // (Optional) An informational note about this settlement that is displayed to the buyer in email and in their transaction history.
            if (note.Value != string.Empty)
            {
                request.Note = note.Value;
            }
            // (Optional) Your invoice number or other identification number that is displayed to you and to the buyer in their transaction history. The value is recorded only if the authorization you are capturing is an Express Checkout order authorization.
            // Note: This value on DoCapture overwrites a value previously set on DoAuthorization.
            if (invoiceId.Value != string.Empty)
            {
                request.InvoiceID = invoiceId.Value;
            }
            // (Optional) Per transaction description of the payment that is passed to the buyer's credit card statement.
            //If you provide a value in this field, the full descriptor displayed on the buyer's statement has the following format:
            //<PP * | PAYPAL *><Merchant descriptor as set in the Payment Receiving Preferences><1 space><soft descriptor>
            //Character length and limitations: The soft descriptor can contain only the following characters:
            //Alphanumeric characters
            //- (dash)
            //* (asterisk)
            //. (period)
            //{space}
            //If you pass any other characters (such as ","), PayPal returns an error code.
            //The soft descriptor does not include the phone number, which can be toggled between your customer service number and PayPal's Customer Service number.
            //The maximum length of the soft descriptor is 22 characters. Of this, the PayPal prefix uses either 4 or 8 characters of the data format. Thus, the maximum length of the soft descriptor information that you can pass in this field is:
            //22 - len(<PP * | PAYPAL *>) - len(<Descriptor set in Payment Receiving Preferences> + 1)
            //For example, assume the following conditions:
            //The PayPal prefix toggle is set to PAYPAL * in PayPal's administration tools.
            //The merchant descriptor set in the Payment Receiving Preferences is set to EBAY.
            //The soft descriptor is passed in as JanesFlowerGifts LLC.
            //The resulting descriptor string on the credit card is:
            //PAYPAL *EBAY JanesFlow
            if (softDescriptor.Value != string.Empty)
            {
                request.Descriptor = softDescriptor.Value;
            }

            // Invoke the API
            DoCaptureReq wrapper = new DoCaptureReq();

            wrapper.DoCaptureRequest = request;

            // Configuration map containing signature credentials and other required configuration.
            // For a full list of configuration parameters refer in wiki page
            // [https://github.com/paypal/sdk-core-dotnet/wiki/SDK-Configuration-Parameters]
            Dictionary <string, string> configurationMap = Configuration.GetAcctAndConfig();

            // Create the PayPalAPIInterfaceServiceService service object to make the API call
            PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap);

            // # API call
            // Invoke the DoCapture method in service wrapper object
            DoCaptureResponseType doCaptureResponse =
                service.DoCapture(wrapper);


            // Check for API return status
            setKeyResponseObjects(service, doCaptureResponse);
        }