33 lines
965 B
JavaScript
33 lines
965 B
JavaScript
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,
|
|
});
|
|
};
|