예제 #1
0
        public async Task Can_Perform_Ping()
        {
            // Arrange
            var payfastAdhoc = new PayFastAdHoc(payfastSettings: this.GetTestSettings());

            // Act
            var pingResult = await payfastAdhoc.Ping(token : token, testing : true);

            // Assert
            Assert.Equal(true, pingResult);
        }
예제 #2
0
        public async Task Can_Perform_Fetch()
        {
            // Arrange
            var payfastAdhoc = new PayFastAdHoc(payfastSettings: this.GetTestSettings());

            // Act
            var fetchResult = await payfastAdhoc.Fetch(token : token, testing : true);

            // Assert
            Assert.Equal("200", fetchResult.code);
            Assert.Equal("success", fetchResult.status);
            Assert.Equal(ResultStatus.Active, fetchResult.data.response.status);
        }
예제 #3
0
        public async Task Can_Perform_Cancel()
        {
            // Arrange
            var payfastAdhoc = new PayFastAdHoc(payfastSettings: this.GetTestSettings());

            // Act
            var cancelResult = await payfastAdhoc.Cancel(token : token, testing : true);

            // Assert
            Assert.Equal("200", cancelResult.code);
            Assert.Equal("success", cancelResult.status);
            Assert.Equal("true", cancelResult.data.response);
            Assert.Equal("Success", cancelResult.data.message);
        }
예제 #4
0
        public async Task Can_Perform_Charge()
        {
            // Arrange
            var payfastAdhoc = new PayFastAdHoc(payfastSettings: this.GetTestSettings());

            // Act
            var chargeResult = await payfastAdhoc.Charge(token : token, amount : 5000, item_name : "test item", testing : true);

            // Assert
            Assert.Equal("200", chargeResult.code);
            Assert.Equal("success", chargeResult.status);
            Assert.Equal("Success", chargeResult.data.message);
            Assert.Equal("true", chargeResult.data.response);
        }