public static void profileTransAuthCaptureType(profileTransAuthCaptureType request) { if (null != request) { lineItemType(request.lineItems); } }
/// <summary> /// Authorizes and Captures a transaction using the supplied profile information, abstracted through an Order object. Using the Order /// you can add line items, specify shipping and tax, etc. /// </summary> /// <param name="order">The order.</param> /// <returns></returns> public IGatewayResponse AuthorizeAndCapture(Order order) { var req = new createCustomerProfileTransactionRequest(); var trans = new profileTransAuthCaptureType(); trans.customerProfileId = order.CustomerProfileID; trans.customerPaymentProfileId = order.PaymentProfileID; trans.amount = order.Total; if (!String.IsNullOrEmpty(order.ShippingAddressProfileID)) { trans.customerShippingAddressId = order.ShippingAddressProfileID; } if (order.SalesTaxAmount > 0) { trans.tax = new extendedAmountType { amount = order.SalesTaxAmount, description = order.SalesTaxName, name = order.SalesTaxName } } ; if (order.ShippingAmount > 0) { trans.shipping = new extendedAmountType { amount = order.ShippingAmount, description = order.ShippingName, name = order.ShippingName } } ; //line items if (order._lineItems.Count > 0) { trans.lineItems = order._lineItems.ToArray(); } if (order.TaxExempt.HasValue) { trans.taxExempt = order.TaxExempt.Value; trans.taxExemptSpecified = true; } if (order.RecurringBilling.HasValue) { trans.recurringBilling = order.RecurringBilling.Value; trans.recurringBillingSpecified = true; } if (!String.IsNullOrEmpty(order.CardCode)) { trans.cardCode = order.CardCode; } if ((!String.IsNullOrEmpty(order.InvoiceNumber)) || (!String.IsNullOrEmpty(order.Description)) || (!String.IsNullOrEmpty(order.PONumber))) { trans.order = new orderExType(); if (!String.IsNullOrEmpty(order.InvoiceNumber)) { trans.order.invoiceNumber = order.InvoiceNumber; } if (!String.IsNullOrEmpty(order.Description)) { trans.order.description = order.Description; } if (!String.IsNullOrEmpty(order.PONumber)) { trans.order.purchaseOrderNumber = order.PONumber; } } req.transaction = new profileTransactionType(); req.transaction.Item = trans; req.extraOptions = order.ExtraOptions; var response = (createCustomerProfileTransactionResponse)_gateway.Send(req); return(new GatewayResponse(response.directResponse.Split(','))); }
public static void profileTransAuthCaptureType(profileTransAuthCaptureType argument) { if (null != argument) { profileTransOrderType(argument); } }
/// <summary> /// Authorizes and Captures a transaction using the supplied profile information, abstracted through an Order object. Using the Order /// you can add line items, specify shipping and tax, etc. /// </summary> /// <param name="order">The order.</param> /// <returns></returns> public IGatewayResponse AuthorizeAndCapture(Order order) { var req = new createCustomerProfileTransactionRequest(); var trans = new profileTransAuthCaptureType(); trans.customerProfileId = order.CustomerProfileID; trans.customerPaymentProfileId = order.PaymentProfileID; trans.amount = order.Total; if (!String.IsNullOrEmpty(order.ShippingAddressProfileID)) { trans.customerShippingAddressId = order.ShippingAddressProfileID; } if (order.SalesTaxAmount > 0) trans.tax = new extendedAmountType { amount = order.SalesTaxAmount, description = order.SalesTaxName, name = order.SalesTaxName }; if (order.ShippingAmount > 0) trans.shipping = new extendedAmountType { amount = order.ShippingAmount, description = order.ShippingName, name = order.ShippingName }; //line items if (order._lineItems.Count > 0) { trans.lineItems = order._lineItems.ToArray(); } if (order.TaxExempt.HasValue) { trans.taxExempt = order.TaxExempt.Value; trans.taxExemptSpecified = true; } if (order.RecurringBilling.HasValue) { trans.recurringBilling = order.RecurringBilling.Value; trans.recurringBillingSpecified = true; } if(!String.IsNullOrEmpty(order.CardCode)) trans.cardCode = order.CardCode; req.transaction = new profileTransactionType(); req.transaction.Item = trans; var response = (createCustomerProfileTransactionResponse)_gateway.Send(req); return new GatewayResponse(response.directResponse.Split(',')); }
/// <summary> /// Authorizes and Captures a transaction using the supplied profile information, abstracted through an Order object. Using the Order /// you can add line items, specify shipping and tax, etc. /// </summary> /// <param name="order">The order.</param> /// <returns></returns> public IGatewayResponse AuthorizeAndCapture(Order order) { var req = new createCustomerProfileTransactionRequest(); var trans = new profileTransAuthCaptureType(); trans.customerProfileId = order.CustomerProfileID; trans.customerPaymentProfileId = order.PaymentProfileID; trans.amount = order.Total; if (!String.IsNullOrEmpty(order.ShippingAddressProfileID)) { trans.customerShippingAddressId = order.ShippingAddressProfileID; } if (order.SalesTaxAmount > 0) { trans.tax = new extendedAmountType { amount = order.SalesTaxAmount, description = order.SalesTaxName, name = order.SalesTaxName } } ; if (order.ShippingAmount > 0) { trans.shipping = new extendedAmountType { amount = order.ShippingAmount, description = order.ShippingName, name = order.ShippingName } } ; //line items if (order._lineItems.Count > 0) { trans.lineItems = order._lineItems.ToArray(); } if (order.TaxExempt.HasValue) { trans.taxExempt = order.TaxExempt.Value; trans.taxExemptSpecified = true; } if (order.RecurringBilling.HasValue) { trans.recurringBilling = order.RecurringBilling.Value; trans.recurringBillingSpecified = true; } if (!String.IsNullOrEmpty(order.CardCode)) { trans.cardCode = order.CardCode; } req.transaction = new profileTransactionType(); req.transaction.Item = trans; var response = (createCustomerProfileTransactionResponse)_gateway.Send(req); if (response.directResponse != null && response.messages.resultCode == messageTypeEnum.Ok) { return(new GatewayResponse(response.directResponse.Split(','))); } else { //response.messages.message.ToString(), response.messages.resultCode.ToString() string respMessages = string.Empty; response.messages.message.ToList().ForEach(a => respMessages += a.code + "-" + a.text); return(new GatewayResponse { RawResponse = new string[] { response.messages.resultCode.ToString(), string.Empty, string.Empty, respMessages } }); } }