Esempio n. 1
0
        public async Task <WalletAccountResponse> CreateWallet(string phonenumber, string firstname, string lastname, string password, string email, string dateOfBirth, Currency currency = Currency.NGN)
        {
            //check for null for this properties
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Wallet.CREATEWALLET}";
                var payload = new
                {
                    phoneNumber = phonenumber,
                    firstName   = firstname,
                    lastName    = lastname,
                    password    = password,
                    email       = email,
                    dateOfBirth = dateOfBirth,
                    currency    = currency.ToString(),
                    SecretKey   = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <WalletAccountResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public async Task <SelfTransactionResponse> GetTransactions(DateTime from, DateTime to, TransactionType transactionType = TransactionType.ALL, Currency currency = Currency.NGN, int skip = 0, int take = 10)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Self.GETTRANSACTION}";
                var payload = new
                {
                    skip            = skip,
                    take            = take,
                    dateFrom        = from.ToString("yyyy-MM-dd"),
                    dateTo          = to.ToString("yyyy-MM-dd"),
                    transactionType = transactionType,
                    secretKey       = this.SecretKey,
                    currency        = currency.ToString()
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <SelfTransactionResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public async Task <AirtimeProviderResponse> GetProviders()
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Airtime.GETPROVIDERS}";
                var payload = new
                {
                    SecretKey = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <AirtimeProviderResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 4
0
        public async Task <AccountBVNResolveReponse> ResolveBVN(string bvn)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Account.RESOLVEBVN}";
                var payload = new
                {
                    bvn       = bvn,
                    SecretKey = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <AccountBVNResolveReponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        public async Task <BankTransferStatusResponse> PostStatusCheck(string reference)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Bank.BANKACCOUNTTRANSFERSTATUS}";
                var payload = new
                {
                    TransactionReference = reference,
                    SecretKey            = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <BankTransferStatusResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 6
0
        public async Task <SelfBalanceResponse> GetBalance(Currency currency = Currency.NGN)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Self.GETBALANCE}";
                var payload = new
                {
                    Currency  = currency.ToString(),
                    SecretKey = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <SelfBalanceResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 7
0
        public async Task <WalletAccountNumberDataResponse> RetrieveAccountNumber(string phoneNumber)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Wallet.RETRIEVEACCOUNTNUMBER}";
                var payload = new
                {
                    phoneNumber,
                    secretKey = this.SecretKey,
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <WalletAccountNumberDataResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 8
0
        public async Task <BankAccountEnquiryResponse> PostAccountEnquiry(string accountnumber, string bankcode)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Bank.BANKACCOUNTENQUIRY}";
                var payload = new
                {
                    AccountNumber = accountnumber,
                    BankCode      = bankcode,
                    SecretKey     = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <BankAccountEnquiryResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 9
0
        public async Task <SelfVerifyBVNResponse> VerifyBVN(string bvn, string dateOfBirth)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Self.VERIFYBVN}";
                var payload = new
                {
                    bvn         = bvn,
                    dateOfBirth = dateOfBirth,
                    secretKey   = this.SecretKey,
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <SelfVerifyBVNResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 10
0
        public async Task <WalletUserDataResponse> GetWallet(string phonenumber)
        {
            //check for null for this properties
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Wallet.GETUSER}";
                var payload = new
                {
                    phoneNumber = phonenumber,
                    SecretKey   = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <WalletUserDataResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public async Task <AirtimePurchaseResponse> PostAirtime(string phonenumber, decimal amount, string providercode)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Airtime.PURCHASE}";
                var payload = new
                {
                    Code        = providercode,
                    Amount      = amount,
                    PhoneNumber = phonenumber,
                    SecretKey   = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <AirtimePurchaseResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        public async Task <WalletDebitDataResponse> DebitWallet(string phonenumber, decimal amount, string transactionReference)
        {
            //check for null for this properties
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Wallet.DEBITWALLET}";
                var payload = new
                {
                    phoneNumber          = phonenumber,
                    amount               = amount,
                    transactionReference = transactionReference,
                    SecretKey            = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <WalletDebitDataResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 13
0
        public async Task <WalletAccountData> VerifyBVN(string phonenumber, string bvn, string dob)
        {
            //check for null for this properties
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Wallet.VERIFYBVN}";
                var payload = new
                {
                    phoneNumber = phonenumber,
                    dateOfBirth = dob,
                    bvn         = bvn,
                    SecretKey   = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <WalletAccountData>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 14
0
        public async Task <BankTransferResponse> PostDisburse(string accountnumber, string accountaname, string bankcode, decimal amount, string narration, string reference)
        {
            try
            {
                var url     = $"{BaseUrl}/{Endpoints.Bank.BANKACCOUNTTRANSFER}";
                var payload = new
                {
                    BankCode             = bankcode,
                    AccountNumber        = accountnumber,
                    AccountName          = accountaname,
                    TransactionReference = reference,
                    Amount    = amount,
                    SecretKey = this.SecretKey
                };
                var header   = HtttpHelper.GeneratedAuthorizationHeader(this.PublicKey);
                var response = await _networkClient.PostAsync(url, payload, headers : header);

                return(JsonConvert.DeserializeObject <BankTransferResponse>(response));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }