simba-mobile-cad4/app/redux/payment/payment.action.js

33 lines
965 B
JavaScript
Raw Normal View History

2025-01-07 09:47:45 +00:00
import PaymentActions from "./payment.type";
import {ApiAction} from "../reducers";
import {testBaseUrl} from "../../webservice/IlinkConstants";
/************************************************************/
export const fetchPaymentMethodsPending = () => ({
type: PaymentActions.PAYMENT_METHOD_PENDING
});
export const fetchPaymentMethodsReset = () => ({
type: PaymentActions.PAYMENT_METHOD_RESET,
});
export const fetchPaymentMethodsSuccess = (authkey) => ({
type: PaymentActions.PAYMENT_METHOD_SUCCESS,
payload: authkey,
});
export const fetchPaymentMethodsError = (error) => ({
type: PaymentActions.PAYMENT_METHOD_ERROR,
payload: error,
});
export const fetchPaymentMethods = () => {
return ApiAction({
url: `${testBaseUrl}/paymentService/methods`,
method: 'GET',
onLoading: fetchPaymentMethodsPending,
onSuccess: fetchPaymentMethodsSuccess,
onError: fetchPaymentMethodsError,
});
};