Exemplo n.º 1
0
        public void TestGetPaymentStatusSuccess()
        {
            var request      = new SafechargeRequestExecutor();
            var merchentInfo = new MerchantInfo()
            {
                MerchantId     = MerchantIdValue,
                MerchantSiteId = MerchantSiteIdValue,
                ServerHost     = ServerHostValue
            };
            var getMerchantPaymentMethodsRequest = new GetMerchantPaymentMethodsRequest(merchentInfo, sessionToken, "1234578");

            var response = request.GetMerchantPaymentMethods(getMerchantPaymentMethodsRequest).GetAwaiter().GetResult();

            Assert.IsNotNull(response);
            Assert.IsEmpty(response.Reason);
            Assert.AreEqual(ResponseStatus.Success, response.Status);
        }
Exemplo n.º 2
0
        public void TestGetSessionTokenSample()
        {
            var requestExecutor = new SafechargeRequestExecutor();

            var merchantInfo = new MerchantInfo(
                MerchantKeyValue,
                MerchantIdValue,
                MerchantSiteIdValue,
                ServerHostValue,
                HashAlgorithmType.SHA256);

            var getSessionTokenRequest = new GetSessionTokenRequest(merchantInfo);

            var response = requestExecutor.GetSessionToken(getSessionTokenRequest).GetAwaiter().GetResult();

            SaveResponse(response, "GetSessionTokenResponse.json");

            Assert.IsNotNull(response);
            Assert.IsEmpty(response.Reason);
            Assert.AreEqual(ResponseStatus.Success, response.Status);
        }