Exemplo n.º 1
0
        /// <summary>
        /// Captures the specified transaction.
        /// </summary>
        /// <param name="profileID">The profile ID.</param>
        /// <param name="paymentProfileId">The payment profile id.</param>
        /// <param name="shippingProfileId">The id of the shipping information to use for the transaction.</param>
        /// <param name="transId">The transaction id to mark to capture (settle).</param>
        /// <param name="amount">The decimal amount to capture.</param>
        /// <returns></returns>
        public IGatewayResponse PriorAuthCapture(string profileID, string paymentProfileId, string shippingProfileId, string transId, Decimal amount)
        {
            var req = new createCustomerProfileTransactionRequest();

            var trans = new profileTransPriorAuthCaptureType();

            if (!String.IsNullOrEmpty(profileID))
            {
                trans.customerProfileId = profileID;
            }
            if (!String.IsNullOrEmpty(paymentProfileId))
            {
                trans.customerPaymentProfileId = paymentProfileId;
            }
            trans.transId = transId; //required
            trans.amount  = amount;  // required.
            if (!String.IsNullOrEmpty(shippingProfileId))
            {
                trans.customerShippingAddressId = shippingProfileId;
            }

            req.transaction      = new profileTransactionType();
            req.transaction.Item = trans;

            var response = (createCustomerProfileTransactionResponse)_gateway.Send(req);

            return(new GatewayResponse(response.directResponse.Split(',')));
        }
Exemplo n.º 2
0
 public static void profileTransPriorAuthCaptureType(profileTransPriorAuthCaptureType request)
 {
     if (null != request)
     {
         lineItemType(request.lineItems);
     }
 }