import http, { vpaValidate, stageSecurepay, binApi } from "./http-common"; import PaymentMethodData, { AuthenticateInterface, CardFeeCalculation, VpaValidateInterface, CardPaymentRequest, NetbankingPayment, BhimUPIPayment, WalletPayment, CashPayment, UpiPaymentPayload } from "./Models/sabpaisa-payment-types"; class TutorialDataService { getPaymentModes(clientCode: string = "", clienttxnId: string = "") { return http.get>(`getPaymodeDetails?clientCode=${clientCode}&clienttxnId=${clienttxnId}`); } vpaAuthenticate({ username, password }: AuthenticateInterface) { return vpaValidate.post('authenticate', { username, password }) } vpaValidate({ vpa, bankName, token }: VpaValidateInterface) { return vpaValidate.post('vpa/validate', { vpa, bankName }, { headers: { token } }) } upiPayment(payload: UpiPaymentPayload) { return stageSecurepay.post('REST/upi/upItransaction', payload); } cardFeeCalculation(payload: CardFeeCalculation) { return stageSecurepay.post>('cardFeeCalculation', payload); } cardPaymentRequest(payload: CardPaymentRequest) { return stageSecurepay.post('REST/card/confirmCardTransaction', payload); } netbankingPayment(payload: NetbankingPayment) { return stageSecurepay.post>('REST/nb/confirmNbTransaction', payload); } bhimUPIQrPayment(payload: BhimUPIPayment) { return stageSecurepay.post('REST/BQR/confirmBqr', payload); } walletPayment(payload: WalletPayment) { return stageSecurepay.post>('REST/wallet/walletRequest', payload); } cashPayment(payload: CashPayment) { return stageSecurepay.post>('REST/cash/confirmCashTransaction', payload); } getCardDetails(binCode: string) { return binApi.post('getByBinCode/', { binCode, "giftCard": false }, { headers: { Authorization: "9566aefe-f683-11eb-b2b9-34e6ad2f65f6" } }) } } export default new TutorialDataService();