Exemple #1
0
        public async Task Should_Disapprove_Payment()
        {
            CreateSubMerchantRequest request = CreateSubMerchantRequestBuilder.Create()
                                               .PersonalSubMerchantRequest()
                                               .Build();

            SubMerchant subMerchant = await SubMerchant.CreateAsync(request, Options);

            CreatePaymentRequest paymentRequest = CreatePaymentRequestBuilder.Create()
                                                  .MarketplacePayment(subMerchant.SubMerchantKey)
                                                  .Build();

            Payment payment = await Payment.CreateAsync(paymentRequest, Options);

            string paymentTransactionId = payment.PaymentItems[0].PaymentTransactionId;

            CreateApprovalRequest approvalRequest = CreateApprovalRequestBuilder.Create()
                                                    .PaymentTransactionId(paymentTransactionId)
                                                    .Build();

            await Approval.CreateAsync(approvalRequest, Options);

            Disapproval disapproval = await Disapproval.CreateAsync(approvalRequest, Options);

            PrintResponse(disapproval);

            Assert.AreEqual(paymentTransactionId, disapproval.PaymentTransactionId);
            Assert.AreEqual(Status.SUCCESS.ToString(), disapproval.Status);
            Assert.AreEqual(Locale.TR.ToString(), disapproval.Locale);
            Assert.NotNull(disapproval.SystemTime);
            Assert.Null(disapproval.ErrorCode);
            Assert.Null(disapproval.ErrorMessage);
            Assert.Null(disapproval.ErrorGroup);
        }
        public async Task <IActionResult> DisapproveSubMerchant(int id)
        {
            CreateApprovalRequest request = new CreateApprovalRequest

            {
                Locale               = "tr",
                ConversationId       = "123456789",
                PaymentTransactionId = "11807130"
            };

            Disapproval disapproval = await Disapproval.CreateAsync(request, option);

            return(RedirectToAction(nameof(Index)));
        }
Exemple #3
0
        public async Task Should_Disapprove_Payment_Item()
        {
            CreateApprovalRequest request = new CreateApprovalRequest
            {
                Locale               = Locale.TR.ToString(),
                ConversationId       = "123456789",
                PaymentTransactionId = "1"
            };

            Disapproval disapproval = await Disapproval.CreateAsync(request, Options);

            PrintResponse(disapproval);

            Assert.AreEqual(Status.SUCCESS.ToString(), disapproval.Status);
            Assert.AreEqual(Locale.TR.ToString(), disapproval.Locale);
            Assert.AreEqual("123456789", disapproval.ConversationId);
            Assert.IsNotNull(disapproval.SystemTime);
            Assert.IsNull(disapproval.ErrorCode);
            Assert.IsNull(disapproval.ErrorMessage);
            Assert.IsNull(disapproval.ErrorGroup);
        }