reza fixed payment

master
Reza_ashrafi 3 years ago
parent 406d4ce8a2
commit e4e653118c
  1. 11
      src/redux/actions/userFactor.js
  2. 5
      src/redux/reducers/userFactor.js
  3. 7
      src/screens/QR/layouts/Scan/index.js

@ -24,12 +24,11 @@ const userFactor = {
}, },
//vod //vod
payment: // payment:
(data1 = {}, data2 = {}) => // (data1 = {}, data2 = {}) =>
async (dispatch) => { // async (dispatch) => {
await proxy.post("userProduct/addVOD", data1, { dispatch }); // await proxy.post("userFactor/payment", data1, { dispatch });
await proxy.post("userFactor/paymentVOD", data2, { dispatch }); // },
},
verify: verify:
(data = {}) => (data = {}) =>
async (dispatch) => async (dispatch) =>

@ -1,4 +1,5 @@
import { asyncAwesomeAlert } from "../../utils/AsyncWrappers"; import { asyncAwesomeAlert } from "../../utils/AsyncWrappers";
import {Linking} from "react-native";
const initialState = { const initialState = {
loading: false, loading: false,
@ -43,6 +44,7 @@ export default function userFactor(state = initialState, action) {
case "userFactor/delete": case "userFactor/delete":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "userFactor/payment": case "userFactor/payment":
Linking.openURL(data);
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
//vod //vod
case "userFactor/myList": case "userFactor/myList":
@ -51,7 +53,8 @@ export default function userFactor(state = initialState, action) {
return { ...state, loading: false, info: data.factorInfo, error: null }; return { ...state, loading: false, info: data.factorInfo, error: null };
case "userFactor/deleteUserOffCode": case "userFactor/deleteUserOffCode":
return { ...state, loading: false, error: null }; return { ...state, loading: false, error: null };
case "userFactor/paymentVOD": case "userFactor/payment":
console.log(data);
return { ...state, loading: false, error: null, isVerified: false }; return { ...state, loading: false, error: null, isVerified: false };
case "userFactor/verifyVOD": case "userFactor/verifyVOD":
return { ...state, loading: false, error: null, isVerified: true }; return { ...state, loading: false, error: null, isVerified: true };

@ -34,18 +34,11 @@ function Scan({ route, theme, page }) {
}, []); }, []);
const handleBarCodeScanned = ({ type, data }) => { const handleBarCodeScanned = ({ type, data }) => {
setScanned(true);
if (page === "activation") { if (page === "activation") {
setTimeout(() => {
setScanned(false);
}, 300);
navigation.replace("Activation", { navigation.replace("Activation", {
data: data.slice(data.lastIndexOf("/") + 1, data.length), data: data.slice(data.lastIndexOf("/") + 1, data.length),
}); });
} else { } else {
setTimeout(() => {
setScanned(false);
}, 300);
navigation.replace("QRContent", { navigation.replace("QRContent", {
data: data.slice(data.lastIndexOf("/") + 1, data.length), data: data.slice(data.lastIndexOf("/") + 1, data.length),
}); });

Loading…
Cancel
Save