UNPKG

zips-react-native-sdk-test

Version:

Lightweight ZIPS Payment Gateway SDK for React Native - Complete payment solution with card payments, wallet payments (AfrMoney & ZApp), netbanking, and native UI design

35 lines (28 loc) 734 B
// src/lib/axiosConfig.ts import axios, { AxiosInstance } from 'axios'; // Create axios instance const axiosConfig: AxiosInstance = axios.create({ // baseURL: 'http://localhost:9008/api/v1', // baseURL: 'http://zipsgateway.zigtech.net/api/v1', /// baseURL: 'https://api.zipsgateway.com/api/v1', timeout: 10000, headers: { 'Content-Type': 'application/json', }, }); // Request interceptor - add auth token axiosConfig.interceptors.request.use( (config) => { return config; }, (error) => Promise.reject(error) ); // Response interceptor - handle errors axiosConfig.interceptors.response.use( (response) => response, (error) => { return Promise.reject(error); } ); export default axiosConfig;