public void Setup()
        {
            _externalRefId       = Guid.NewGuid();
            _accountId           = 1;
            _merchantId          = 1;
            _cardNumer           = "12323232";
            _cardPaymentResponse = new CardPaymentResponse
            {
                AuthCode      = "AuthCode01",
                ExternalRefId = _externalRefId,
                Status        = "Accepted"
            };

            _cardDetail = new CardPaymentDetail
            {
                //AccountId = _accountId,
                //MerchantId = _merchantId,
                CardNumber       = _cardNumer,
                CardExpiry_Month = "02",
                CardExpiry_Year  = "2020",
                CVV = "123"
            };
            _checkOutHttpClientResponse               = new CheckOutHttpClientResponse();
            _checkOutHttpClientResponse.Data          = JsonConvert.SerializeObject(_cardPaymentResponse);
            _checkOutHttpClientResponse.IsSuccessFull = true;
            _checkOutHttpClientResponse.StatusCode    = HttpStatusCode.OK;
            _url = "anyURL";
            //_mockcheckoutHttpClient = new Mock<IHttpClient>().Object;
            _mockcheckoutHttpClient.Setup(x => x.Post <CardPaymentDetail, CheckOutHttpClientResponse>(_url, _cardDetail)).ReturnsAsync(_checkOutHttpClientResponse);
            _cardApiService = new CardApiService(_mockcheckoutHttpClient.Object);
        }
예제 #2
0
 public CardDetailsController(IRepository <MerchantConfig> merchantConfig, ICardApiService cardApiService, IPaymentDetailDataService paymentDetailDataService)
 {
     _merchantConfigRepository = merchantConfig;
     _cardApiService           = cardApiService;
     _paymentDetailDataService = paymentDetailDataService;
 }