コード例 #1
0
 protected override XElement TxnDetailsElement(string merchantReference, decimal amount, string currencyCode, MCC6012 mcc6012)
 {
     return(new XElement("TxnDetails", new XElement("amount", amount.ToString("0.00"))));
 }
コード例 #2
0
        protected virtual XElement TxnDetailsElement(string merchantReference, decimal amount, string currencyCode, MCC6012 mcc6012)
        {
            var amountElement = new XElement("amount", amount.ToString("0.00"));

            if (!string.IsNullOrWhiteSpace(currencyCode))
            {
                amountElement.Add(new XAttribute("currency", currencyCode));
            }

            var root = new XElement("TxnDetails",
                                    new XElement("merchantreference", merchantReference),
                                    amountElement);

            if (mcc6012 != null)
            {
                root.Add(mcc6012.ToElement());
            }

            return(root);
        }
コード例 #3
0
        protected override XElement TxnDetailsElement(string merchantReference, decimal amount, string currencyCode, MCC6012 mcc6012)
        {
            var element = base.TxnDetailsElement(merchantReference, amount, currencyCode, mcc6012);

            element.Add(threeDSecureElement());
            return(element);
        }
コード例 #4
0
 public XDocument Build(string merchantReference, decimal amount, string currencyCode, CardDetails card, Cv2AvsPolicy policy, BillingAddress billingAddress, MCC6012 mcc6012)
 {
     return(GetDocument(
                TxnDetailsElement(merchantReference, amount, currencyCode, mcc6012),
                CardTxnElement(card, billingAddress, policy)));
 }
コード例 #5
0
        public I3DSecureResponse Payment(string merchantReference, decimal amount, CardDetails card, BillingAddress billingAddress = null, Cv2AvsPolicy policy = Cv2AvsPolicy.UNSPECIFIED, string currencyCode = null, MCC6012 mcc6012 = null)
        {
            if (string.IsNullOrWhiteSpace(merchantReference))
            {
                throw new ArgumentNullException("merchantReference");
            }

            var requestDocument = _paymentPaymentRequestBuilder.Build(merchantReference, amount, currencyCode, card, policy, billingAddress, mcc6012);
            var requestData     = requestDocument.ToString(SaveOptions.None);
            var httpResponse    = _httpClient.Post(_configuration.Host, requestData);
            var response        = _responseParser.Parse(httpResponse);

            if (response.CanAuthorize())
            {
                response = Authorise(response.TransactionReference, null);
            }
            return(response);
        }
コード例 #6
0
        public IRecurringPaymentResponse RepeatPayment(string merchantReference, string contAuthReference, decimal amount, string currencyCode = null, MCC6012 mcc6012 = null, string captureMethod = "cont_auth")
        {
            var requestDocument = _paymentRequestBuilder.BuildRepeatPaymentRequest(merchantReference, contAuthReference, amount, currencyCode, mcc6012, captureMethod);
            var response        = _httpClient.Post(_configuration.Host, requestDocument.ToString(SaveOptions.DisableFormatting));

            return(_responseParser.Parse(response));
        }
コード例 #7
0
        public IRecurringPaymentResponse SetupPayment(string merchantReference, decimal amount, CardDetails card, BillingAddress billingAddress = null, Cv2AvsPolicy policy = Cv2AvsPolicy.UNSPECIFIED, string currencyCode = null, MCC6012 mcc6012 = null, string captureMethod = "ecomm")
        {
            var requestDocument = _paymentRequestBuilder.BuildSetupPaymentRequest(merchantReference, amount, currencyCode, card, policy, billingAddress, mcc6012, captureMethod);
            var response        = _httpClient.Post(_configuration.Host, requestDocument.ToString(SaveOptions.DisableFormatting));

            return(_responseParser.Parse(response));
        }
コード例 #8
0
        public XDocument BuildRepeatPaymentRequest(string merchantReference, string caReference, decimal amount, string currencyCode, MCC6012 mcc6012, string captureMethod = "cont_auth")
        {
            var txnDetails = TxnDetailsElement(merchantReference, amount, currencyCode, mcc6012);

            if (!string.IsNullOrWhiteSpace(captureMethod))
            {
                txnDetails = AddCaptureMethod(txnDetails, captureMethod);
            }
            return(GetDocument(txnDetails, HistoricTxnElement("auth", caReference), ContAuthTxnElement(true)));
        }
コード例 #9
0
 public XDocument BuildSetupPaymentRequest(string merchantReference, decimal amount, string currencyCode, CardDetails card, Cv2AvsPolicy policy, BillingAddress billingAddress, MCC6012 mcc6012, string captureMethod = "ecomm")
 {
     return(GetDocument(
                AddCaptureMethod(TxnDetailsElement(merchantReference, amount, currencyCode, mcc6012), captureMethod),
                CardTxnElement(card, billingAddress, policy), ContAuthTxnElement(false)));
 }