Esempio n. 1
0
        public void InitiatePayment()
        {
            var      nordeaApiManager = new NordeaAPIv3Manager();
            Creditor afsender         = new Creditor {
                Account = new Account {
                    Currency = "DKK", Value = "20301544117544", Type = "BBAN_DK"
                }, Message = "Test2"
            };
            Debtor modtager = new Debtor {
                Account = new Account {
                    Currency = "DKK", Value = "20301544118028", Type = "BBAN_DK"
                }, Message = "Test"
            };
            var apiResult = nordeaApiManager.InitiatePayment(afsender, modtager, 10.0M, "DKK");

            Assert.IsNotNull(apiResult);
            var paymentId     = apiResult.Id;
            var confirmResult = nordeaApiManager.ConfirmPayment(paymentId);

            Assert.IsNotNull(confirmResult);
            var payments   = nordeaApiManager.GetPayments();
            var paymentIds = payments.Select(p => p.Id);

            Assert.IsTrue(payments.Count > 0);
            Assert.IsTrue(paymentIds.Contains(paymentId));
        }
        public ActionResult ConfirmPayment(string id)
        {
            var apiManager = new NordeaAPIv3Manager();
            var apiResult  = apiManager.ConfirmPayment(id);

            SetContextCulture();
            return(RedirectToAction("PaymentStatus", routeValues: new { id = apiResult.Id }));
        }