/**
 * HTTP client for payment service
 */ class PaymentClient { private baseURL ? : string ; private defaultHeaders : HeadersInit = { } ; async post ( path , params ? ) { let requestOption = { method : 'POST' , mode : 'cors' , headers : Object . assign ( { } , this . defaultHeaders , { 'Content-Type' : 'application/json' , } ) , credentials : 'same-origin' , } ; if ( params ) { requestOption . body = JSON . stringify ( params ) ; } return await fetch ( `${ this . baseURL }${ path }` , requestOption ) ; } public setBaseURL ( baseURL ) { this . baseURL = baseURL ; } } export default new PaymentClient ( ) ;