Commit e1170e14 by Nguyễn Thị Thúy

merge func_smart_otp

parents e2d99add 7c6e90a3
...@@ -102,5 +102,7 @@ ...@@ -102,5 +102,7 @@
<false/> <false/>
<key>NSFaceIDUsageDescription</key> <key>NSFaceIDUsageDescription</key>
<string>Enabling Face ID allows you quick and secure access to your account.</string> <string>Enabling Face ID allows you quick and secure access to your account.</string>
<key>NSFaceIDUsageDescription</key>
<string>Enabling Face ID allows you quick and secure access to your account.</string>
</dict> </dict>
</plist> </plist>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"async": "^3.2.0", "async": "^3.2.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"dateformat": "^4.5.1", "dateformat": "^4.5.1",
"jsencrypt": "^3.2.0",
"lodash": "^4.17.20", "lodash": "^4.17.20",
"moment": "^2.29.1", "moment": "^2.29.1",
"react": "16.11.0", "react": "16.11.0",
......
...@@ -15,6 +15,22 @@ import AsyncStorage from '@react-native-community/async-storage'; ...@@ -15,6 +15,22 @@ import AsyncStorage from '@react-native-community/async-storage';
import {DETAILNEW, TABNAVIGATOR, AUTHEN} from '../routers/ScreenNames'; import {DETAILNEW, TABNAVIGATOR, AUTHEN} from '../routers/ScreenNames';
import R from '../assets/R'; import R from '../assets/R';
import {isTablet} from 'react-native-device-info'; import {isTablet} from 'react-native-device-info';
import {RSA_KEY, MY_RSA_KEY} from './constants';
import JSEncrypt from 'jsencrypt';
export const encryptRSAString = (val) => {
var encrypt = new JSEncrypt();
encrypt.setPublicKey(RSA_KEY.publicKey);
var encrypted = encrypt.encrypt(val);
return encrypted;
};
export const decryptRSAString = (val) => {
var decrypt = new JSEncrypt();
decrypt.setPrivateKey(MY_RSA_KEY.privateKey);
var uncrypted = decrypt.decrypt(val);
return uncrypted;
};
export const logout = (navigation) => { export const logout = (navigation) => {
AsyncStorage.clear(); AsyncStorage.clear();
......
...@@ -10,4 +10,81 @@ export const RadioBuySaleEN = [ ...@@ -10,4 +10,81 @@ export const RadioBuySaleEN = [
export const OTP_TYPE = { export const OTP_TYPE = {
CUSTOMER_REQUEST_DEPOSIT: 'CUSTOMER_REQUEST_DEPOSIT', CUSTOMER_REQUEST_DEPOSIT: 'CUSTOMER_REQUEST_DEPOSIT',
REQUEST_WITHDRAW: 'REQUEST_WITHDRAW', REQUEST_WITHDRAW: 'REQUEST_WITHDRAW',
} };
export const RSA_KEY = {
privateKey: `-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAriPaOfp9zSDIsde2OJPU3GKlV2EXqhEGxnmO6NHnz3SCJiTA
cTMIbckGKYsmsPoZyAmdP4irA+zMUA16vixXc1+R4whR1qVcXRQ2ZL/QOAtlgBUu
9rF3/+dexv3PW/2Di1uBdGn7khj3Mrs1PKWY9FEtb+NdgTF61RKWnhE6ktoKgukI
1XN5Xvt+5QqwOpPnDcByWyrw7J5N8Jc9bsP+GC7SzURE00nuw1uazrBvVpgcgyiA
yHj3SFJIF89MZYuulJxi9GYjv6ov3kcW5o14kNPExNEgPtlTVyoe1qub/xknSm12
GOTd5V8yvjgJ8ipjHxC7CvEEhG7AT5sJ/3pOywIDAQABAoIBAQCFQT4u+7XkkF/D
Z1Qzezx54KqxcMTRCPJsUny/QFDo+TjWw2zXsruSdy/V/nt/FgNAhcrk4UosWLoH
0CjK+dd5m/phBu7JGATT3TG6auWE3YOwPYWQlUFEe+KU14gj1p0guMcZNDikFaKk
GYmlfPrMiooAgrX8tMZP4keLcZem4xvclhOF49NOaQgbeydBGf33vFUN86qMG5V8
dUy80HkZ55TNXvY6GWpfKw7nOT7LjY1dNSGykNyMVoiLIQ7rMupzXVsu40Y6jajK
7S/pWZnDLPhMMepakFVzgy/D0ixwfrfRQN1PMFAS84r1n8CpA0rjm9xLyc7sLpEp
PEGbY9GxAoGBANUlhfK2e+kpoE40q3F1o2dwAglC+ombj8+VhJc7jnf8YLYcp4mG
+8RSqLueobR4UnFInkFRuN8VklkMISMHD+YuUhamzBkGnllA6THsgafqWOi1vO1A
9sm/UhHPnONm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Xn+6w1ZSf8Y2GONpnrOnQt
1uF/A5ZNV3IHgwa/Y4jxF+KHcvlvAyyOiDTVZAqn2/+JC+3z219OZCNet+VTmozz
AgMBAAE=
-----END PUBLIC KEY-----
\ No newline at end of file
import React, {useEffect, useRef} from 'react'; import React, {useEffect, useRef} from 'react';
import {View} from 'react-native'; import {Alert, View} from 'react-native';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import StackNavigation from './routers/StackNavigation'; import StackNavigation from './routers/StackNavigation';
...@@ -10,12 +10,14 @@ import NoInternetComponent from './components/NoInternet'; ...@@ -10,12 +10,14 @@ import NoInternetComponent from './components/NoInternet';
import DropdownAlert from 'react-native-dropdownalert'; import DropdownAlert from 'react-native-dropdownalert';
import DeviceInfo from 'react-native-device-info'; import DeviceInfo from 'react-native-device-info';
import R from './assets/R'; import R from './assets/R';
import {WIDTHXD, HEIGHTXD} from './Config/Functions'; import {WIDTHXD, HEIGHTXD, decryptRSAString} from './Config/Functions';
import DropdownManager from './components/DropdownAlert/DropdownManager'; import DropdownManager from './components/DropdownAlert/DropdownManager';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import KEY from './assets/AsynStorage'; import KEY from './assets/AsynStorage';
import I18n, {setLocation} from './helper/i18/i18n'; import I18n, {setLocation} from './helper/i18/i18n';
import {changeLanguage} from './actions/language'; import {changeLanguage} from './actions/language';
import {RSA_KEY, MY_RSA_KEY} from './Config/constants';
import JSEncrypt from 'jsencrypt';
enableScreens(); enableScreens();
...@@ -25,6 +27,7 @@ const RootView = (props) => { ...@@ -25,6 +27,7 @@ const RootView = (props) => {
dropDownAlertRef.current, dropDownAlertRef.current,
dropDownAlertLongTimeRef.current, dropDownAlertLongTimeRef.current,
); );
setInitLanguage(); setInitLanguage();
}, []); }, []);
...@@ -35,6 +38,7 @@ const RootView = (props) => { ...@@ -35,6 +38,7 @@ const RootView = (props) => {
if (laguage) props.changeLanguage(laguage); if (laguage) props.changeLanguage(laguage);
setLocation(I18n, laguage); setLocation(I18n, laguage);
}; };
return ( return (
<> <>
<View style={{flex: 1}}> <View style={{flex: 1}}>
......
...@@ -90,7 +90,8 @@ const FeePro = (props) => { ...@@ -90,7 +90,8 @@ const FeePro = (props) => {
return ( return (
<View> <View>
<Text style={styles.txtTitle}> {title}</Text> {title ? <Text style={styles.txtTitle}> {title}</Text> : null}
<View style={styles.wrap}> <View style={styles.wrap}>
{listItem.map((e) => ( {listItem.map((e) => (
<View key={e.id + 'a'} style={styles.item}> <View key={e.id + 'a'} style={styles.item}>
......
...@@ -129,12 +129,15 @@ const PacketCQG = (props) => { ...@@ -129,12 +129,15 @@ const PacketCQG = (props) => {
}; };
const getData = async () => { const getData = async () => {
const res = await getListPacketCQG({}); const res = await getListPacketCQG({});
console.log(res);
if ((res.data.code = 200 && res.data.data)) { if ((res.data.code = 200 && res.data.data)) {
setFee(res.data.data.fee); if (res.data.data.fee) setFee(res.data.data.fee);
setFeeConnect(res.data.data.fee_connect); if (res.data.data.fee_connect) setFeeConnect(res.data.data.fee_connect);
setFeeNonPro(res.data.data.fee_pro); if (res.data.data.fee_pro) setFeeNonPro(res.data.data.fee_pro);
setFeePro(res.data.data.fee_non_pro);
setOperrating(res.data.data.fee_operating); if (res.data.data.fee_non_pro) setFeePro(res.data.data.fee_non_pro);
if (res.data.data.fee_operating)
setOperrating(res.data.data.fee_operating);
if (res.data.package_register.length > 0) { if (res.data.package_register.length > 0) {
setListData(res.data.package_register); setListData(res.data.package_register);
...@@ -159,26 +162,31 @@ const PacketCQG = (props) => { ...@@ -159,26 +162,31 @@ const PacketCQG = (props) => {
<View style={styles.container}> <View style={styles.container}>
<AppText i18nKey={'Note_cqg'} /> <AppText i18nKey={'Note_cqg'} />
<ContainerTop fee={fee} /> <ContainerTop fee={fee} />
{feeOperating.data.length > 0 ? (
<WrapNomarl
onRemovePacket={onRemovePacket}
onChoosePacket={onChoosePacket}
data={feeOperating}
listRegister={listRegister}
/>
) : null}
{feeConnect.data.length > 0 ? (
<WrapNomarl
onRemovePacket={onRemovePacket}
onChoosePacket={onChoosePacket}
data={feeConnect}
listRegister={listRegister}
/>
) : null}
<WrapNomarl {feeNonPro.data.length > 0 ? (
onRemovePacket={onRemovePacket} <WrapNomarl
onChoosePacket={onChoosePacket} onRemovePacket={onRemovePacket}
data={feeOperating} onChoosePacket={onChoosePacket}
listRegister={listRegister} data={feeNonPro}
/> listRegister={listRegister}
/>
<WrapNomarl ) : null}
onRemovePacket={onRemovePacket}
onChoosePacket={onChoosePacket}
data={feeConnect}
listRegister={listRegister}
/>
<WrapNomarl
onRemovePacket={onRemovePacket}
onChoosePacket={onChoosePacket}
data={feeNonPro}
listRegister={listRegister}
/>
<FeePro <FeePro
onRemovePacket={onRemovePacket} onRemovePacket={onRemovePacket}
......
...@@ -44,7 +44,8 @@ const ContainerTop = (props) => { ...@@ -44,7 +44,8 @@ const ContainerTop = (props) => {
return ( return (
<View> <View>
<Text style={styles.txtTitle}> {title}</Text> {title ? <Text style={styles.txtTitle}> {title}</Text> : null}
<View style={styles.wrap}> <View style={styles.wrap}>
{listItem.map((e) => ( {listItem.map((e) => (
<View key={e.id + 'a'} style={styles.item}> <View key={e.id + 'a'} style={styles.item}>
......
...@@ -54,17 +54,31 @@ const MethodPayView = (props) => { ...@@ -54,17 +54,31 @@ const MethodPayView = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'SelectPaymentMethod'} /> <HeaderBack title={'SelectPaymentMethod'} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
<FlatList {data.length == 0 ? (
keyExtractor={(item) => item.id} <View
showsVerticalScrollIndicator={false} style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
numColumns={2} <AppText
columnWrapperStyle={{ i18nKey={'NoData'}
marginHorizontal: 20, style={{
justifyContent: 'space-between', fontSize: 18,
}} fontWeight: 'bold',
data={data} }}></AppText>
renderItem={({item}) => <Item userId={props.user.uid} item={item} />} </View>
/> ) : (
<FlatList
keyExtractor={(item) => item.id}
showsVerticalScrollIndicator={false}
numColumns={2}
columnWrapperStyle={{
marginHorizontal: 20,
justifyContent: 'space-between',
}}
data={data}
renderItem={({item}) => (
<Item userId={props.user.uid} item={item} />
)}
/>
)}
</View> </View>
</View> </View>
); );
......
...@@ -9,7 +9,8 @@ import { ...@@ -9,7 +9,8 @@ import {
TouchableWithoutFeedback, TouchableWithoutFeedback,
Keyboard, Keyboard,
KeyboardAvoidingView, KeyboardAvoidingView,
ScrollView, DeviceEventEmitter, ScrollView,
DeviceEventEmitter,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
...@@ -31,7 +32,9 @@ import {saveUserToRedux} from '../../../actions/users'; ...@@ -31,7 +32,9 @@ import {saveUserToRedux} from '../../../actions/users';
import {confirmAlert} from '../../../components/Aleart'; import {confirmAlert} from '../../../components/Aleart';
import { import {
ADDMETHODPAY, ADDMETHODPAY,
ENTER_PASSWORD_SMART_OTP, SETTINGOTP, ENTER_PASSWORD_SMART_OTP,
SETTINGOTP,
CHANGESMARTOTP,
} from '../../../routers/ScreenNames'; } from '../../../routers/ScreenNames';
import TextMoney from '../../../components/Input/InputMoney'; import TextMoney from '../../../components/Input/InputMoney';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
...@@ -116,21 +119,24 @@ const WalletWithdraw = (props) => { ...@@ -116,21 +119,24 @@ const WalletWithdraw = (props) => {
} else { } else {
if (!props.user.smart_otp_status) { if (!props.user.smart_otp_status) {
confirmAlert( confirmAlert(
`${I18n.t('YouHaveNotSettingSmartOTP')}`, `${I18n.t('YouHaveNotSettingSmartOTP')}`,
() => { () => {
navigate.navigate(SETTINGOTP, { navigate.navigate(CHANGESMARTOTP, {
isFromTransaction: true, TYPE: 'CREATE_SMART_OTP',
setupSmartOTPSuccess: () => { old_password: null,
navigate.goBack() isFromTransaction: true,
navigate.goBack() setupSmartOTPSuccess: () => {
navigate.navigate(ENTER_PASSWORD_SMART_OTP, { navigate.goBack();
onGoToSmartOTP: (pinCode, otp) => onGoToSmartOTP(pinCode, otp), navigate.goBack();
}); navigate.navigate(ENTER_PASSWORD_SMART_OTP, {
DeviceEventEmitter.emit('reloadUserInfo'); onGoToSmartOTP: (pinCode, otp) =>
}, onGoToSmartOTP(pinCode, otp),
}); });
}, DeviceEventEmitter.emit('reloadUserInfo');
`${I18n.t('setting')}`, },
});
},
`${I18n.t('setting')}`,
); );
} else { } else {
navigate.navigate(ENTER_PASSWORD_SMART_OTP, { navigate.navigate(ENTER_PASSWORD_SMART_OTP, {
...@@ -334,5 +340,5 @@ const mapStateToProps = (state) => { ...@@ -334,5 +340,5 @@ const mapStateToProps = (state) => {
export default connect(mapStateToProps, { export default connect(mapStateToProps, {
showLoading, showLoading,
hideLoading, hideLoading,
saveUserToRedux saveUserToRedux,
})(WalletWithdraw); })(WalletWithdraw);
...@@ -20,6 +20,7 @@ import I18n from '../../helper/i18/i18n'; ...@@ -20,6 +20,7 @@ import I18n from '../../helper/i18/i18n';
import {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../components/DropdownAlert'; import {showAlert, TYPE} from '../../components/DropdownAlert';
import {encryptRSAString} from '../../Config/Functions';
const NewPassword = (props) => { const NewPassword = (props) => {
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
...@@ -36,8 +37,8 @@ const NewPassword = (props) => { ...@@ -36,8 +37,8 @@ const NewPassword = (props) => {
const res = await forgotPasswordApi({ const res = await forgotPasswordApi({
receiver_name: email, receiver_name: email,
otp, otp,
password, password: encryptRSAString(password),
password_confirmation: cfPassword, password_confirmation: encryptRSAString(cfPassword),
platform: Platform.OS, platform: Platform.OS,
}); });
props.hideLoading(); props.hideLoading();
......
...@@ -16,7 +16,13 @@ import { ...@@ -16,7 +16,13 @@ import {
useBlurOnFulfill, useBlurOnFulfill,
useClearByFocusCell, useClearByFocusCell,
} from 'react-native-confirmation-code-field'; } from 'react-native-confirmation-code-field';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions'; import {
getFontXD,
HEIGHTXD,
WIDTHXD,
encryptRSAString,
decryptRSAString,
} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import {NEWPASSWORD} from '../../routers/ScreenNames'; import {NEWPASSWORD} from '../../routers/ScreenNames';
import {verifyOTPApi, registorApi, getOTPApi} from '../../apis/Functions/users'; import {verifyOTPApi, registorApi, getOTPApi} from '../../apis/Functions/users';
...@@ -52,7 +58,7 @@ const ConfirmOTP = (propsa) => { ...@@ -52,7 +58,7 @@ const ConfirmOTP = (propsa) => {
const res = await verifyOTPApi({ const res = await verifyOTPApi({
platform: Platform.OS, platform: Platform.OS,
receiver_name: propsa.route.params.email, receiver_name: propsa.route.params.email,
otp: value, otp: encryptRSAString(value),
type: 'CUSTOMER_VERIFY', type: 'CUSTOMER_VERIFY',
}); });
...@@ -68,18 +74,18 @@ const ConfirmOTP = (propsa) => { ...@@ -68,18 +74,18 @@ const ConfirmOTP = (propsa) => {
if (sponsor_id) { if (sponsor_id) {
res = await registorApi({ res = await registorApi({
email, email,
password, password: encryptRSAString(password),
platform: Platform.OS, platform: Platform.OS,
password_confirmation, password_confirmation: encryptRSAString(password_confirmation),
sponsor_id, sponsor_id,
phone, phone,
}); });
} else { } else {
res = await registorApi({ res = await registorApi({
email, email,
password, password: encryptRSAString(password),
platform: Platform.OS, platform: Platform.OS,
password_confirmation, password_confirmation: encryptRSAString(password_confirmation),
phone, phone,
}); });
} }
......
...@@ -51,10 +51,13 @@ const Home = (props) => { ...@@ -51,10 +51,13 @@ const Home = (props) => {
useEffect(() => { useEffect(() => {
getData(); getData();
initSocket(); initSocket();
let reloadUserInfoListener = DeviceEventEmitter.addListener('reloadUserInfo', (e) => { let reloadUserInfoListener = DeviceEventEmitter.addListener(
console.log('run in to reloadUserInfo'); 'reloadUserInfo',
onRefresh(); (e) => {
}); console.log('run in to reloadUserInfo');
onRefresh();
},
);
return () => { return () => {
reloadUserInfoListener.remove(); reloadUserInfoListener.remove();
}; };
......
...@@ -7,7 +7,7 @@ import {WIDTHXD} from '../../Config/Functions'; ...@@ -7,7 +7,7 @@ import {WIDTHXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/Entypo'; import Icon from 'react-native-vector-icons/Entypo';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {ADDMETHODPAY} from '../../routers/ScreenNames'; import {ADDMETHODPAY} from '../../routers/ScreenNames';
import AppText from '../../components/AppText';
const MethodPayView = (props) => { const MethodPayView = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
...@@ -17,7 +17,17 @@ const MethodPayView = (props) => { ...@@ -17,7 +17,17 @@ const MethodPayView = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'PaymentSetting'} /> <HeaderBack title={'PaymentSetting'} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
{listMethod.length > 0 ? ( {listMethod.length == 0 ? (
<View
style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<AppText
i18nKey={'NoData'}
style={{
fontSize: 18,
fontWeight: 'bold',
}}></AppText>
</View>
) : (
<FlatList <FlatList
keyExtractor={(item) => item.method} keyExtractor={(item) => item.method}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
...@@ -27,7 +37,7 @@ const MethodPayView = (props) => { ...@@ -27,7 +37,7 @@ const MethodPayView = (props) => {
data={listMethod} data={listMethod}
renderItem={({item}) => <Item item={item} />} renderItem={({item}) => <Item item={item} />}
/> />
) : null} )}
<TouchableOpacity <TouchableOpacity
onPress={() => navigate.navigate(ADDMETHODPAY)} onPress={() => navigate.navigate(ADDMETHODPAY)}
......
...@@ -33,13 +33,29 @@ const EnterPasswordSmartOTP = (props) => { ...@@ -33,13 +33,29 @@ const EnterPasswordSmartOTP = (props) => {
setFourNumber(number.toString()); setFourNumber(number.toString());
} }
}; };
console.log('Pros pass', props.route.params);
const onCheckPINSmartOTPPin = async () => { const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`; let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
navigation.navigate(CONFIRMCHANGESMARTOTP, { setFirstNumber(null);
pre_otp: pinCode, setSecondsNumber(null);
old_password: props.route.params.old_password, setThirdNumber(null);
}); setFourNumber(null);
if (props.route.params.isFromTransaction) {
navigation.navigate(CONFIRMCHANGESMARTOTP, {
pre_otp: pinCode,
old_password: props.route.params.old_password,
isFromTransaction: props.route.params.isFromTransaction,
TYPE: props.route.params.TYPE,
setupSmartOTPSuccess: props.route.params.setupSmartOTPSuccess,
});
} else {
navigation.navigate(CONFIRMCHANGESMARTOTP, {
pre_otp: pinCode,
old_password: props.route.params.old_password,
TYPE: props.route.params.TYPE,
});
}
}; };
const onDeletePress = () => { const onDeletePress = () => {
if (fourNumber) { if (fourNumber) {
......
import React, {useState, useEffect} from 'react'; import React, {useState, useEffect} from 'react';
import ConfirmSmartOTPView from './ConfirmSmartOTPView'; import ConfirmSmartOTPView from './ConfirmSmartOTPView';
import {updateOTPApiSmart} from '../../../apis/Functions/users'; import {
updateOTPApiSmart,
getOTPApiSmartOTP,
} from '../../../apis/Functions/users';
import {showAlert, TYPE} from '../../../components/DropdownAlert'; import {showAlert, TYPE} from '../../../components/DropdownAlert';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {hideLoading, showLoading} from '../../../actions/loadingAction'; import {hideLoading, showLoading} from '../../../actions/loadingAction';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import {SMARTOTPCONFIG, TABNAVIGATOR} from '../../../routers/ScreenNames'; import {
SMARTOTPCONFIG,
TABNAVIGATOR,
CONFIRMCREATEOTP,
} from '../../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {encryptRSAString} from '../../../Config/Functions';
const ConfirmChangeSmartOTP = (props) => { const ConfirmChangeSmartOTP = (props) => {
const [firstNumber, setFirstNumber] = useState(null); const [firstNumber, setFirstNumber] = useState(null);
...@@ -31,32 +39,64 @@ const ConfirmChangeSmartOTP = (props) => { ...@@ -31,32 +39,64 @@ const ConfirmChangeSmartOTP = (props) => {
} }
}; };
console.log('Pros pass', props.route.params);
const onCheckPINSmartOTPPin = async () => { const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`; let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
props.showLoading();
const res = await updateOTPApiSmart({ if (props.route.params.TYPE == 'CHANGE_SMART_OTP') {
platform: Platform.OS, props.showLoading();
password: props.route.params.pre_otp, const res = await updateOTPApiSmart({
password_confirmation: pinCode, platform: Platform.OS,
old_password: props.route.params.old_password, password: encryptRSAString(props.route.params.pre_otp),
}); password_confirmation: encryptRSAString(pinCode),
props.hideLoading(); old_password: encryptRSAString(props.route.params.old_password),
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
navigation.reset({
index: 1,
routes: [{name: TABNAVIGATOR}, {name: SMARTOTPCONFIG}],
}); });
props.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
navigation.navigate(SMARTOTPCONFIG);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
}
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); props.showLoading();
setFirstNumber(null); const res = await getOTPApiSmartOTP({
setSecondsNumber(null); platform: Platform.OS,
setThirdNumber(null); otp_by: props.user.email,
setFourNumber(null); otp_password: '1234',
type: 'CREATE_OTP_PASSWORD',
});
props.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
if (props.route.params.isFromTransaction) {
navigation.navigate(CONFIRMCREATEOTP, {
password: props.route.params.pre_otp,
password_confirmation: pinCode,
isFromTransaction: props.route.params.isFromTransaction,
setupSmartOTPSuccess: props.route.params.setupSmartOTPSuccess,
});
} else {
navigation.navigate(CONFIRMCREATEOTP, {
password: props.route.params.pre_otp,
password_confirmation: pinCode,
});
}
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
} }
}; };
const onDeletePress = () => { const onDeletePress = () => {
......
import React, {Component, useEffect, useState} from 'react';
import {
View,
Text,
TextInput,
StyleSheet,
TouchableOpacity,
Platform,
Alert,
} from 'react-native';
import HeaderBack from '../../../components/Header/HeaderBack';
import {
CodeField,
Cursor,
useBlurOnFulfill,
useClearByFocusCell,
} from 'react-native-confirmation-code-field';
import {
getFontXD,
HEIGHTXD,
WIDTHXD,
encryptRSAString,
} from '../../../Config/Functions';
import R from '../../../assets/R';
import {NEWPASSWORD, TABNAVIGATOR} from '../../../routers/ScreenNames';
import {
verifyOTPApi,
verifyStoreOTPApiSmart,
getOTPApiSmartOTP,
} from '../../../apis/Functions/users';
import {useNavigation} from '@react-navigation/native';
import I18n from '../../../helper/i18/i18n';
import AppText from '../../../components/AppText';
import {showLoading, hideLoading} from '../../../actions/loadingAction';
import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../../components/DropdownAlert';
import CountDown from '../../../components/CountDown';
import {getOTPApi} from '../../../apis/Functions/users';
const CELL_COUNT = 4;
const ConfirmOTP = (propsa) => {
const [value, setValue] = useState('');
const [isReset, setReset] = useState(false);
const navigate = useNavigation();
const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT});
const [props, getCellOnLayoutHandler] = useClearByFocusCell({
value,
setValue,
});
const getOTP = async () => {
propsa.showLoading();
const res = await getOTPApiSmartOTP({
platform: Platform.OS,
otp_by: propsa.user.email,
otp_password: '1234',
type: 'CREATE_OTP_PASSWORD',
});
propsa.hideLoading();
if (res.data.code == 200) {
setReset(!isReset);
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
};
const confirm = async () => {
console.log(propsa.route.params);
if (!value) {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('EnterOTPRequest'));
} else if (value.length != 4) {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('OTPInvalid'));
} else {
propsa.showLoading();
const res = await verifyStoreOTPApiSmart({
platform: Platform.OS,
password: encryptRSAString(propsa.route.params.password),
password_confirmation: encryptRSAString(
propsa.route.params.password_confirmation,
),
otp: value,
type: 'CREATE_OTP_PASSWORD',
});
propsa.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
if (propsa.route.params.isFromTransaction) {
propsa.route.params.setupSmartOTPSuccess();
} else {
navigate.navigate(TABNAVIGATOR);
}
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
}
};
return (
<View style={{flex: 1}}>
<HeaderBack title={'VerifyOTP'} />
<View style={styles.container}>
<View style={{height: 20}} />
<View style={styles.wrap}>
<AppText i18nKey={'Verify_code'} style={styles.txtTitle} />
<View style={styles.containerCode}>
<CodeField
ref={ref}
{...props}
value={value}
onChangeText={setValue}
cellCount={CELL_COUNT}
rootStyle={styles.codeFieldRoot}
keyboardType="number-pad"
textContentType="oneTimeCode"
renderCell={({index, symbol, isFocused}) => (
<View
onLayout={getCellOnLayoutHandler(index)}
key={index}
style={[styles.cellRoot, isFocused && styles.focusCell]}>
<Text style={styles.cellText}>
{symbol || (isFocused ? <Cursor /> : null)}
</Text>
</View>
)}
/>
</View>
</View>
</View>
<View style={styles.footer}>
<TouchableOpacity onPress={confirm} style={styles.btn}>
<AppText i18nKey={'Continue'} style={styles.txtBtn} />
</TouchableOpacity>
<TouchableOpacity style={styles.wrapFooter} onPress={getOTP}>
<Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text>
<AppText i18nKey={'Re_send'} style={styles.txtSend} />
</TouchableOpacity>
<CountDown isReset={isReset} />
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingVertical: 20,
},
footer: {
height: 200,
justifyContent: 'center',
alignItems: 'center',
},
wrap: {
flex: 1,
paddingTop: 30,
alignItems: 'center',
width: '100%',
paddingHorizontal: 50,
},
containerCode: {
height: 50,
width: '100%',
marginTop: 30,
},
codeFieldRoot: {
marginTop: 20,
},
focusCell: {
borderColor: '#000',
},
cellRoot: {
width: 40,
height: 40,
justifyContent: 'center',
alignItems: 'center',
borderBottomColor: '#ccc',
borderBottomWidth: 1,
},
cellText: {
color: '#000',
fontSize: 36,
textAlign: 'center',
},
focusCell: {
borderBottomColor: '#007AFF',
borderBottomWidth: 2,
},
txtTitle: {
fontSize: getFontXD(52),
color: '#979797',
},
btn: {
width: WIDTHXD(521),
height: HEIGHTXD(120),
borderRadius: 15,
backgroundColor: '#1C6AF6',
justifyContent: 'center',
alignItems: 'center',
},
txtBtn: {
color: R.colors.white,
fontSize: getFontXD(52),
textTransform: 'uppercase',
},
txtSend: {
fontSize: getFontXD(42),
color: '#1C6AF6',
},
wrapFooter: {
marginTop: 30,
flexDirection: 'row',
alignItems: 'center',
},
txtNote: {
color: '#A2A2A2',
fontSize: getFontXD(42),
fontStyle: 'italic',
},
});
const mapStateToProps = (state) => {
return {user: state.userReducer};
};
export default connect(mapStateToProps, {showLoading, hideLoading})(ConfirmOTP);
import React from 'react';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import HeaderBack from '../../../components/Header/HeaderBack';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../../Config/Functions';
import I18n from '../../../helper/i18/i18n';
import R from '../../../assets/R';
import Icon from 'react-native-vector-icons/FontAwesome5';
const ChangeSmartOTPView = (props) => {
return (
<View style={{flex: 1, colorBackground: R.colors.white}}>
<HeaderBack title={'OTP'} />
<Text style={[styles.textNormal, {marginTop: HEIGHTXD(40)}]}>
{I18n.t('EnterOTPRequest')}
</Text>
<View style={[styles.rowNumber]}>
<View
style={[
styles.indicator,
{
backgroundColor: props.firstNumber
? R.colors.main
: R.colors.white,
},
]}
/>
<View
style={[
styles.indicator,
{
backgroundColor: props.secondsNumber
? R.colors.main
: R.colors.white,
},
]}
/>
<View
style={[
styles.indicator,
{
backgroundColor: props.thirdNumber
? R.colors.main
: R.colors.white,
},
]}
/>
<View
style={[
styles.indicator,
{
backgroundColor: props.fourNumber
? R.colors.main
: R.colors.white,
},
]}
/>
</View>
<View style={[styles.rowNumber, {marginTop: HEIGHTXD(80)}]}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(1);
}}
style={styles.btnNumber}>
<Text style={styles.textNumber}>1</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(2);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>2</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(3);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>3</Text>
</TouchableOpacity>
</View>
<View style={styles.rowNumber}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(4);
}}
style={styles.btnNumber}>
<Text style={styles.textNumber}>4</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(5);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>5</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(6);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>6</Text>
</TouchableOpacity>
</View>
<View style={styles.rowNumber}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(7);
}}
style={styles.btnNumber}>
<Text style={styles.textNumber}>7</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(8);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>8</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(9);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>9</Text>
</TouchableOpacity>
</View>
<View style={styles.rowNumber}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(0);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(300)}]}>
<Text style={styles.textNumber}>0</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onDeletePress();
}}
style={{
width: HEIGHTXD(260),
height: HEIGHTXD(260),
marginLeft: WIDTHXD(40),
justifyContent: 'center',
alignItems: 'center',
}}>
<Icon name={'backspace'} size={HEIGHTXD(80)} color={'#8E8C8C'} />
</TouchableOpacity>
</View>
</View>
);
};
export default ChangeSmartOTPView;
const styles = StyleSheet.create({
btnSend: {
height: HEIGHTXD(80),
justifyContent: 'center',
alignItems: 'center',
},
rowNumber: {
flexDirection: 'row',
justifyContent: 'center',
marginTop: HEIGHTXD(40),
},
btnNumber: {
height: HEIGHTXD(260),
width: HEIGHTXD(260),
justifyContent: 'center',
alignItems: 'center',
borderWidth: 0.3,
borderColor: R.colors.gray6,
borderRadius: HEIGHTXD(130),
},
indicator: {
height: HEIGHTXD(50),
width: HEIGHTXD(50),
borderWidth: 0.3,
borderColor: R.colors.gray6,
borderRadius: HEIGHTXD(35),
marginHorizontal: WIDTHXD(20),
},
textNormal: {
fontSize: getFontXD(39),
color: R.colors.black,
textAlign: 'center',
},
textNumber: {
fontSize: getFontXD(90),
color: R.colors.black,
textAlign: 'center',
},
txtSend: {
fontSize: getFontXD(42),
color: R.colors.main,
},
});
import React, {useState} from 'react'; import React, {useState} from 'react';
import { import {View, Text, StyleSheet, TouchableOpacity, Platform} from 'react-native';
View,
Text,
StyleSheet,
TouchableOpacity,
Platform,
} from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack'; import HeaderBack from '../../components/Header/HeaderBack';
import { import {
...@@ -29,7 +23,7 @@ import { ...@@ -29,7 +23,7 @@ import {
verifyStoreOTPApiSmart, verifyStoreOTPApiSmart,
getOTPApiSmartOTP, getOTPApiSmartOTP,
} from '../../apis/Functions/users'; } from '../../apis/Functions/users';
import {encryptRSAString} from '../../Config/Functions';
const CELL_COUNT = 4; const CELL_COUNT = 4;
...@@ -70,8 +64,10 @@ const ConfirmOTPSmart = (propsa) => { ...@@ -70,8 +64,10 @@ const ConfirmOTPSmart = (propsa) => {
propsa.showLoading(); propsa.showLoading();
const res = await verifyStoreOTPApiSmart({ const res = await verifyStoreOTPApiSmart({
platform: Platform.OS, platform: Platform.OS,
password: propsa.route.params.password, password: encryptRSAString(propsa.route.params.password),
password_confirmation: propsa.route.params.password_confirmation, password_confirmation: encryptRSAString(
propsa.route.params.password_confirmation,
),
otp: value, otp: value,
type: 'CREATE_OTP_PASSWORD', type: 'CREATE_OTP_PASSWORD',
}); });
......
...@@ -8,109 +8,116 @@ import {hideLoading, showLoading} from '../../actions/loadingAction'; ...@@ -8,109 +8,116 @@ import {hideLoading, showLoading} from '../../actions/loadingAction';
import {OTP_TYPE} from '../../Config/constants'; import {OTP_TYPE} from '../../Config/constants';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {RESET_SMART_OTP, CHANGESMARTOTP} from '../../routers/ScreenNames'; import {RESET_SMART_OTP, CHANGESMARTOTP} from '../../routers/ScreenNames';
import {decryptRSAString, encryptRSAString} from '../../Config/Functions';
const EnterPasswordSmartOTP = (props) => { const EnterPasswordSmartOTP = (props) => {
const navigation = useNavigation(); const navigation = useNavigation();
const [firstNumber, setFirstNumber] = useState(null); const [firstNumber, setFirstNumber] = useState(null);
const [secondsNumber, setSecondsNumber] = useState(null); const [secondsNumber, setSecondsNumber] = useState(null);
const [thirdNumber, setThirdNumber] = useState(null); const [thirdNumber, setThirdNumber] = useState(null);
const [fourNumber, setFourNumber] = useState(null); const [fourNumber, setFourNumber] = useState(null);
useEffect(() => { useEffect(() => {
if (fourNumber) { if (fourNumber) {
onCheckPINSmartOTPPin(); onCheckPINSmartOTPPin();
} }
}, [fourNumber]); }, [fourNumber]);
const onNumberPress = (number) => { const onNumberPress = (number) => {
if (!firstNumber) { if (!firstNumber) {
setFirstNumber(number.toString()); setFirstNumber(number.toString());
} else if (!secondsNumber) { } else if (!secondsNumber) {
setSecondsNumber(number.toString()); setSecondsNumber(number.toString());
} else if (!thirdNumber) { } else if (!thirdNumber) {
setThirdNumber(number.toString()); setThirdNumber(number.toString());
} else if (!fourNumber) { } else if (!fourNumber) {
setFourNumber(number.toString()); setFourNumber(number.toString());
} }
}; };
const onCheckPINSmartOTPPin = async () => { const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`; let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
props.showLoading(); props.showLoading();
if (props.route.params.type == 'CHANGE_SMART_OTP') { if (props.route.params.type == 'CHANGE_SMART_OTP') {
const res = await verifyOTPApiSmart({ const res = await verifyOTPApiSmart({
platform: Platform.OS, platform: Platform.OS,
otp_password: pinCode, otp_password: encryptRSAString(pinCode),
type: 'VERIFY_OTP_PASSWORD', type: 'VERIFY_OTP_PASSWORD',
}); });
if (res.data.code == 200) { if (res.data.code == 200) {
navigation.navigate(CHANGESMARTOTP, {old_password: pinCode}); navigation.navigate(CHANGESMARTOTP, {
clearPIN() old_password: encryptRSAString(pinCode),
} else { TYPE: 'CHANGE_SMART_OTP',
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); });
clearPIN() clearPIN();
} } else {
} else { showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
const res = await getOTPApiSmartOTP({ clearPIN();
platform: Platform.OS, }
otp_by: props.user.email, } else {
otp_password: pinCode, const res = await getOTPApiSmartOTP({
type: platform: Platform.OS,
props.route.params.type == 'DEPOSIT' otp_by: props.user.email,
? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT otp_password: encryptRSAString(pinCode),
: OTP_TYPE.REQUEST_WITHDRAW, type:
}); props.route.params.type == 'DEPOSIT'
? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT
: OTP_TYPE.REQUEST_WITHDRAW,
});
if (res.data.code == 200) { if (res.data.code == 200) {
props.route.params.onGoToSmartOTP(pinCode, res.data.data.otp); props.route.params.onGoToSmartOTP(
} else { pinCode,
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); decryptRSAString(res.data.data.otp),
clearPIN() );
} } else {
} showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
props.hideLoading(); clearPIN();
}; }
const clearPIN = () => { }
setFirstNumber(null); props.hideLoading();
setSecondsNumber(null); };
setThirdNumber(null); const clearPIN = () => {
setFourNumber(null); setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
};
const onDeletePress = () => {
if (fourNumber) {
setFourNumber(null);
} else if (thirdNumber) {
setThirdNumber(null);
} else if (secondsNumber) {
setSecondsNumber(null);
} else if (firstNumber) {
setFirstNumber(null);
} }
const onDeletePress = () => { };
if (fourNumber) { const onReactivationSmartOTP = () => {
setFourNumber(null); navigation.navigate(RESET_SMART_OTP, {title: 'ReactivationSmartOTP'});
} else if (thirdNumber) { };
setThirdNumber(null);
} else if (secondsNumber) {
setSecondsNumber(null);
} else if (firstNumber) {
setFirstNumber(null);
}
};
const onReactivationSmartOTP = () => {
navigation.navigate(RESET_SMART_OTP, {title: 'ReactivationSmartOTP'});
};
const onForgotPINCode = () => { const onForgotPINCode = () => {
navigation.navigate(RESET_SMART_OTP, {title: 'ForgotSmartOTP'}); navigation.navigate(RESET_SMART_OTP, {title: 'ForgotSmartOTP'});
}; };
return ( return (
<EnterPasswordSmartOTPView <EnterPasswordSmartOTPView
firstNumber={firstNumber} firstNumber={firstNumber}
secondsNumber={secondsNumber} secondsNumber={secondsNumber}
thirdNumber={thirdNumber} thirdNumber={thirdNumber}
fourNumber={fourNumber} fourNumber={fourNumber}
onNumberPress={onNumberPress} onNumberPress={onNumberPress}
onDeletePress={onDeletePress} onDeletePress={onDeletePress}
onForgotPINCode={onForgotPINCode} onForgotPINCode={onForgotPINCode}
onReactivationSmartOTP={onReactivationSmartOTP} onReactivationSmartOTP={onReactivationSmartOTP}
/> />
); );
}; };
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
user: state.userReducer, user: state.userReducer,
}; };
}; };
export default connect(mapStateToProps, {showLoading, hideLoading})( export default connect(mapStateToProps, {showLoading, hideLoading})(
EnterPasswordSmartOTP, EnterPasswordSmartOTP,
); );
...@@ -11,104 +11,113 @@ import {connect} from 'react-redux'; ...@@ -11,104 +11,113 @@ import {connect} from 'react-redux';
import {hideLoading, showLoading} from '../../actions/loadingAction'; import {hideLoading, showLoading} from '../../actions/loadingAction';
import {OTP_TYPE} from '../../Config/constants'; import {OTP_TYPE} from '../../Config/constants';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {encryptRSAString, decryptRSAString} from '../../Config/Functions';
const SmartOTP = (props) => { const SmartOTP = (props) => {
const [value, setValue] = useState(props.route.params.otp); const [value, setValue] = useState(props.route.params.otp);
const [progress, setProgress] = useState(1); const [progress, setProgress] = useState(1);
const [isReset, setReset] = useState(false); const [isReset, setReset] = useState(false);
const navigate = useNavigation(); const navigate = useNavigation();
useEffect(() => { useEffect(() => {
setValue(props.route.params.otp); setValue(props.route.params.otp);
}, [props.route.params.otp]); }, [props.route.params.otp]);
const confirm = async () => { const confirm = async () => {
if (!value) { if (!value) {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('EnterOTPRequest')); showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('EnterOTPRequest'));
} else if (value.length != 4) { } else if (value.length != 4) {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('OTPInvalid')); showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('OTPInvalid'));
} else { } else {
props.showLoading(); props.showLoading();
let res1 = await verifyOTPApi({ let res1 = await verifyOTPApi({
platform: Platform.OS, platform: Platform.OS,
receiver_name: props.user.email, receiver_name: props.user.email,
otp: value, otp: encryptRSAString(value),
type: props.route.params.type == 'DEPOSIT' ? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT : OTP_TYPE.REQUEST_WITHDRAW, type:
}); props.route.params.type == 'DEPOSIT'
? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT
if (res1.data.code == 200) { : OTP_TYPE.REQUEST_WITHDRAW,
let res; });
if (props.route.params.type == 'DEPOSIT') {
const {amount, notes} = props.route.params;
res = await walletDeposit({
amount,
platform: Platform.OS,
notes,
fee: 0,
});
} else {
const {src, receiving_account, amount, notes} = props.route.params;
res = await widthDraw({
src,
receiving_account,
amount,
platform: Platform.OS,
notes,
fee: 0,
});
}
props.hideLoading(); if (res1.data.code == 200) {
if (res.data.code == 200) { let res;
setTimeout(() => { if (props.route.params.type == 'DEPOSIT') {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message); const {amount, notes} = props.route.params;
navigate.navigate(TABNAVIGATOR); res = await walletDeposit({
}, 500); amount,
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res1.data.message);
}
props.hideLoading();
}
};
const getNewOTP = async () => {
props.showLoading();
const res = await getOTPApiSmartOTP({
platform: Platform.OS, platform: Platform.OS,
otp_by: props.user.email, notes,
otp_password: props.route.params.pinCode, fee: 0,
type: props.route.params.type == 'DEPOSIT' ? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT : OTP_TYPE.REQUEST_WITHDRAW, });
});
if (res.data.code == 200) {
setValue(res.data.data.otp);
setReset(!isReset);
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); const {src, receiving_account, amount, notes} = props.route.params;
res = await widthDraw({
src,
receiving_account,
amount,
platform: Platform.OS,
notes,
fee: 0,
});
} }
props.hideLoading(); props.hideLoading();
}; if (res.data.code == 200) {
setTimeout(() => {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
navigate.navigate(TABNAVIGATOR);
}, 500);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res1.data.message);
}
props.hideLoading();
}
};
const getNewOTP = async () => {
props.showLoading();
const res = await getOTPApiSmartOTP({
platform: Platform.OS,
otp_by: props.user.email,
otp_password: encryptRSAString(props.route.params.pinCode),
type:
props.route.params.type == 'DEPOSIT'
? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT
: OTP_TYPE.REQUEST_WITHDRAW,
});
if (res.data.code == 200) {
setValue(decryptRSAString(res.data.data.otp));
setReset(!isReset);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
props.hideLoading();
};
const updateProgress = (count) => { const updateProgress = (count) => {
setProgress(count > 0 ? count / 300 : 0); setProgress(count > 0 ? count / 300 : 0);
}; };
return <SmartOTPView return (
value={value} <SmartOTPView
progress={progress} value={value}
confirm={confirm} progress={progress}
isReset={isReset} confirm={confirm}
getNewOTP={getNewOTP} isReset={isReset}
updateProgress={updateProgress} getNewOTP={getNewOTP}
setValue={setValue}/>; updateProgress={updateProgress}
setValue={setValue}
/>
);
}; };
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
user: state.userReducer, user: state.userReducer,
}; };
}; };
export default connect(mapStateToProps, {showLoading, hideLoading})(SmartOTP); export default connect(mapStateToProps, {showLoading, hideLoading})(SmartOTP);
...@@ -38,10 +38,9 @@ const VersionChecker = (props) => { ...@@ -38,10 +38,9 @@ const VersionChecker = (props) => {
platform: Platform.OS, platform: Platform.OS,
}); });
if ((res.data.code = 200 && res.data.data)) { if ((res.data.code = 200 && res.data.data)) {
console.log(res);
if ( if (
res.data.data[0].version_name !== verCurrent || res.data.data[0].version_name !== verCurrent ||
res.data.data[0].build.toString() !== DeviceInfo.getBuildNumber res.data.data[0].build.toString() !== DeviceInfo.getBuildNumber()
) { ) {
setVersion(res.data.data[0].version_name); setVersion(res.data.data[0].version_name);
setVisible(true); setVisible(true);
......
...@@ -16,7 +16,12 @@ import { ...@@ -16,7 +16,12 @@ import {
useBlurOnFulfill, useBlurOnFulfill,
useClearByFocusCell, useClearByFocusCell,
} from 'react-native-confirmation-code-field'; } from 'react-native-confirmation-code-field';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions'; import {
getFontXD,
HEIGHTXD,
WIDTHXD,
encryptRSAString,
} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import {TABNAVIGATOR} from '../../routers/ScreenNames'; import {TABNAVIGATOR} from '../../routers/ScreenNames';
import {verifyOTPApi} from '../../apis/Functions/users'; import {verifyOTPApi} from '../../apis/Functions/users';
...@@ -68,8 +73,10 @@ const ConfirmOTPSmart = (propsa) => { ...@@ -68,8 +73,10 @@ const ConfirmOTPSmart = (propsa) => {
propsa.showLoading(); propsa.showLoading();
const res = await verifyStoreOTPApiSmart({ const res = await verifyStoreOTPApiSmart({
platform: Platform.OS, platform: Platform.OS,
password: propsa.route.params.password, password: encryptRSAString(propsa.route.params.password),
password_confirmation: propsa.route.params.password_confirmation, password_confirmation: encryptRSAString(
propsa.route.params.password_confirmation,
),
otp: value, otp: value,
type: 'FORGOT_PASSWORD', type: 'FORGOT_PASSWORD',
}); });
......
export const root = 'http://services.dcvinvest.com/'; export const root = 'http://services.dcvinvest.com/';
export default { export default {
urllogin: root + 'api/auth/customer-login', urllogin: root + 'api/v2/auth/customer-login',
urlRegistor: root + 'api/auth/customer-register', urlRegistor: root + 'api/auth/customer-register',
urlGetListMethod: root + 'api/v1/payments/get-list-deposit-method', urlGetListMethod: root + 'api/v1/payments/get-list-deposit-method',
urlGetOTP: root + 'api/auth/customer-get-otp', urlGetOTP: root + 'api/auth/customer-get-otp',
......
...@@ -308,7 +308,7 @@ export default { ...@@ -308,7 +308,7 @@ export default {
SettingOTP: 'Setting Smart OTP', SettingOTP: 'Setting Smart OTP',
SettingGeneral: 'Setting general', SettingGeneral: 'Setting general',
ChangeSmartOTP: 'Change smart OTP', ChangeSmartOTP: 'Smart OTP',
Rules: 'Rules', Rules: 'Rules',
FAQs: 'FAQs', FAQs: 'FAQs',
...@@ -327,4 +327,5 @@ export default { ...@@ -327,4 +327,5 @@ export default {
ForgotSmartOTP: 'Forgot Smart OTP', ForgotSmartOTP: 'Forgot Smart OTP',
WarnMaxReqestWithdraw: 'Invalid withdrawal amount', WarnMaxReqestWithdraw: 'Invalid withdrawal amount',
YouHaveNotSettingSmartOTP: 'You have not installed Smart OTP', YouHaveNotSettingSmartOTP: 'You have not installed Smart OTP',
OTP: 'Enter OTP',
}; };
...@@ -311,7 +311,7 @@ export default { ...@@ -311,7 +311,7 @@ export default {
EnterSmartOTPPINNEW: 'Vui lòng nhập mã PIN Smart OTP mới', EnterSmartOTPPINNEW: 'Vui lòng nhập mã PIN Smart OTP mới',
AddSmartOTP: 'Thêm Smart OTP', AddSmartOTP: 'Thêm Smart OTP',
ChangeSmartOTP: 'Đổi mã PIN Smart OTP', ChangeSmartOTP: 'Mã PIN Smart OTP',
Rules: 'Điều khoản và điều kiện', Rules: 'Điều khoản và điều kiện',
FAQs: 'FAQs', FAQs: 'FAQs',
...@@ -324,4 +324,5 @@ export default { ...@@ -324,4 +324,5 @@ export default {
ResetSmartOTP2: ' bấm phím 3 để gặp nhân viên hỗ trợ kỹ thuật.', ResetSmartOTP2: ' bấm phím 3 để gặp nhân viên hỗ trợ kỹ thuật.',
ForgotSmartOTP: 'Quên Smart OTP', ForgotSmartOTP: 'Quên Smart OTP',
YouHaveNotSettingSmartOTP: 'Bạn chưa cài đặt Smart OTP', YouHaveNotSettingSmartOTP: 'Bạn chưa cài đặt Smart OTP',
OTP: 'Nhập OTP',
}; };
...@@ -93,3 +93,5 @@ export const CONFIRMCHANGESMARTOTP = 'CONFIRMCHANGESMARTOTP'; ...@@ -93,3 +93,5 @@ export const CONFIRMCHANGESMARTOTP = 'CONFIRMCHANGESMARTOTP';
export const RULESSMARTOTP = 'RULESSMARTOTP'; export const RULESSMARTOTP = 'RULESSMARTOTP';
export const FAQSSMARTOTP = 'FAQSSMARTOTP'; export const FAQSSMARTOTP = 'FAQSSMARTOTP';
export const CONFIRMCREATEOTP = 'CONFIRMCREATEOTP';
...@@ -67,6 +67,7 @@ import ConfirmChangeSmartOTP from '../Screens/SmartOTP/ChangeSmartOTP/ConfirmCha ...@@ -67,6 +67,7 @@ import ConfirmChangeSmartOTP from '../Screens/SmartOTP/ChangeSmartOTP/ConfirmCha
import FAQs from '../Screens/SmartOTP/WebView/FAQs'; import FAQs from '../Screens/SmartOTP/WebView/FAQs';
import RulesSmartOTP from '../Screens/SmartOTP/WebView/RulesSmartOTP'; import RulesSmartOTP from '../Screens/SmartOTP/WebView/RulesSmartOTP';
import ConfirmCreate from '../Screens/SmartOTP/ConfirmCreate/ConfirmCreate';
import * as ScreenName from './ScreenNames'; import * as ScreenName from './ScreenNames';
...@@ -86,9 +87,14 @@ function MyStack(props) { ...@@ -86,9 +87,14 @@ function MyStack(props) {
headerMode={'none'} headerMode={'none'}
initialRouteName={ScreenName.AUTHEN}> initialRouteName={ScreenName.AUTHEN}>
<Stack.Screen <Stack.Screen
name={ScreenName.CONFIRMCREATEOTP}
component={ConfirmCreate}
/>
<Stack.Screen
name={ScreenName.CACULATEDDEPOSIT} name={ScreenName.CACULATEDDEPOSIT}
component={CaculatedDeposit} component={CaculatedDeposit}
/> />
<Stack.Screen <Stack.Screen
name={ScreenName.CONFIRMOTPSMART} name={ScreenName.CONFIRMOTPSMART}
component={ConfirmOTPSmart} component={ConfirmOTPSmart}
...@@ -172,8 +178,14 @@ function MyStack(props) { ...@@ -172,8 +178,14 @@ function MyStack(props) {
<Stack.Screen name={ScreenName.NEWPASSWORD} component={NewPassWord} /> <Stack.Screen name={ScreenName.NEWPASSWORD} component={NewPassWord} />
<Stack.Screen name={ScreenName.PRODUCTDETAIL} component={ProductDetail} /> <Stack.Screen name={ScreenName.PRODUCTDETAIL} component={ProductDetail} />
<Stack.Screen name={ScreenName.SMARTOTP} component={SmartOTP} /> <Stack.Screen name={ScreenName.SMARTOTP} component={SmartOTP} />
<Stack.Screen name={ScreenName.ENTER_PASSWORD_SMART_OTP} component={EnterPasswordSmartOTP} /> <Stack.Screen
<Stack.Screen name={ScreenName.RESET_SMART_OTP} component={ResetSmartOTP} /> name={ScreenName.ENTER_PASSWORD_SMART_OTP}
component={EnterPasswordSmartOTP}
/>
<Stack.Screen
name={ScreenName.RESET_SMART_OTP}
component={ResetSmartOTP}
/>
<Stack.Screen name={ScreenName.FAQSSMARTOTP} component={FAQs} /> <Stack.Screen name={ScreenName.FAQSSMARTOTP} component={FAQs} />
<Stack.Screen name={ScreenName.RULESSMARTOTP} component={RulesSmartOTP} /> <Stack.Screen name={ScreenName.RULESSMARTOTP} component={RulesSmartOTP} />
......
...@@ -21,6 +21,7 @@ import { ...@@ -21,6 +21,7 @@ import {
AccountVerification, AccountVerification,
PACKETCQG, PACKETCQG,
SETTINGOTP, SETTINGOTP,
CHANGESMARTOTP,
} from '../routers/ScreenNames'; } from '../routers/ScreenNames';
import I18n, {setLocation} from '../helper/i18/i18n'; import I18n, {setLocation} from '../helper/i18/i18n';
import {changeLanguage} from '../actions/language'; import {changeLanguage} from '../actions/language';
...@@ -110,7 +111,10 @@ const TabNavigator = (props) => { ...@@ -110,7 +111,10 @@ const TabNavigator = (props) => {
? 'Bạn có muốn cài đặt Smart OTP?' ? 'Bạn có muốn cài đặt Smart OTP?'
: 'Do you want setting Smart OTP?', : 'Do you want setting Smart OTP?',
() => { () => {
navigate.navigate(SETTINGOTP); navigate.navigate(CHANGESMARTOTP, {
TYPE: 'CREATE_SMART_OTP',
old_password: null,
});
}, },
); );
} else if (props.user.status == 3 && !props.user.contract_code) { } else if (props.user.status == 3 && !props.user.contract_code) {
......
...@@ -5205,6 +5205,11 @@ jsdom@^16.4.0: ...@@ -5205,6 +5205,11 @@ jsdom@^16.4.0:
ws "^7.2.3" ws "^7.2.3"
xml-name-validator "^3.0.0" xml-name-validator "^3.0.0"
jsencrypt@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/jsencrypt/-/jsencrypt-3.2.0.tgz#09242aabf1984165dcd7698fe6ed163be77c05f8"
integrity sha512-Y/WBrCYRP1A2I1OEXxqurO+W3AC5uXhiArprpYQ0Y8/1Dc3NaiINAyCLx7HzXGwN7xvW3s5xpeOTdwD7lD1SQQ==
jsesc@^2.5.1: jsesc@^2.5.1:
version "2.5.2" version "2.5.2"
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment