Пример #1
0
        public void CanGetXmlRepresentationOfStatusRequest()
        {
            var statusRequest = new StatusRequest("123456789", 0, "0123456789123456");
            var xmlStatusRequest = statusRequest.ToXml(new SignatureProvider(PrivateCertificate, PublicCertificate));

            Assert.IsNotNullOrEmpty(xmlStatusRequest);
        }
Пример #2
0
 public void TransactionIdCannotBeEmpty()
 {
     Assert.Throws<InvalidOperationException>(delegate
     {
         var statusRequest = new StatusRequest("123456789", 0, " ");
     });
 }
Пример #3
0
 public void TransactionIdMustContain16Characters()
 {
     Assert.Throws<InvalidOperationException>(delegate
     {
         var statusRequest = new StatusRequest("123456789", 0, "123456789123456");
     });
 }
Пример #4
0
        public void CanCreateStatusRequest()
        {
            var statusRequest = new StatusRequest("123456789", 0, "0123456789123456");

            Assert.AreEqual("123456789", statusRequest.MerchantId);
            Assert.AreEqual(0, statusRequest.MerchantSubId);
            Assert.AreEqual("0123456789123456", statusRequest.TransactionId);
        }
Пример #5
0
 /// <summary>
 /// Retrieve status of transaction (Success, Cancelled Failure, Expired, Open)
 /// </summary>
 /// <param name="transactionId">Unique identifier of transaction obtained when the transaction was issued</param>
 public StatusResponse SendStatusRequest(string transactionId)
 {
     // Set up dependencies for http request
     var statusRequest = new StatusRequest(_configuration.MerchantId, _configuration.MerchantSubId, transactionId);
     
     // Execute http request
     return (StatusResponse)_iDealHttpRequest.SendRequest(statusRequest, _signatureProvider, _configuration.AcquirerUrl, _iDealHttpResponseHandler);
 }