Ejemplo n.º 1
0
        public static void AuthTests(IAuthApi api)
        {
            //Retrieve Auth request
            var response1 = api.RetrieveAuthAsync(new PaginatedRequest {
                Limit = 10, Page = 1
            }).Result;

            if (response1.IsSuccess)
            {
                RetrieveAuthResponseData data = response1.Value;
                // do something with data
            }
            else
            {
                var error = response1.Error;
                //use error
            }

            //Auth By id
            var response2 = api.AuthByIdAsync(new AuthByIdRequest {
                Id = "5f338d5c9e5c6e823a71e5e1", Limit = 2, Page = 1
            }).Result;

            if (response2.IsSuccess)
            {
                AuthResponseData data = response2.Value;
                // do something with data
            }
            else
            {
                var error = response2.Error;
                //use error
            }

            var retAuthPdf = api.RetrieveAuthAsPdfAsync(new PaginatedRequest {
                Limit = 10, Page = 1,
            }).Result;

            var authId = api.AuthByIdAsync(new AuthByIdRequest {
                Id = "5f338d5c9e5c6e823a71e5e1", Limit = 2, Page = 1
            }).Result;

            var authCus = api.AuthByCustomerAsync(new AuthByCustomerRequest {
                Customer = "5f338d5c53957a10097edaa4", Limit = 2, Page = 1
            }).Result;

            var authDate = api.AuthByDateAsync(new AuthByDateRequest {
                From = DateTime.Now.AddDays(-50), To = DateTime.Now, Limit = 2, Page = 1
            }).Result;

            var authBank = api.AuthByBankAsync(new AuthByBankRequest {
                Bank = "5d6fe57a4099cc4b210bbec0", Limit = 10, Page = 1
            }).Result;

            var authCallBack = api.AuthCallBackAsync("5f536499e287580f4a6f1de7").Result;
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> AuthByCustomer([FromForm] AuthByCustomerRequest request) => Result(await _api.AuthByCustomerAsync(request));