UNPKG

digital-payments-sdk

Version:

The APIs detailed within this SDK will enable Shell's Fleet Solutions Customers to digitalize Shell Card/s and use them to pay to refuel their vehicles at Shell Stations.

37 lines (32 loc) 939 B
/** * Shell SmartPay APILib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ export * from '@apimatic/test-utilities'; import { HttpClient } from '../src/clientAdapter'; import { HttpClientInterface } from '../src/core'; import { ApiError, ApiResponse, AbortError } from '../src'; export function httpClientInterface(): HttpClientInterface { return async (request, requestOptions) => { return await new HttpClient(AbortError).executeRequest(request, requestOptions); }; } export async function makeApiCall<T>( caller: () => Promise<ApiResponse<T>> ): Promise<ApiResponse<T>> { try { return await caller(); } catch (error) { if (error instanceof ApiError) { return { request: error.request, statusCode: error.statusCode, headers: error.headers, result: error.result, body: error.body }; } throw error; } }