public ProcessDetailsResponse ProcessStandardTransaction(PaypointPaymentDetailsModel model)
        {
            var validateCardFullResponse =
                _secvpn.validateCardFull(new validateCardFullRequest(_paypointSettings.AccountName,
                                                                     _paypointSettings.VPNPassword,
                                                                     _cartModel.CartGuid.ToString(),
                                                                     RequestHelper.GetIP(), model.NameOnCard,
                                                                     model.CardNumber,
                                                                     _paypointHelper.GetTotal(_cartModel.TotalToPay),
                                                                     _paypointHelper.GetDate(model.EndMonth,
                                                                                             model.EndYear),
                                                                     model.CardIssueNumber,
                                                                     _paypointHelper.GetDate(model.StartMonth,
                                                                                             model.StartYear),
                                                                     _paypointHelper.GetOrderDetails(_cartModel),
                                                                     _paypointHelper.GetAddress(
                                                                         _cartModel.ShippingAddress,
                                                                         _cartModel.OrderEmail),
                                                                     _paypointHelper.GetAddress(
                                                                         _cartModel.BillingAddress,
                                                                         _cartModel.OrderEmail),
                                                                     _paypointHelper.GetOptions(model)));

            var response = _paypointHelper.ParseResponse(validateCardFullResponse.validateCardFullReturn);
            return response["code"] != "A"
                       ? GetFailureResponse(response)
                       : GetSuccessResponse(response);
        }
示例#2
0
 public string GetOptions(PaypointPaymentDetailsModel model)
 {
     var options = string.Format("test_status={0},card_type={1},cv2={2},mail_customer=false",
                                 _paypointSettings.IsLive ? "live" : "true", model.CardType,
                                 model.CardVerificationCode);
     if (!_paypointSettings.IsLive)
         options += ",dups=false";
     return options;
 }
 public ProcessDetailsResponse ProcessDetails(PaypointPaymentDetailsModel model, string threeDSecureUrl)
 {
     try
     {
         var disable3Dsecure = _paypointSettings.Admin3DSecureDisable && CurrentRequestData.CurrentUserIsAdmin;
         return _paypointSettings.ThreeDSecureEnabled && !disable3Dsecure
                    ? _paypointRequestService.Process3DSecureTransaction(model, threeDSecureUrl)
                    : _paypointRequestService.ProcessStandardTransaction(model);
     }
     catch (Exception exception)
     {
         CurrentRequestData.ErrorSignal.Raise(exception);
         return new ProcessDetailsResponse { ErrorOccurred = true };
     }
 }
        public ProcessDetailsResponse Process3DSecureTransaction(PaypointPaymentDetailsModel model, string threeDSecureUrl)
        {
            _cartModel.CartGuid = _paypoint3DSecureHelper.ResetCartGuid();
            _paypoint3DSecureHelper.SetCartGuid(_cartModel.CartGuid);
            _paypoint3DSecureHelper.SetOrderAmount(_cartModel.TotalToPay);

            var threeDSecureEnrolmentRequestResponse =
                _secvpn.threeDSecureEnrolmentRequest(
                    new threeDSecureEnrolmentRequestRequest(_paypointSettings.AccountName,
                                                            _paypointSettings.VPNPassword,
                                                            _cartModel.CartGuid.ToString(),
                                                            RequestHelper.GetIP(),
                                                            model.NameOnCard, model.CardNumber,
                                                            _paypointHelper.GetTotal(_cartModel.TotalToPay),
                                                            _paypointHelper.GetDate(model.EndMonth,
                                                                                    model.EndYear),
                                                            model.CardIssueNumber,
                                                            _paypointHelper.GetDate(model.StartMonth,
                                                                                    model.StartYear),
                                                            _paypointHelper.GetOrderDetails(_cartModel),
                                                            _paypointHelper.GetAddress(
                                                                _cartModel.ShippingAddress,
                                                                _cartModel.OrderEmail),
                                                            _paypointHelper.GetAddress(
                                                                _cartModel.BillingAddress, _cartModel.OrderEmail),
                                                            _paypointHelper.GetOptions(model), "0",
                                                            RequestHelper.GetAcceptHeaders(),
                                                            RequestHelper.UserAgent(),
                                                            _paypointSettings.MPIMerchantName,
                                                            _paypointSettings.MPIMerchantUrl,
                                                            _paypointSettings.MPIDescription, "", "", ""));

            var response = _paypointHelper.ParseResponse(threeDSecureEnrolmentRequestResponse.threeDSecureEnrolmentRequestReturn);

            return response["valid"] != "true"
                ? GetFailureResponse(response)
                : (response["mpi_status_code"] == "200"
                    ? GetRedirectResponse(threeDSecureUrl, response)
                    : response["code"] == "A"
                        ? GetSuccessResponse(response)
                        : GetFailureResponse(response));
        }
 public void SetModel(PaypointPaymentDetailsModel model)
 {
     _cartSessionManager.SetSessionValue(PaypointPaymentModelKey, _getUserGuid.UserGuid, model, SessionDataTimeoutDefaults.PaymentInfo, true);
 }