Bank operation OK

This commit is contained in:
Brice 2020-11-04 21:02:23 +01:00
parent e18dae1f0a
commit bae9ae54f4
38 changed files with 7572 additions and 6451 deletions

12
App.js
View File

@ -87,6 +87,7 @@ import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
import { IlinkEmitter } from './utils/events';
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
import { readUser } from './webservice/AuthApi';
import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent";
const instructions = Platform.select({
@ -149,10 +150,9 @@ const AppStack = createDrawerNavigator({
navigationOptions: {
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (<IconWithBadge
badgeCount={0}
return (<Icon
size={20}
name={"account-multiple-plus"}
name={"users-cog"}
color={focused ? tintColor : "grey"}
/>)
}
@ -163,10 +163,9 @@ const AppStack = createDrawerNavigator({
navigationOptions: {
tabBarLabel: I18n.t('MY_GROUP'),
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (<IconWithBadge
badgeCount={0}
return (<Icon
size={20}
name={"account-multiple"}
name={"users"}
color={focused ? tintColor : "grey"}
/>)
}
@ -269,6 +268,7 @@ const AppAgentStack = createDrawerNavigator({
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
envoieWalletToBankAgent: EnvoieWalletToBankAgent,
createGroupNanoCredit: CreateGroupNanoCredit,
cautionNanoCreditAgent: CautionNanoCreditAgent,
})

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,7 @@
"ASK_MEMBERS": "Membership applications",
"MY_ACCOUNT": "My account",
"WALLET": "Wallet",
"NO_BANK_AVAILABLE": "No bank available",
"ENTER_VALID_AMOUNT": "Enter a valid amount",
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",

View File

@ -38,6 +38,7 @@
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
"DESTINATAIRE": "Destinataire",
"ERROR_LABEL": "Erreur",
"NO_BANK_AVAILABLE": "Aucune banque disponible",
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
"SUCCESS": "Succès",
"ETAT": "Etat",

View File

@ -0,0 +1,51 @@
import {
GET_BANK_LIST_ERROR,
GET_BANK_LIST_PENDING,
GET_BANK_LIST_RESET,
GET_BANK_LIST_SUCCESS
} from "../types/BankType";
import {
ENVOIE_WALLET_TO_BANK_USER_ERROR,
ENVOIE_WALLET_TO_BANK_USER_PENDING,
ENVOIE_WALLET_TO_BANK_USER_RESET,
ENVOIE_WALLET_TO_BANK_USER_SUCCESS
} from "../types/EnvoieUserType";
export const fetchGetBankListPending = () => ({
type: GET_BANK_LIST_PENDING
});
export const fetchGetBankListSucsess = (res) => ({
type: GET_BANK_LIST_SUCCESS,
result: res,
});
export const fetchGetBankListError = (error) => ({
type: GET_BANK_LIST_ERROR,
result: error
});
export const fetchGetBankListReset = () => ({
type: GET_BANK_LIST_RESET
});
export const fetchEnvoieWalletToBankUserPending = () => ({
type: ENVOIE_WALLET_TO_BANK_USER_PENDING
});
export const fetchEnvoieWalletToBankUserSucsess = (res) => ({
type: ENVOIE_WALLET_TO_BANK_USER_SUCCESS,
result: res,
});
export const fetchEnvoieWalletToBankUserError = (error) => ({
type: ENVOIE_WALLET_TO_BANK_USER_ERROR,
result: error
});
export const fetchEnvoieWalletToBankUserReset = () => ({
type: ENVOIE_WALLET_TO_BANK_USER_RESET
});

View File

@ -0,0 +1,42 @@
import {
ENVOIE_WALLET_TO_BANK_USER_ERROR,
ENVOIE_WALLET_TO_BANK_USER_PENDING,
ENVOIE_WALLET_TO_BANK_USER_RESET,
ENVOIE_WALLET_TO_BANK_USER_SUCCESS
} from "../types/EnvoieUserType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case ENVOIE_WALLET_TO_BANK_USER_PENDING:
return {
...state,
loading: true
}
case ENVOIE_WALLET_TO_BANK_USER_SUCCESS:
return {
...state,
loading: false,
result: action.result.data,
error: null
}
case ENVOIE_WALLET_TO_BANK_USER_ERROR:
return {
...state,
loading: false,
result: null,
error: action.result
}
case ENVOIE_WALLET_TO_BANK_USER_RESET:
return initialState;
default: {
return state;
}
}
};

View File

@ -0,0 +1,42 @@
import {
GET_BANK_LIST_ERROR,
GET_BANK_LIST_PENDING,
GET_BANK_LIST_RESET,
GET_BANK_LIST_SUCCESS
} from "../types/BankType";
const initialState = {
loading: false,
result: null,
error: null
};
export default (state = initialState, action) => {
switch (action.type) {
case GET_BANK_LIST_PENDING:
return {
...state,
loading: true
}
case GET_BANK_LIST_SUCCESS:
return {
...state,
loading: false,
result: action.result.data,
error: null
}
case GET_BANK_LIST_ERROR:
return {
...state,
loading: false,
result: null,
error: action.result
}
case GET_BANK_LIST_RESET:
return initialState;
default: {
return state;
}
}
};

View File

@ -1,5 +1,5 @@
import { AsyncStorage } from "react-native";
import { persistCombineReducers } from "redux-persist";
import {AsyncStorage} from "react-native";
import {persistCombineReducers} from "redux-persist";
import ActiveCountryListReducer from "./ActiveCountryListReducer";
import AskNanoCreditReducer from "./AskNanoCreditReducer";
import authKeyReducer from "./AuthKeyReducer";
@ -42,58 +42,61 @@ import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
import GetHyperSuperHistoryReducer from "./GetHyperSuperHistoryReducer";
import GetBankListReducer from "./GetBankListReducer";
import EnvoieUserWalletToBank from "./EnvoieUserWalletToBankReducer";
const persistConfig = {
key: 'root',
storage: AsyncStorage,
whitelist: ['authKeyReducer'],
blacklist: []
key: 'root',
storage: AsyncStorage,
whitelist: ['authKeyReducer'],
blacklist: []
};
const rootReducer = persistCombineReducers(persistConfig, {
walletReducer: walletReducer,
walletDetailReducer: walletDetailReducer,
authKeyReducer: authKeyReducer,
depositReducer: depositReducer,
walletHistoryReducer: walletHistoryReducer,
walletTransferCommissionReducer: walletTransferCommissionReducer,
creditTreatDemandReducer: creditTreatDemandReducer,
creditCancelDemandReducer: creditCancelDemandReducer,
walletGetCommission: WalletGetCommissionReducer,
createIdentificationReducer: CreateIdentificationReducer,
getNumberInformationReducer: GetNumberInformation,
getUserIdentificationReducer: GetUserIdentificationReducer,
validateIdentificationReducer: ValidateIdentificationReducer,
payCountryNetworkReducer: PayCountryNetworkReducer,
activeCountryListReducer: ActiveCountryListReducer,
countryByDialCode: CountryByDialCodeReducer,
envoieUserWalletToWalletReducer: EnvoieUserWalletToWalletReducer,
envoieUserWalletToWalletGetCommissionReducer: EnvoieUserWalletToWalletGetCommissionReducer,
countryByDialCode: CountryByDialCodeReducer,
envoieUserWalletToCashReducer: EnvoieUserWalletToCashReducer,
envoieUserWalletToCashGetCommissionReducer: EnvoieUserWalletToCashGetCommissionReducer,
envoieUserWalletToCardReducer: EnvoieUserWalletToCardReducer,
envoieUserWalletToCardGetCommissionReducer: EnvoieUserWalletToCardGetCommissionReducer,
linkCardReduder: LinkCardReducer,
retraitCashAgentIdVerificationReducer: RetraitCashAgentIdVerificationReducer,
createGroupReducer: CreateGroupReducer,
saveOnesignalReducer: SaveOnesignalReducer,
getDemandsGroupReducer: GetDemandsGroupReducer,
getUniqueDemandsGroupReducer: GetUniqueDemandsGroupReducer,
treatDemandGroupReducer: TreatDemandGroupReducer,
joinGroupReducer: JoinGroupReducer,
getUserGroupDetailReducer: GetUserGroupDetailReducer,
getNotificationReducer: GetNotificationReducer,
askNanoCreditReducer: AskNanoCreditReducer,
getNanoCreditDemandDurationReducer: GetNanoCreditDemandDurationReducer,
cautionCreditDemandAgentReducer: CautionCreditDemandAgentReducer,
refundCreditDemandReducer: RefundCreditDemandUserReducer,
getNanoCreditDemandDetailReducer: GetNanoCreditDemandDetailReducer,
epargnerArgentUserReducer: EpargnerArgentUserReducer,
casserEpargneUserReducer: CasserEpargneUserReducer,
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer
walletReducer: walletReducer,
walletDetailReducer: walletDetailReducer,
authKeyReducer: authKeyReducer,
depositReducer: depositReducer,
walletHistoryReducer: walletHistoryReducer,
walletTransferCommissionReducer: walletTransferCommissionReducer,
creditTreatDemandReducer: creditTreatDemandReducer,
creditCancelDemandReducer: creditCancelDemandReducer,
walletGetCommission: WalletGetCommissionReducer,
createIdentificationReducer: CreateIdentificationReducer,
getNumberInformationReducer: GetNumberInformation,
getUserIdentificationReducer: GetUserIdentificationReducer,
validateIdentificationReducer: ValidateIdentificationReducer,
payCountryNetworkReducer: PayCountryNetworkReducer,
activeCountryListReducer: ActiveCountryListReducer,
countryByDialCode: CountryByDialCodeReducer,
envoieUserWalletToWalletReducer: EnvoieUserWalletToWalletReducer,
envoieUserWalletToWalletGetCommissionReducer: EnvoieUserWalletToWalletGetCommissionReducer,
envoieUserWalletToCashReducer: EnvoieUserWalletToCashReducer,
envoieUserWalletToCashGetCommissionReducer: EnvoieUserWalletToCashGetCommissionReducer,
envoieUserWalletToCardReducer: EnvoieUserWalletToCardReducer,
envoieUserWalletToCardGetCommissionReducer: EnvoieUserWalletToCardGetCommissionReducer,
linkCardReduder: LinkCardReducer,
retraitCashAgentIdVerificationReducer: RetraitCashAgentIdVerificationReducer,
createGroupReducer: CreateGroupReducer,
saveOnesignalReducer: SaveOnesignalReducer,
getDemandsGroupReducer: GetDemandsGroupReducer,
getUniqueDemandsGroupReducer: GetUniqueDemandsGroupReducer,
treatDemandGroupReducer: TreatDemandGroupReducer,
joinGroupReducer: JoinGroupReducer,
getUserGroupDetailReducer: GetUserGroupDetailReducer,
getNotificationReducer: GetNotificationReducer,
askNanoCreditReducer: AskNanoCreditReducer,
getNanoCreditDemandDurationReducer: GetNanoCreditDemandDurationReducer,
cautionCreditDemandAgentReducer: CautionCreditDemandAgentReducer,
refundCreditDemandReducer: RefundCreditDemandUserReducer,
getNanoCreditDemandDetailReducer: GetNanoCreditDemandDetailReducer,
epargnerArgentUserReducer: EpargnerArgentUserReducer,
casserEpargneUserReducer: CasserEpargneUserReducer,
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer,
getBankListReducer: GetBankListReducer,
envoieUserWalletToBank: EnvoieUserWalletToBank
});
export default rootReducer;

4
redux/types/BankType.js Normal file
View File

@ -0,0 +1,4 @@
export const GET_BANK_LIST_PENDING = 'GET_BANK_LIST_PENDING';
export const GET_BANK_LIST_SUCCESS = 'GET_BANK_LIST_SUCCESS';
export const GET_BANK_LIST_ERROR = 'GET_BANK_LIST_ERROR';
export const GET_BANK_LIST_RESET = 'GET_BANK_LIST_RESET';

View File

@ -26,4 +26,9 @@ export const ENVOIE_WALLET_TO_CARD_USER_RESET = 'ENVOIE_WALLET_TO_CARD_USER_RESE
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_PENDING';
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_SUCCESS';
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_ERROR';
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET';
export const ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET = 'ENVOIE_WALLET_TO_CARD_USER_GET_COMMISSION_RESET';
export const ENVOIE_WALLET_TO_BANK_USER_PENDING = 'ENVOIE_WALLET_TO_BANK_USER_PENDING';
export const ENVOIE_WALLET_TO_BANK_USER_SUCCESS = 'ENVOIE_WALLET_TO_BANK_USER_SUCCESS';
export const ENVOIE_WALLET_TO_BANK_USER_ERROR = 'ENVOIE_WALLET_TO_BANK_USER_ERROR';
export const ENVOIE_WALLET_TO_BANK_USER_RESET = 'ENVOIE_WALLET_TO_BANK_USER_RESET';

View File

@ -43,6 +43,7 @@
"envoieWalletToCardUser": "envoieWalletToCardUser",
"linkCard": "linkCard",
"envoieWalletToBankUser": "envoieWalletToBankUser",
"envoieWalletToBankAgent": "envoieWalletToBankAgent",
"retraitWalletVersCashUser": "retraitWalletVersCashUser",
"retraitCarteVersCashUser": "retraitCarteVersCashUser",
"retraitCarteVersWalletUser": "retraitCarteVersWalletUser",

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { StyleSheet, View, Text, Image, StatusBar, TouchableOpacity, ScrollView, ProgressBarAndroid, Alert } from 'react-native';
let theme = require('./../../utils/theme.json');
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import Icon from 'react-native-vector-icons/MaterialIcons';
import { readUser, deleteUser } from './../../webservice/AuthApi';
import { getAgentNetworksList } from './../../webservice/NetworkApi'
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
@ -184,7 +184,7 @@ export default class UserAccount extends Component {
{this.showPhoneSup()}
<Text style={styles.textInformation2}>
<Icon name={"signal-cellular-4-bar"} size={18} />
<Icon name={"account-balance-wallet"} size={18} />
{" " + this.state.user.network}</Text>
</ScrollView>
</CardView>

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,7 @@ class CreateIdentificationUser extends Component {
townName: null,
country: null,
identityPieces: identityPieces(),
identityPiecesName: (identityPieces()[0]).name,
identityPiecesName: I18n.t((identityPieces()[0]).name),
snackVisible: false,
snackText: '',
disableNetwork: false,
@ -531,8 +531,8 @@ class CreateIdentificationUser extends Component {
onChangeText={(value, index, data) => {
this.setState({ identityPiecesName: value });
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>

View File

@ -70,7 +70,7 @@ class ModifyIdentificationUser extends Component {
townName: null,
country: null,
identityPieces: identityPieces(),
identityPiecesName: (identityPieces()[0]).name,
identityPiecesName: I18n.t((identityPieces()[0]).name),
snackVisible: false,
snackText: '',
disableNetwork: false,
@ -533,8 +533,8 @@ class ModifyIdentificationUser extends Component {
onChangeText={(value, index, data) => {
this.setState({ identityPiecesName: value });
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>

View File

@ -73,7 +73,7 @@ class CreateIdentification extends Component {
townName: null,
country: null,
identityPieces: identityPieces(),
identityPiecesName: (identityPieces()[0]).name,
identityPiecesName: I18n.t((identityPieces()[0]).name),
snackVisible: false,
snackText: '',
disableNetwork: false,
@ -640,8 +640,8 @@ class CreateIdentification extends Component {
onChangeText={(value, index, data) => {
this.setState({ identityPiecesName: value });
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>

View File

@ -69,7 +69,7 @@ class AskNanoCredit extends Component {
isDataSubmit: false,
isModalConfirmVisible: false,
typeCaution: typeCaution(),
typeCautionName: (typeCaution()[0]).name,
typeCautionName: I18n.t((typeCaution()[0]).name),
typeCautionToSend: 'groupe',
wallet: store.getState().walletDetailReducer.result.response
};
@ -273,6 +273,7 @@ class AskNanoCredit extends Component {
}
render() {
console.log(this.state);
return (
<>
{(this.props.loading || this.props.loadingGetNanoCredit || this.state.modalVisible) && this.renderLoader()}
@ -332,10 +333,10 @@ class AskNanoCredit extends Component {
this.setState({
typeCautionToSend: 'groupe',
typeCautionName: I18n.t('GROUP')
})
});
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>

View File

@ -89,6 +89,8 @@ class DemandValidationGroup extends React.Component {
this.props.getNanoCreditDemandsAction(user.id);
});
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
this.props.getNanoCreditDemandsReset();
this.navigation = this.props.navigation
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
@ -107,6 +109,11 @@ class DemandValidationGroup extends React.Component {
};
updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') })
this.forceUpdate()
}
componentDidMount() {
const { routeName } = this.navigation.state
this.setState({

View File

@ -70,7 +70,7 @@ class EpargnerArgentUser extends Component {
isDataSubmit: false,
isModalConfirmVisible: false,
typeEpargne: typeEpargne(),
typeEpargneName: (typeEpargne()[0]).name,
typeEpargneName: I18n.t((typeEpargne()[0]).name),
typeEpargneToSend: 'simple',
wallet: store.getState().walletDetailReducer.result.response
};
@ -314,8 +314,8 @@ class EpargnerArgentUser extends Component {
displayDuration: true
})
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>
@ -340,8 +340,8 @@ class EpargnerArgentUser extends Component {
onChangeText={(value, index, data) => {
this.setState({ durationSelect: value });
}}
valueExtractor={(value) => { return value.value }}
labelExtractor={(value) => { return value.value }}
valueExtractor={(value) => { return I18n.t(value.value) }}
labelExtractor={(value) => { return I18n.t(value.value) }}
/>
</Animatable.View>
}

View File

@ -544,7 +544,7 @@ export default class OptionsMenu extends Component {
text: I18n.t('YES'), onPress: () => {
disconnect().then(() => {
IlinkEmitter.emit("userdisconnect");
AsyncStorage.clear();
//AsyncStorage.clear();
this.props.navigation.navigate("Auth");
})
}

View File

@ -1,238 +1,354 @@
import React, { Component } from 'react';
import { FlatList, Image, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
import React, {Component} from 'react';
import {
ActivityIndicator,
Image,
Platform,
ProgressBarAndroid,
ScrollView,
StatusBar,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native';
import I18n from 'react-native-i18n';
import { Appbar, Provider } from 'react-native-paper';
import {Appbar, Provider} from 'react-native-paper';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { Color } from '../../config/Color';
import { Typography } from '../../config/typography';
import {Color} from '../../config/Color';
import {Typography} from '../../config/typography';
import * as Utils from '../../utils/DeviceUtils';
import { IlinkEmitter } from "../../utils/events";
import {IlinkEmitter} from "../../utils/events";
import {connect} from "react-redux";
import {bindActionCreators} from "redux";
import {getBankListAction, getBankListReset} from "../../webservice/BankApi";
import {store} from "../../redux/store";
import {readUser} from "../../webservice/AuthApi";
const route = require('../../route.json');
let slugify = require('slugify');
export default class OperateurOptionSelect extends Component {
class OperateurOptionSelect extends Component {
constructor(props) {
super(props);
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
console.log("OPERATEUR OPTION PROPS", this.props);
this.state = {
options: this.props.navigation.state.params.optionSelect.options,
title: this.props.navigation.state.params.optionSelect.title,
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
}
constructor(props) {
super(props);
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
console.log("OPERATEUR OPTION PROPS", this.props);
this.state = {
options: this.props.navigation.state.params.optionSelect.options,
title: this.props.navigation.state.params.optionSelect.title,
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
wallet: store.getState().walletDetailReducer.result.response
}
this.props.getBankListReset();
}
updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') })
this.forceUpdate();
}
static navigationOptions = ({ navigation }) => ({
header: null,
headerMode: 'none',
headerTitle: null,
activeColor: '#f0edf6',
inactiveColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' },
drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({ tintColor }) => (
<Icon
name={'credit-card'}
size={24}
/>)
});
redirectToRoute = (item) => {
this.props.navigation.push(item.screen, {
title: item.title,
type: item.type
});
}
renderItem = (item, index) => {
return (
<TouchableOpacity
key={index}
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
onPress={() => {
}}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<View style={styles.iconContent}>
<Image style={{ width: 48, height: 48 }} source={{ uri: item.icon }} />
</View>
<View>
<Text style={Typography.body1}>{item.title}</Text>
<Text style={Typography.footnote}>{item.title}</Text>
</View>
</View>
</TouchableOpacity>
)
}
renderList = () => {
const { options } = this.state;
return (
<ScrollView style={{ flex: 1, padding: 20 }}>
{
options.map((item, index) => (
this.renderItem(item, index)
))
readUser().then((user) => {
if (user) {
if (user !== undefined) {
if (user.category === undefined) {
this.props.getBankListAction(this.state.wallet.id_wallet_network);
} else {
if (user.category === 'geolocated')
this.props.getBankListAction(this.state.wallet.id_network);
}
</ScrollView>
);
}
this.setState({user});
}
}
});
render() {
return (
<Provider>
<View style={{ flex: 1 }}>
}
<StatusBar
backgroundColor={Color.primaryDarkColor}
barStyle="light-content"
translucent={false}
/>
updateLangue() {
this.props.navigation.setParams({name: I18n.t('WALLET')})
this.forceUpdate();
}
<Appbar.Header dark={true} style={{ backgroundColor: Color.primaryColor }}>
<Appbar.BackAction
onPress={() => { this.props.navigation.pop() }}
/>
<Appbar.Content
title={this.state.title}
subtitle={this.state.subTitle}
/>
</Appbar.Header>
static navigationOptions = ({navigation}) => ({
header: null,
headerMode: 'none',
headerTitle: null,
activeColor: '#f0edf6',
inactiveColor: '#3e2465',
barStyle: {backgroundColor: '#694fad'},
drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({tintColor}) => (
<Icon
name={'credit-card'}
size={24}
/>)
});
<View style={styles.container}>
redirectToRoute = (item) => {
this.props.navigation.push(item.screen, {
title: item.title,
type: item.type
});
<FlatList
contentContainerStyle={{
paddingHorizontal: 20,
paddingBottom: 10,
}}
data={this.state.options}
keyExtractor={(item, index) => index.toString()}
renderItem={({ item, index }) => (
<TouchableOpacity
style={[styles.item, { borderBottomColor: Color.borderColor }]}
onPress={() => {
this.redirectToRoute(item);
}}>
<View style={{ flexDirection: 'row' }}>
<Image style={{ width: 30, height: 30 }} source={{ uri: item.icon }} />
}
<Text style={[Typography.body1]}>{item.title}</Text>
</View>
<Icon
name="chevron-right"
size={20}
color={Color.primaryColor}
enableRTL={true}
/>
</TouchableOpacity>
)}
/>
renderLoader = () => {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android'
?
(
<>
<ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text>
</View>
</>
) :
<>
<ActivityIndicator size="large" color={'#ccc'}/>
<Text>{I18n.t('LOADING_DOTS')}</Text>
</>
}
</View>
)
}
renderItem = (item, index) => {
return (
<TouchableOpacity
key={index}
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
onPress={() => {
if (this.state.user.category === 'geolocated')
this.props.navigation.navigate(route.envoieWalletToBankAgent, {bank: item});
else
this.props.navigation.navigate(route.envoieWalletToBankUser, {bank: item});
}}>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<View>
<Text style={Typography.body1}>{item.bank_name}</Text>
<Text style={[Typography.footnote, Color.grayColor]} style={{marginTop: 5}}>
{I18n.t('COUNTRY')}: {item.country}
</Text>
</View>
</View>
</TouchableOpacity>
)
}
renderBankList = () => {
const {result, error} = this.props;
if (error !== null) {
if (typeof error.data !== 'undefined') {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{error.data.error}</Text>
</View>
)
} else {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{error}</Text>
</View>
)
}
}
if (result !== null) {
if (result.response !== null) {
return (
Array.isArray(result.response) && (result.response.length) > 0 ?
(<ScrollView style={{flex: 1, padding: 20}}>
{
result.response.map((item, index) => (
this.renderItem(item, index)
))
}
</ScrollView>) :
(
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{I18n.t('NO_BANK_AVAILABLE')}</Text>
</View>
)
)
}
}
}
renderItemElement = (item, index) => {
return (
<TouchableOpacity
key={index}
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
onPress={() => {
}}>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<View style={styles.iconContent}>
<Image style={{width: 48, height: 48}} source={{uri: item.icon}}/>
</View>
<View>
<Text style={Typography.body1}>{item.title}</Text>
<Text style={Typography.footnote}>{item.title}</Text>
</View>
</View>
</TouchableOpacity>
)
}
renderList = () => {
const {options} = this.state;
return (
<ScrollView style={{flex: 1, padding: 20}}>
{
options.map((item, index) => (
this.renderItemElement(item, index)
))
}
</ScrollView>
);
}
render() {
console.log("OPERATEUR OPTION STATE", this.state.options.length);
return (
<Provider>
<View style={{flex: 1}}>
<StatusBar
backgroundColor={Color.primaryDarkColor}
barStyle="light-content"
translucent={false}
/>
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
<Appbar.BackAction
onPress={() => {
this.props.navigation.pop()
}}
/>
<Appbar.Content
title={I18n.t(this.state.title)}
subtitle={I18n.t(this.state.subTitle)}
/>
</Appbar.Header>
<View style={styles.container}>
{
this.state.options.length > 0 ?
this.renderList()
:
this.props.loading ?
this.renderLoader() :
this.props.result != null ?
this.renderBankList() :
null
}
</View>
</Provider>
);
}
</View>
</Provider>
);
}
}
const mapStateToProps = state => ({
loading: state.getBankListReducer.loading,
result: state.getBankListReducer.result,
error: state.getBankListReducer.error,
});
const mapDispatchToProps = dispatch => bindActionCreators({
getBankListAction,
getBankListReset
}, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(OperateurOptionSelect);
const styles = StyleSheet.create({
container: {
flex: 1,
},
paymentItem: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
borderBottomWidth: 1,
paddingVertical: 5,
width: "100%",
marginBottom: 15
},
iconContent: {
width: 60,
marginRight: 10,
alignItems: "center"
},
item: {
paddingVertical: 15,
borderBottomWidth: 1,
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center"
},
/* item: {
paddingVertical: 15,
borderBottomWidth: 1,
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center"
}, */
lottie: {
width: 540,
height: 240
},
checkDefault: {
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
borderBottomWidth: 1,
paddingVertical: 10,
marginTop: 5
},
transactionContainer: {
flexDirection: 'row',
paddingTop: 10,
},
containerTouch: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
shadowColor: Color.borderColor,
borderColor: Color.borderColor,
borderWidth: 0.5,
shadowOffset: { width: 1.5, height: 1.5 },
shadowOpacity: 1.0,
elevation: 5,
borderRadius: 10,
backgroundColor: Color.cardBackgroundColor
},
container: {
flex: 1,
},
paymentItem: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
borderBottomWidth: 1,
paddingVertical: 5,
width: "100%",
marginBottom: 15
},
iconContent: {
width: 60,
marginRight: 10,
alignItems: "center"
},
item: {
paddingVertical: 15,
borderBottomWidth: 1,
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center"
},
/* item: {
paddingVertical: 15,
borderBottomWidth: 1,
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center"
}, */
lottie: {
width: 540,
height: 240
},
checkDefault: {
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
borderBottomWidth: 1,
paddingVertical: 10,
marginTop: 5
},
transactionContainer: {
flexDirection: 'row',
paddingTop: 10,
},
containerTouch: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
shadowColor: Color.borderColor,
borderColor: Color.borderColor,
borderWidth: 0.5,
shadowOffset: {width: 1.5, height: 1.5},
shadowOpacity: 1.0,
elevation: 5,
borderRadius: 10,
backgroundColor: Color.cardBackgroundColor
},
contain: {
flexDirection: 'row',
justifyContent: 'space-between',
},
imageBanner: {
marginTop: 15,
marginLeft: 5,
width: Utils.scaleWithPixel(30),
height: Utils.scaleWithPixel(30)
},
content: {
height: Utils.scaleWithPixel(60),
paddingHorizontal: 10,
justifyContent: 'space-between',
alignItems: 'flex-start',
flex: 1,
},
contentTitle: {
paddingTop: 12,
}
contain: {
flexDirection: 'row',
justifyContent: 'space-between',
},
imageBanner: {
marginTop: 15,
marginLeft: 5,
width: Utils.scaleWithPixel(30),
height: Utils.scaleWithPixel(30)
},
content: {
height: Utils.scaleWithPixel(60),
paddingHorizontal: 10,
justifyContent: 'space-between',
alignItems: 'flex-start',
flex: 1,
},
contentTitle: {
paddingTop: 12,
}
});

View File

@ -442,7 +442,7 @@ class WalletDepot extends Component {
})
}}
valueExtractor={(value) => value.value}
labelExtractor={(value) => value.name}
labelExtractor={(value) => I18n.t(value.name)}
/>
</View>

View File

@ -510,7 +510,7 @@ class WalletDetail extends Component {
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
<Dialog.Title>Détail de l'historique</Dialog.Title>
<Dialog.Title>{I18n.t('HISTORY_DETAIL')}</Dialog.Title>
<View>
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
@ -659,7 +659,7 @@ class WalletDetail extends Component {
<Dialog.Container useNativeDriver={true} visible={this.state.displaySuperHyperModalHistory}>
<Dialog.Title>Détail de l'historique</Dialog.Title>
<Dialog.Title>{I18n.t('HISTORY_DETAIL')}</Dialog.Title>
{isEqual(historyItemDetail.type_historique, 'N') &&
<ScrollView persistentScrollbar={true}>
@ -669,7 +669,7 @@ class WalletDetail extends Component {
<Text style={[styles.body2]}>Type</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
@ -1022,7 +1022,7 @@ class WalletDetail extends Component {
<View style={{ alignItems: 'center' }} key={index}>
<Icon name={item.icon} size={24} color={Color.primaryColor} />
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
{item.label}
{I18n.t(item.label)}
</Text>
</View>
))
@ -1489,7 +1489,7 @@ class WalletDetail extends Component {
<View style={{ alignItems: 'center' }} key={index}>
<Icon name={item.icon} size={24} color={Color.primaryColor} />
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
{item.label}
{I18n.t(item.label)}
</Text>
</View>
))

File diff suppressed because it is too large Load Diff

View File

@ -124,7 +124,7 @@ class WalletOptionSelect extends Component {
}
updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') })
this.props.navigation.setParams({ name: I18n.t('WALLET') });
this.forceUpdate()
}
@ -221,7 +221,7 @@ class WalletOptionSelect extends Component {
<View style={styles.contentTitle}>
<Text style={[Typography.headline, Typography.semibold]}>
{options.title}
{I18n.t(options.title)}
</Text>
</View>
@ -267,7 +267,7 @@ class WalletOptionSelect extends Component {
<View style={styles.contentTitle}>
<Text style={[Typography.headline, Typography.semibold]}>
{options.title}
{I18n.t(options.title)}
</Text>
</View>
@ -388,7 +388,7 @@ class WalletOptionSelect extends Component {
<View style={{ alignItems: 'center' }} key={index}>
<Icon name={item.icon} size={24} color={Color.primaryColor} />
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
{item.label}
{I18n.t(item.label)}
</Text>
</View>
))
@ -459,7 +459,7 @@ class WalletOptionSelect extends Component {
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
<Dialog.Title>Détail de l'historique</Dialog.Title>
<Dialog.Title>{I18n.t('HISTORY_DETAIL')}</Dialog.Title>
{
isNil(this.state.user.category) ?
isEqual(historyItemDetail.type_historique, 'N') ?
@ -470,7 +470,7 @@ class WalletOptionSelect extends Component {
<Text style={[styles.body2]}>Type</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
@ -586,7 +586,7 @@ class WalletOptionSelect extends Component {
<Text style={[styles.body2]}>Type</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
@ -678,7 +678,7 @@ class WalletOptionSelect extends Component {
<Text style={[styles.body2]}>Type</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
@ -853,8 +853,8 @@ class WalletOptionSelect extends Component {
onPress={() => { this.props.navigation.pop() }}
/>
<Appbar.Content
title={this.state.title}
subtitle={this.state.subTitle}
title={I18n.t(this.state.title)}
subtitle={I18n.t(this.state.subTitle)}
/>
</Appbar.Header>

View File

@ -1,239 +1,250 @@
import React, { Component } from 'react';
import { StyleSheet, View, Image, StatusBar, Alert, ScrollView, TouchableOpacity, ActivityIndicator, Platform, ProgressBarAndroid, Text } from 'react-native';
import React, {Component} from 'react';
import {
ActivityIndicator,
Image,
Platform,
ProgressBarAndroid,
ScrollView,
StatusBar,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import I18n from 'react-native-i18n'
import {Color} from '../../config/Color';
import {baseUrl} from '../../webservice/IlinkConstants';
import {IlinkEmitter} from "../../utils/events";
import {Appbar, Provider} from 'react-native-paper';
import {getWalletActivated} from '../../webservice/WalletApi';
import {connect} from 'react-redux';
import {readUser} from '../../webservice/AuthApi';
import {bindActionCreators} from 'redux';
import {Typography} from '../../config/typography';
const route = require('./../../route.json');
let slugify = require('slugify');
import I18n from 'react-native-i18n'
import * as Utils from '../../utils/DeviceUtils';
import { Images } from '../../config/Images';
import { Color } from '../../config/Color';
import { baseUrl } from '../../webservice/IlinkConstants';
import { IlinkEmitter } from "../../utils/events";
import { Provider, Appbar } from 'react-native-paper';
import { getWalletActivated } from '../../webservice/WalletApi';
import { connect } from 'react-redux';
import { readUser } from '../../webservice/AuthApi';
import { bindActionCreators } from 'redux';
import { FontWeight, Typography } from '../../config/typography';
class WalletSelect extends Component {
constructor(props) {
super(props);
slugify.extend({ '+': 'plus' });
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
this.state = {
result: null,
isDataLoaded: false,
agentId: null
}
constructor(props) {
super(props);
slugify.extend({'+': 'plus'});
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
this.state = {
result: null,
isDataLoaded: false,
agentId: null
}
}
}
static navigationOptions = ({ navigation }) => ({
header: null,
headerMode: 'none',
headerTitle: null,
activeColor: '#f0edf6',
inactiveColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' },
drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({ tintColor }) => (
<Icon
name={'credit-card'}
size={24}
/>)
});
static navigationOptions = ({navigation}) => ({
header: null,
headerMode: 'none',
headerTitle: null,
activeColor: '#f0edf6',
inactiveColor: '#3e2465',
barStyle: {backgroundColor: '#694fad'},
drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({tintColor}) => (
<Icon
name={'credit-card'}
size={24}
/>)
});
componentDidMount() {
componentDidMount() {
readUser().then((user) => {
if (user) {
if (user !== undefined) {
if (user.phone !== undefined) {
this.props.getWalletActivated(user.agentId);
this.setState({ agentId: user.agentId });
}
readUser().then((user) => {
if (user) {
if (user !== undefined) {
if (user.phone !== undefined) {
this.props.getWalletActivated(user.agentId);
this.setState({agentId: user.agentId});
}
}
});
}
}
});
}
}
/* refresh() {
readUser().then((user) => {
if (user) {
if (user !== undefined) {
if (user.phone !== undefined) {
this.props.getWalletActivated(user.agentId);
this.setState({ agentId: user.agentId });
}
}
}
});
} */
/* refresh() {
readUser().then((user) => {
if (user) {
if (user !== undefined) {
if (user.phone !== undefined) {
this.props.getWalletActivated(user.agentId);
this.setState({ agentId: user.agentId });
}
}
}
});
} */
updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') })
this.forceUpdate()
}
updateLangue() {
this.props.navigation.setParams({name: I18n.t('WALLET')})
this.forceUpdate()
}
renderLoader = () => {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
{Platform.OS === 'android'
?
(
<>
<ProgressBarAndroid />
<Text>{I18n.t('LOADING_DOTS')}</Text>
renderLoader = () => {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android'
?
(
<>
<ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text>
</>
) :
<>
<ActivityIndicator size="large" color={'#ccc'} />
<Text>{I18n.t('LOADING_DOTS')}</Text>
</>
}
</View>
)
}
</>
) :
<>
<ActivityIndicator size="large" color={'#ccc'}/>
<Text>{I18n.t('LOADING_DOTS')}</Text>
</>
}
</View>
)
}
renderWalletItem = (item) => {
let icon = `${baseUrl}/datas/img/network/${slugify(item.network, { lower: true })}-logo.png`;
let itemToSend = item;
itemToSend.agentId = this.state.agentId;
return (
renderWalletItem = (item) => {
let icon = `${baseUrl}/datas/img/network/${slugify(item.network, {lower: true})}-logo.png`;
let itemToSend = item;
itemToSend.agentId = this.state.agentId;
return (
<TouchableOpacity
key={item.id}
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
onPress={() => this.props.navigation.navigate('walletDetail', {
wallet: itemToSend,/*
<TouchableOpacity
key={item.id}
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
onPress={() => this.props.navigation.navigate('walletDetail', {
wallet: itemToSend,/*
onRefreshDetail: () => this.refresh() */
})}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<View style={styles.iconContent}>
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} />
</View>
<View>
<Text style={Typography.body1}>{item.network}</Text>
<Text style={[Typography.footnote, Color.grayColor]} style={{ marginTop: 5 }}>
{I18n.t('COUNTRY')}: {item.country}
</Text>
</View>
})}>
<View style={{flexDirection: 'row', alignItems: 'center'}}>
<View style={styles.iconContent}>
<Image style={{width: 48, height: 48}} source={{uri: icon}}/>
</View>
</TouchableOpacity>
)
}
renderWalletList = () => {
const { result, error } = this.props;
if (error !== null) {
if (typeof error.data !== 'undefined') {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text style={Typography.body1}>{error.data.error}</Text>
</View>
)
}
else {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text style={Typography.body1}>{error}</Text>
</View>
)
}
}
if (result !== null) {
if (result.response !== null) {
return (
Array.isArray(result.response) && (result.response.length) > 0 ?
(<ScrollView style={{ flex: 1, padding: 20 }}>
{
result.response.map((item) => (
this.renderWalletItem(item)
))
}
</ScrollView>) :
(
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
</View>
)
)
}
}
}
render() {
console.log("WALLET PROPS", this.props);
return (
<Provider>
<View style={{ flex: 1 }}>
<StatusBar
backgroundColor={Color.primaryDarkColor}
barStyle="light-content"
translucent={false}
/>
<Appbar.Header dark={true} style={{ backgroundColor: Color.primaryColor }}>
<Appbar.BackAction
onPress={() => { this.props.navigation.pop() }}
/>
<Appbar.Content
title={I18n.t('WALLET')}
subtitle={I18n.t('SELECT_YOUR_WALLET')}
/>
</Appbar.Header>
{
this.props.loading ?
this.renderLoader() :
this.renderWalletList()
}
<View>
<Text style={Typography.body1}>{item.network}</Text>
<Text style={[Typography.footnote, Color.grayColor]} style={{marginTop: 5}}>
{I18n.t('COUNTRY')}: {item.country}
</Text>
</View>
</Provider>
);
}
</View>
</TouchableOpacity>
)
}
renderWalletList = () => {
const {result, error} = this.props;
if (error !== null) {
if (typeof error.data !== 'undefined') {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{error.data.error}</Text>
</View>
)
} else {
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{error}</Text>
</View>
)
}
}
if (result !== null) {
if (result.response !== null) {
return (
Array.isArray(result.response) && (result.response.length) > 0 ?
(<ScrollView style={{flex: 1, padding: 20}}>
{
result.response.map((item) => (
this.renderWalletItem(item)
))
}
</ScrollView>) :
(
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{I18n.t('NO_WALLET_ACTIVED')}</Text>
</View>
)
)
}
}
}
render() {
console.log("WALLET PROPS", this.props);
return (
<Provider>
<View style={{flex: 1}}>
<StatusBar
backgroundColor={Color.primaryDarkColor}
barStyle="light-content"
translucent={false}
/>
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>
<Appbar.BackAction
onPress={() => {
this.props.navigation.pop()
}}
/>
<Appbar.Content
title={I18n.t('WALLET')}
subtitle={I18n.t('SELECT_YOUR_WALLET')}
/>
</Appbar.Header>
{
this.props.loading ?
this.renderLoader() :
this.renderWalletList()
}
</View>
</Provider>
);
}
}
const mapStateToProps = state => ({
loading: state.walletReducer.loading,
result: state.walletReducer.result,
error: state.walletReducer.error
loading: state.walletReducer.loading,
result: state.walletReducer.result,
error: state.walletReducer.error
});
const mapDispatchToProps = dispatch => bindActionCreators({
getWalletActivated
getWalletActivated
}, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(WalletSelect);
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Color.containerBackgroundColor,
},
paymentItem: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
borderBottomWidth: 1,
paddingVertical: 5,
width: "100%",
marginBottom: 15
},
iconContent: {
width: 60,
marginRight: 10,
alignItems: "center"
}
container: {
flex: 1,
backgroundColor: Color.containerBackgroundColor,
},
paymentItem: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
borderBottomWidth: 1,
paddingVertical: 5,
width: "100%",
marginBottom: 15
},
iconContent: {
width: 60,
marginRight: 10,
alignItems: "center"
}
});

View File

@ -56,7 +56,7 @@ class EnvoiCashVersCashAgent extends Component {
super(props);
this.state = {
identityPiecesEmetteur: identityPieces(),
identityPiecesNameEmetteur: (identityPieces()[0]).name,
identityPiecesNameEmetteur: I18n.t((identityPieces()[0]).name),
paysDestination: [],
paysDestinationSelect: null,
walletActifs: [],
@ -559,8 +559,8 @@ class EnvoiCashVersCashAgent extends Component {
onChangeText={(value, index, data) => {
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false });
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,470 @@
import Button from 'apsl-react-native-button';
import isEqual from 'lodash/isEqual';
import isNil from 'lodash/isNil';
import React, {Component} from 'react';
import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
import * as Animatable from 'react-native-animatable';
import I18n from 'react-native-i18n';
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import {ProgressDialog} from 'react-native-simple-dialogs';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import {Fumi} from 'react-native-textinput-effects';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {Color} from '../../../config/Color';
import {FontWeight, Typography} from '../../../config/typography';
import {store} from "../../../redux/store";
import {IlinkEmitter} from '../../../utils/events';
import {readUser} from '../../../webservice/AuthApi';
import {envoieUserWalletToBankAction, envoieUserWalletToBankReset} from '../../../webservice/EnvoieUserApi';
import {isNormalInteger} from '../../../utils/UtilsFunction';
let theme = require('../../../utils/theme.json');
let route = require('../../../route.json');
class EnvoieWalletToBankAgent extends Component {
static navigatorStyle = {
navBarBackgroundColor: Color.primaryColor,
statusBarColor: Color.primaryDarkColor,
navBarTextColor: '#FFFFFF',
navBarButtonColor: '#FFFFFF'
};
static navigationOptions = () => {
return {
drawerLabel: () => null,
headerTitle: I18n.t('DEPOSIT_WALLET_TO_BANK'),
headerTintColor: 'white',
headerStyle: {
backgroundColor: Color.primaryColor,
marginTop: 0,
color: 'white'
},
headerTitleStyle: {
color: "white"
},
title: I18n.t('DEPOSIT_WALLET_TO_BANK')
}
};
constructor(props) {
super(props);
this.state = {
montant: null,
password: null,
codeIban: null,
loading: false,
user: null,
triggerSubmitClick: false,
isSubmitClick: false,
isDataSubmit: false,
isModalConfirmVisible: false,
wallet: store.getState().walletDetailReducer.result.response,
bank: this.props.navigation.state.params.bank
};
this.props.envoieUserWalletToBankReset();
}
componentDidMount() {
readUser().then((user) => {
if (user) {
if (user !== undefined) {
this.setState({user});
}
}
});
}
componentWillReceiveProps(nextProps) {
console.log('PROPS', nextProps)
/* if (nextProps.resultEnvoieWalletToCardGetCommission != null) {
if (typeof nextProps.resultEnvoieWalletToCardGetCommission.response !== 'undefined') {
if (!nextProps.loadingEnvoieWalletToCardGetCommission)
this.setState({
isModalConfirmVisible: true
});
}
}*/
}
renderEnvoieWalletToBankResponse = () => {
const {resultEnvoieWalletToBank, errorEnvoieWalletToBank} = this.props;
if (errorEnvoieWalletToBank !== null) {
if (typeof errorEnvoieWalletToBank.data !== 'undefined') {
Alert.alert(
I18n.t("ERROR_TRANSFER"),
errorEnvoieWalletToBank.data.error,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.envoieUserWalletToBankReset();
}
}
],
{cancelable: false}
)
}
}
if (resultEnvoieWalletToBank !== null) {
if (resultEnvoieWalletToBank.response !== null) {
Alert.alert(
I18n.t("SUCCESS_TRANSFER"),
resultEnvoieWalletToBank.response,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.envoieUserWalletToBankReset();
IlinkEmitter.emit("refreshWallet");
this.props.navigation.pop();
}
}
],
{cancelable: false}
)
}
}
}
/* renderDialogGetCommissionResponse = () => {
const { errorEnvoieWalletToCardGetCommission } = this.props;
if (errorEnvoieWalletToCardGetCommission !== null) {
if (typeof errorEnvoieWalletToCardGetCommission.data !== 'undefined') {
Alert.alert(
I18n.t("ERROR_LABLE"),
errorEnvoieWalletToCardGetCommission.data.error,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.getCommissionUserWalletToCardReset();
}
}
],
{ cancelable: false }
)
}
}
}*/
updateLangue() {
this.props.navigation.setParams({name: I18n.t('DEPOSIT_TO_CARD')})
this.forceUpdate()
}
/*
modalConfirmTransaction = (data) => {
const frais = data.response.frais;
const montant_net = data.response.montant_net;
return (
<Dialog.Container useNativeDriver={true} visible={this.state.isModalConfirmVisible}>
<Dialog.Title>{I18n.t('TRANSACTION_DETAIL')}</Dialog.Title>
<View>
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(frais, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
</View>
<View style={{ paddingVertical: 10 }}>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
</View>
</View>
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
this.setState({
isModalConfirmVisible: false
});
}} />
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
this.setState({
isModalConfirmVisible: false,
isDataSubmit: true
});
this.props.envoieUserWalletToCardAction({
type: 2,
cvv: this.state.codeCVV,
id_wallet_user: this.state.wallet.id,
montant: this.state.montant,
password: this.state.password
});
this.props.getCommissionUserWalletToCardReset();
}} />
</Dialog.Container>
);
}
*/
ckeckIfFieldIsOK(champ) {
return (isNil(champ) || isEqual(champ.length, 0));
}
isMontantValid = () => {
const {montant} = this.state;
if ((parseInt(isEqual(montant, 0)) || montant < 0))
return {
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
isValid: false
};
else if (!isNormalInteger(montant))
return {
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
isValid: false
};
else
return {
errorMessage: '',
isValid: true
};
}
onSubmitSendWalletToBank = () => {
const {montant, password, codeIban} = this.state;
if (this.ckeckIfFieldIsOK(codeIban)) {
if (!(codeIban.length >= 14 && codeIban <= 34))
this.codeIbanAnim.shake(800);
else
this.codeIbanAnim.shake(800);
} else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
this.montantAnim.shake(800);
} else if (this.ckeckIfFieldIsOK(password))
this.passwordAnim.shake(800);
else {
console.log("id wallet network", this.state.bank);
this.props.envoieUserWalletToBankAction({
type: 18,
id_wallet_agent: this.state.wallet.id,
id_wallet_network: this.state.wallet.id_network,
iban: codeIban,
id_bank: this.state.bank.id_bank,
montant: montant,
password: password
});
}
this.setState({
isDataSubmit: true
});
}
renderLoader = () => {
return (
<ProgressDialog
visible={this.props.loadingEnvoieWalletToBank}
title={I18n.t('LOADING')}
message={I18n.t('LOADING_INFO')}
/>
)
}
render() {
return (
<>
{this.props.loadingEnvoieWalletToBank && this.renderLoader()}
{this.state.isDataSubmit && this.renderEnvoieWalletToBankResponse()}
<ScrollView style={styles.container}>
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_BANK')}</Text>
<Animatable.View ref={(comp) => {
this.codeIbanAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
label={I18n.t('CODE_IBAN')}
iconColor={'#f95a25'}
iconSize={20}
value={this.state.codeIban}
onChangeText={(codeIban) => {
this.setState({codeIban})
}}
style={styles.input}
>
</Fumi>
</Animatable.View>
<Animatable.View ref={(comp) => {
this.montantAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
label={I18n.t('AMOUNT')}
iconColor={'#f95a25'}
keyboardType='numeric'
iconSize={20}
value={this.state.montant}
onChangeText={(montant) => {
this.setState({montant})
}}
style={styles.input}
>
</Fumi>
<View style={{
position: 'absolute',
left: responsiveWidth(82),
top: 35,
flexDirection: 'row'
}}>
<View
style={{
width: 1,
borderLeftColor: '#f0f0f0',
height: 40,
left: -8,
top: -10,
borderLeftWidth: 1,
}}
/>
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
</View>
</Animatable.View>
<Animatable.View ref={(comp) => {
this.passwordAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
label={I18n.t('PASSWORD')}
iconColor={'#f95a25'}
iconSize={20}
secureTextEntry={true}
value={this.state.password}
onChangeText={(password) => {
this.setState({password})
}}
style={styles.input}
>
</Fumi>
</Animatable.View>
<Button style={styles.btnvalide}
textStyle={styles.textbtnvalide}
onPress={() => {
this.onSubmitSendWalletToBank()
}}>
{I18n.t('SUBMIT_LABEL')}</Button>
</ScrollView>
</>
)
}
}
const maptStateToProps = state => ({
loadingEnvoieWalletToBank: state.envoieUserWalletToBank.loading,
resultEnvoieWalletToBank: state.envoieUserWalletToBank.result,
errorEnvoieWalletToBank: state.envoieUserWalletToBank.error,
});
const mapDispatchToProps = dispatch => bindActionCreators({
envoieUserWalletToBankAction,
envoieUserWalletToBankReset,
}, dispatch);
export default connect(maptStateToProps, mapDispatchToProps)(EnvoieWalletToBankAgent);
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Color.primaryDarkColor,
},
textbtnvalide: {
color: 'white',
fontWeight: 'bold'
},
bigtitle: {
color: 'white',
fontSize: 20,
flex: 1,
fontWeight: 'bold',
textAlign: 'center',
margin: 20,
},
blockView: {
paddingVertical: 10,
borderBottomWidth: 1
},
subbigtitle: {
color: 'white',
fontSize: 17,
textAlign: 'center',
margin: 5,
},
btnvalide: {
marginTop: 20,
marginLeft: 20,
marginRight: 20,
borderColor: 'transparent',
backgroundColor: Color.accentLightColor,
height: 52
},
btnSubmit: {
marginTop: 20,
borderColor: 'transparent',
backgroundColor: Color.accentLightColor,
height: 52,
width: "30%",
marginLeft: 20,
marginRight: 20,
},
input: {
height: 60,
marginTop: responsiveHeight(2),
marginLeft: responsiveWidth(5),
marginRight: responsiveWidth(5),
borderRadius: 5,
}
});

View File

@ -1,466 +1,469 @@
import Button from 'apsl-react-native-button';
import isEqual from 'lodash/isEqual';
import isNil from 'lodash/isNil';
import React, { Component } from 'react';
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
import React, {Component} from 'react';
import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
import * as Animatable from 'react-native-animatable';
import Dialog from "react-native-dialog";
import I18n from 'react-native-i18n';
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
import { ProgressDialog } from 'react-native-simple-dialogs';
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import {ProgressDialog} from 'react-native-simple-dialogs';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
import { Fumi } from 'react-native-textinput-effects';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import thousands from 'thousands';
import { Color } from '../../../config/Color';
import { FontWeight, Typography } from '../../../config/typography';
import { store } from "../../../redux/store";
import { IlinkEmitter } from '../../../utils/events';
import { readUser } from '../../../webservice/AuthApi';
import { envoieUserWalletToCardAction, envoieUserWalletToCardReset, getCommissionUserWalletToCardAction, getCommissionUserWalletToCardReset } from '../../../webservice/EnvoieUserApi';
import { isNormalInteger } from '../../../utils/UtilsFunction';
import {Fumi} from 'react-native-textinput-effects';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {Color} from '../../../config/Color';
import {FontWeight, Typography} from '../../../config/typography';
import {store} from "../../../redux/store";
import {IlinkEmitter} from '../../../utils/events';
import {readUser} from '../../../webservice/AuthApi';
import {envoieUserWalletToBankAction, envoieUserWalletToBankReset} from '../../../webservice/EnvoieUserApi';
import {isNormalInteger} from '../../../utils/UtilsFunction';
let theme = require('../../../utils/theme.json');
let route = require('../../../route.json');
class EnvoieWalletToBankUser extends Component {
static navigatorStyle = {
navBarBackgroundColor: Color.primaryColor,
statusBarColor: Color.primaryDarkColor,
navBarTextColor: '#FFFFFF',
navBarButtonColor: '#FFFFFF'
static navigatorStyle = {
navBarBackgroundColor: Color.primaryColor,
statusBarColor: Color.primaryDarkColor,
navBarTextColor: '#FFFFFF',
navBarButtonColor: '#FFFFFF'
};
};
static navigationOptions = () => {
return {
drawerLabel: () => null,
headerTitle: I18n.t('DEPOSIT_WALLET_TO_BANK'),
headerTintColor: 'white',
headerStyle: {
backgroundColor: Color.primaryColor,
marginTop: 0,
color: 'white'
},
headerTitleStyle: {
color: "white"
},
title: I18n.t('ENVOIE_WALLET_TO_BANK')
}
};
static navigationOptions = () => {
return {
drawerLabel: () => null,
headerTitle: I18n.t('DEPOSIT_WALLET_TO_BANK'),
headerTintColor: 'white',
headerStyle: {
backgroundColor: Color.primaryColor,
marginTop: 0,
color: 'white'
},
headerTitleStyle: {
color: "white"
},
title: I18n.t('DEPOSIT_WALLET_TO_BANK')
}
};
constructor(props) {
super(props);
this.state = {
montant: null,
password: null,
codeCVV: null,
loading: false,
user: null,
triggerSubmitClick: false,
isSubmitClick: false,
isDataSubmit: false,
isModalConfirmVisible: false,
wallet: store.getState().walletDetailReducer.result.response
};
constructor(props) {
super(props);
this.state = {
montant: null,
password: null,
codeIban: null,
loading: false,
user: null,
triggerSubmitClick: false,
isSubmitClick: false,
isDataSubmit: false,
isModalConfirmVisible: false,
wallet: store.getState().walletDetailReducer.result.response,
bank: this.props.navigation.state.params.bank
};
this.props.envoieUserWalletToCardReset();
this.props.getCommissionUserWalletToCardReset();
this.props.envoieUserWalletToBankReset();
}
}
componentDidMount() {
componentDidMount() {
readUser().then((user) => {
if (user) {
if (user !== undefined) {
this.setState({ user });
}
}
});
readUser().then((user) => {
if (user) {
if (user !== undefined) {
this.setState({user});
}
}
});
}
}
componentWillReceiveProps(nextProps) {
componentWillReceiveProps(nextProps) {
console.log('PROPS', nextProps)
console.log('PROPS', nextProps)
if (nextProps.resultEnvoieWalletToCardGetCommission != null) {
/* if (nextProps.resultEnvoieWalletToCardGetCommission != null) {
if (typeof nextProps.resultEnvoieWalletToCardGetCommission.response !== 'undefined') {
if (typeof nextProps.resultEnvoieWalletToCardGetCommission.response !== 'undefined') {
if (!nextProps.loadingEnvoieWalletToCardGetCommission)
this.setState({
isModalConfirmVisible: true
});
}
}
}
if (!nextProps.loadingEnvoieWalletToCardGetCommission)
this.setState({
isModalConfirmVisible: true
});
}
}*/
}
renderEnvoieWalletToWalletResponse = () => {
renderEnvoieWalletToBankResponse = () => {
const { resultEnvoieWalletToCard, errorEnvoieWalletToCard } = this.props;
const {resultEnvoieWalletToBank, errorEnvoieWalletToBank} = this.props;
if (errorEnvoieWalletToCard !== null) {
if (typeof errorEnvoieWalletToCard.data !== 'undefined') {
Alert.alert(
I18n.t("ERROR_TRANSFER"),
errorEnvoieWalletToCard.data.error,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.envoieUserWalletToCardReset();
}
}
],
{ cancelable: false }
)
}
}
if (errorEnvoieWalletToBank !== null) {
if (typeof errorEnvoieWalletToBank.data !== 'undefined') {
Alert.alert(
I18n.t("ERROR_TRANSFER"),
errorEnvoieWalletToBank.data.error,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.envoieUserWalletToBankReset();
}
}
],
{cancelable: false}
)
}
}
if (resultEnvoieWalletToCard !== null) {
if (resultEnvoieWalletToCard.response !== null) {
Alert.alert(
I18n.t("SUCCESS_TRANSFER"),
resultEnvoieWalletToCard.response,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.envoieUserWalletToCardReset();
IlinkEmitter.emit("refreshWallet");
this.props.navigation.pop();
}
}
if (resultEnvoieWalletToBank !== null) {
if (resultEnvoieWalletToBank.response !== null) {
Alert.alert(
I18n.t("SUCCESS_TRANSFER"),
resultEnvoieWalletToBank.response,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.envoieUserWalletToBankReset();
IlinkEmitter.emit("refreshWallet");
this.props.navigation.pop();
}
}
],
{ cancelable: false }
)
}
}
}
],
{cancelable: false}
)
}
}
}
renderDialogGetCommissionResponse = () => {
/* renderDialogGetCommissionResponse = () => {
const { errorEnvoieWalletToCardGetCommission } = this.props;
const { errorEnvoieWalletToCardGetCommission } = this.props;
if (errorEnvoieWalletToCardGetCommission !== null) {
if (typeof errorEnvoieWalletToCardGetCommission.data !== 'undefined') {
Alert.alert(
I18n.t("ERROR_LABLE"),
errorEnvoieWalletToCardGetCommission.data.error,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.getCommissionUserWalletToCardReset();
}
}
],
{ cancelable: false }
)
}
}
if (errorEnvoieWalletToCardGetCommission !== null) {
if (typeof errorEnvoieWalletToCardGetCommission.data !== 'undefined') {
Alert.alert(
I18n.t("ERROR_LABLE"),
errorEnvoieWalletToCardGetCommission.data.error,
[
{
text: I18n.t("OK"), onPress: () => {
this.props.getCommissionUserWalletToCardReset();
}
}
],
{ cancelable: false }
)
}
}
}
}*/
updateLangue() {
this.props.navigation.setParams({ name: I18n.t('DEPOSIT_TO_CARD') })
this.forceUpdate()
}
updateLangue() {
this.props.navigation.setParams({name: I18n.t('DEPOSIT_TO_CARD')})
this.forceUpdate()
}
modalConfirmTransaction = (data) => {
/*
modalConfirmTransaction = (data) => {
const frais = data.response.frais;
const montant_net = data.response.montant_net;
const frais = data.response.frais;
const montant_net = data.response.montant_net;
return (
return (
<Dialog.Container useNativeDriver={true} visible={this.state.isModalConfirmVisible}>
<Dialog.Container useNativeDriver={true} visible={this.state.isModalConfirmVisible}>
<Dialog.Title>{I18n.t('TRANSACTION_DETAIL')}</Dialog.Title>
<Dialog.Title>{I18n.t('TRANSACTION_DETAIL')}</Dialog.Title>
<View>
<View>
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(frais, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
</View>
<View style={{ paddingVertical: 10 }}>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
</View>
</View>
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(frais, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
</View>
<View style={{ paddingVertical: 10 }}>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net, ' ')} ${this.state.wallet.currency_code}`}</Text>
</View>
</View>
</View>
</View>
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
this.setState({
isModalConfirmVisible: false
});
}} />
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
this.setState({
isModalConfirmVisible: false,
isDataSubmit: true
});
this.props.envoieUserWalletToCardAction({
type: 2,
cvv: this.state.codeCVV,
id_wallet_user: this.state.wallet.id,
montant: this.state.montant,
password: this.state.password
});
this.props.getCommissionUserWalletToCardReset();
}} />
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
this.setState({
isModalConfirmVisible: false
});
}} />
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
this.setState({
isModalConfirmVisible: false,
isDataSubmit: true
});
this.props.envoieUserWalletToCardAction({
type: 2,
cvv: this.state.codeCVV,
id_wallet_user: this.state.wallet.id,
montant: this.state.montant,
password: this.state.password
});
this.props.getCommissionUserWalletToCardReset();
}} />
</Dialog.Container>
</Dialog.Container>
);
);
}
}
*/
ckeckIfFieldIsOK(champ) {
return (isNil(champ) || isEqual(champ.length, 0));
}
ckeckIfFieldIsOK(champ) {
return (isNil(champ) || isEqual(champ.length, 0));
}
isMontantValid = () => {
const { montant } = this.state;
if ((parseInt(isEqual(montant, 0)) || montant < 0))
return {
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
isValid: false
};
isMontantValid = () => {
const {montant} = this.state;
if ((parseInt(isEqual(montant, 0)) || montant < 0))
return {
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
isValid: false
};
else if (!isNormalInteger(montant))
return {
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
isValid: false
};
else if (!isNormalInteger(montant))
return {
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
isValid: false
};
else
return {
errorMessage: '',
isValid: true
};
}
else
return {
errorMessage: '',
isValid: true
};
}
onSubmitSendWalletToCard = () => {
const { codeCVV, montant, password } = this.state;
onSubmitSendWalletToBank = () => {
const {montant, password, codeIban} = this.state;
if (this.ckeckIfFieldIsOK(codeCVV) && codeCVV === 3)
this.codeCVVAnim.shake(800);
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
this.montantAnim.shake(800);
}
else if (this.ckeckIfFieldIsOK(password))
this.passwordAnim.shake(800);
else {
if (this.ckeckIfFieldIsOK(codeIban)) {
if (!(codeIban.length >= 14 && codeIban <= 34))
this.codeIbanAnim.shake(800);
else
this.codeIbanAnim.shake(800);
} else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
this.montantAnim.shake(800);
} else if (this.ckeckIfFieldIsOK(password))
this.passwordAnim.shake(800);
else {
this.props.getCommissionUserWalletToCardAction({
type: 2,
id_wallet_user: this.state.wallet.id,
montant: this.state.montant,
});
console.log("id wallet network", this.state.bank);
this.props.envoieUserWalletToBankAction({
type: 4,
id_wallet_user: this.state.wallet.id,
id_wallet_network: this.state.wallet.id_wallet_network,
iban: codeIban,
id_bank: this.state.bank.id_bank,
montant: montant,
password: password
});
}
this.setState({
triggerSubmitClick: true
});
}
}
this.setState({
isDataSubmit: true
});
}
renderLoader = () => {
return (
<ProgressDialog
visible={this.props.loadingEnvoieWalletToCard || this.props.loadingEnvoieWalletToCardGetCommission}
title={I18n.t('LOADING')}
message={I18n.t('LOADING_INFO')}
/>
)
}
renderLoader = () => {
return (
<ProgressDialog
visible={this.props.loadingEnvoieWalletToBank}
title={I18n.t('LOADING')}
message={I18n.t('LOADING_INFO')}
/>
)
}
render() {
const { resultEnvoieWalletToCardGetCommission } = this.props;
return (
<>
{(this.props.loadingEnvoieWalletToCard || this.props.loadingEnvoieWalletToCardGetCommission) && this.renderLoader()}
{this.state.isDataSubmit && this.renderEnvoieWalletToWalletResponse()}
{this.state.triggerSubmitClick && this.renderDialogGetCommissionResponse()}
{
(resultEnvoieWalletToCardGetCommission !== null) &&
(typeof resultEnvoieWalletToCardGetCommission.response !== 'undefined') &&
this.modalConfirmTransaction(resultEnvoieWalletToCardGetCommission)
}
<ScrollView style={styles.container}>
render() {
return (
<>
{this.props.loadingEnvoieWalletToBank && this.renderLoader()}
{this.state.isDataSubmit && this.renderEnvoieWalletToBankResponse()}
<ScrollView style={styles.container}>
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_BANK')}</Text>
<Text style={styles.subbigtitle}>{I18n.t('ENVOIE_WALLET_TO_BANK')}</Text>
<Animatable.View ref={(comp) => { this.codeCVVAnim = comp }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
label={I18n.t('CODE_IBAN')}
iconColor={'#f95a25'}
iconSize={20}
value={this.state.codeCVV}
onChangeText={(codeCVV) => {
<Animatable.View ref={(comp) => {
this.codeIbanAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
label={I18n.t('CODE_IBAN')}
iconColor={'#f95a25'}
iconSize={20}
value={this.state.codeIban}
onChangeText={(codeIban) => {
this.setState({ codeCVV })
}}
style={styles.input}
>
</Fumi>
</Animatable.View>
this.setState({codeIban})
}}
style={styles.input}
>
</Fumi>
</Animatable.View>
<Animatable.View ref={(comp) => { this.montantAnim = comp }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
label={I18n.t('AMOUNT')}
iconColor={'#f95a25'}
keyboardType='numeric'
iconSize={20}
value={this.state.montant}
onChangeText={(montant) => {
this.setState({ montant })
}}
style={styles.input}
>
</Fumi>
<View style={{
position: 'absolute',
left: responsiveWidth(82),
top: 35,
flexDirection: 'row'
}}>
<View
style={{
width: 1,
borderLeftColor: '#f0f0f0',
height: 40,
left: -8,
top: -10,
borderLeftWidth: 1,
<Animatable.View ref={(comp) => {
this.montantAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
label={I18n.t('AMOUNT')}
iconColor={'#f95a25'}
keyboardType='numeric'
iconSize={20}
value={this.state.montant}
onChangeText={(montant) => {
this.setState({montant})
}}
style={styles.input}
>
</Fumi>
<View style={{
position: 'absolute',
left: responsiveWidth(82),
top: 35,
flexDirection: 'row'
}}>
<View
style={{
width: 1,
borderLeftColor: '#f0f0f0',
height: 40,
left: -8,
top: -10,
borderLeftWidth: 1,
}}
/>
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
</View>
</Animatable.View>
}}
/>
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
</View>
</Animatable.View>
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
label={I18n.t('PASSWORD')}
iconColor={'#f95a25'}
iconSize={20}
secureTextEntry={true}
value={this.state.password}
onChangeText={(password) => {
this.setState({ password })
}}
style={styles.input}
>
</Fumi>
</Animatable.View>
<Animatable.View ref={(comp) => {
this.passwordAnim = comp
}}>
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
label={I18n.t('PASSWORD')}
iconColor={'#f95a25'}
iconSize={20}
secureTextEntry={true}
value={this.state.password}
onChangeText={(password) => {
this.setState({password})
}}
style={styles.input}
>
</Fumi>
</Animatable.View>
<Button style={styles.btnvalide}
textStyle={styles.textbtnvalide}
onPress={() => { /* this.onSubmitSendWalletToCard(); */ }}>
{I18n.t('SUBMIT_LABEL')}</Button>
</ScrollView>
</>
)
}
<Button style={styles.btnvalide}
textStyle={styles.textbtnvalide}
onPress={() => {
this.onSubmitSendWalletToBank()
}}>
{I18n.t('SUBMIT_LABEL')}</Button>
</ScrollView>
</>
)
}
}
const maptStateToProps = state => ({
loadingEnvoieWalletToCard: state.envoieUserWalletToCardReducer.loading,
resultEnvoieWalletToCard: state.envoieUserWalletToCardReducer.result,
errorEnvoieWalletToCard: state.envoieUserWalletToCardReducer.error,
loadingEnvoieWalletToBank: state.envoieUserWalletToBank.loading,
resultEnvoieWalletToBank: state.envoieUserWalletToBank.result,
errorEnvoieWalletToBank: state.envoieUserWalletToBank.error,
loadingEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.loading,
resultEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.result,
errorEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.error,
});
const mapDispatchToProps = dispatch => bindActionCreators({
envoieUserWalletToCardAction,
envoieUserWalletToCardReset,
getCommissionUserWalletToCardAction,
getCommissionUserWalletToCardReset
envoieUserWalletToBankAction,
envoieUserWalletToBankReset,
}, dispatch);
export default connect(maptStateToProps, mapDispatchToProps)(EnvoieWalletToBankUser);
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Color.primaryDarkColor,
},
textbtnvalide: {
color: 'white',
fontWeight: 'bold'
},
bigtitle: {
color: 'white',
fontSize: 20,
flex: 1,
fontWeight: 'bold',
textAlign: 'center',
margin: 20,
},
blockView: {
paddingVertical: 10,
borderBottomWidth: 1
},
subbigtitle: {
color: 'white',
fontSize: 17,
textAlign: 'center',
margin: 5,
},
btnvalide: {
marginTop: 20,
marginLeft: 20,
marginRight: 20,
borderColor: 'transparent',
backgroundColor: Color.accentLightColor,
height: 52
},
btnSubmit: {
marginTop: 20,
borderColor: 'transparent',
backgroundColor: Color.accentLightColor,
height: 52,
width: "30%",
marginLeft: 20,
marginRight: 20,
},
input: {
height: 60,
marginTop: responsiveHeight(2),
marginLeft: responsiveWidth(5),
marginRight: responsiveWidth(5),
borderRadius: 5,
}
container: {
flex: 1,
backgroundColor: Color.primaryDarkColor,
},
textbtnvalide: {
color: 'white',
fontWeight: 'bold'
},
bigtitle: {
color: 'white',
fontSize: 20,
flex: 1,
fontWeight: 'bold',
textAlign: 'center',
margin: 20,
},
blockView: {
paddingVertical: 10,
borderBottomWidth: 1
},
subbigtitle: {
color: 'white',
fontSize: 17,
textAlign: 'center',
margin: 5,
},
btnvalide: {
marginTop: 20,
marginLeft: 20,
marginRight: 20,
borderColor: 'transparent',
backgroundColor: Color.accentLightColor,
height: 52
},
btnSubmit: {
marginTop: 20,
borderColor: 'transparent',
backgroundColor: Color.accentLightColor,
height: 52,
width: "30%",
marginLeft: 20,
marginRight: 20,
},
input: {
height: 60,
marginTop: responsiveHeight(2),
marginLeft: responsiveWidth(5),
marginRight: responsiveWidth(5),
borderRadius: 5,
}
});

View File

@ -56,7 +56,7 @@ class EnvoieWalletToCashUser extends Component {
super(props);
this.state = {
identityPieces: identityPieces(),
identityPiecesName: (identityPieces()[0]).name,
identityPiecesName: I18n.t((identityPieces()[0]).name),
paysDestination: [],
paysDestinationSelect: null,
walletActifs: [],
@ -631,8 +631,8 @@ class EnvoieWalletToCashUser extends Component {
onChangeText={(value, index, data) => {
this.setState({ identityPiecesName: value });
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>

View File

@ -54,7 +54,7 @@ class EnvoieWalletToWalletUser extends Component {
super(props);
this.state = {
identityPieces: identityPieces(),
identityPiecesName: (identityPieces()[0]).name,
identityPiecesName: I18n.t((identityPieces()[0]).name),
paysDestination: [],
paysDestinationSelect: null,
walletActifs: [],
@ -603,8 +603,8 @@ class EnvoieWalletToWalletUser extends Component {
onChangeText={(value, index, data) => {
this.setState({ identityPiecesName: value });
}}
valueExtractor={(value) => { return value.name }}
labelExtractor={(value) => { return value.name }}
valueExtractor={(value) => { return I18n.t(value.name) }}
labelExtractor={(value) => { return I18n.t(value.name) }}
/>
</Animatable.View>

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@
"ASK_MEMBERS": "Membership applications",
"MY_ACCOUNT": "My account",
"WALLET": "Wallet",
"NO_BANK_AVAILABLE": "No bank available",
"ENTER_VALID_AMOUNT": "Enter a valid amount",
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
@ -111,7 +112,7 @@
"DEPOSIT_WALLET_TO_BANK": "Your Wallet to bank",
"ENVOIE_WALLET_TO_BANK": "Send Wallet to bank",
"DEPOSIT_CASH_TO_CASH": "Cash to cash",
"ENVOIE_CASH_TO_CASH": "Send money in cash to cash",
"ENVOIE_CASH_TO_CASH": "Send money from cash to cash",
"TRANSACTION_DETAIL": "Transaction detail",
"DEMAND_DETAIL": "Demand detail",
"CODE_IBAN": "IBAN Code",
@ -140,7 +141,7 @@
"OPEN_ACCOUNT": "Open account",
"MANAGE_CREDIT": "Manage credit",
"MANAGE_SAVINGS": "Manage savings",
"INIT_COUNTRY": "Departure countryt",
"INIT_COUNTRY": "Departure country",
"FINAL_COUNTRY": "Arrival country",
"INIT_AMOUNT": "Init amount",
"FINAL_AMOUNT": "Final amount",
@ -161,11 +162,15 @@
"DEMAND_NANO_CREDIT": "Nano credit demand",
"REFUND_NANO_CREDIT": "Refund nano credit",
"REFUND_DONE": "Refund done",
"SAVE_MONEY": "Epargner de l'argent",
"SAVE_MONEY": "Save money",
"SAVE_MONEY_TYPE": "Savings type",
"CAUTION_CREDIT": "Caution credit demand",
"ID_DEMAND": "Demand ID",
"DATE": "Date",
"PAIEMENT_EAU_ELECTRICITY": "Water/electricity bill",
"PAIEMENT_ECOLE": "School fees",
"PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills",
"PAIEMENT_ABONNEMENT_TV": "TV subscription",
"DEMAND_DATE": "Demand date",
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
"DATE_REMBOURSEMENT": "Refund date",
@ -174,7 +179,7 @@
"FINAL_DATE": "End date",
"CASSATION_DATE": "Cassation date",
"VALIDATION_DATE": "Validation date",
"HISTORY_DETAIL": "History detail",
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
"PAIEMENT_FACTURE": "Bill payment",
"NUMERO_ABONNE": "Subscriber number",
@ -273,6 +278,7 @@
"IDENTITY_NUMBER": "N° of piece",
"IDENTITY_PIECE_EXPIRY_DATE": "Expiry date",
"LAST_STEP": "Last step",
"ID_TRANSACTION": "Transaction ID",
"ACTIVE_ACCOUNT": "Activate the account !",
"ACTIVE_USER": "Active",
"LAST_STEP_TEXT": "Activate your account using the verification code that was sent to you on your e-mail address and on your phone number",
@ -437,14 +443,14 @@
"CREATE_MY_IDENTIFICATION": "Create my identification",
"NOT_IDENTIFIED": "This number exists, its identification is not yet entered",
"NOT_VALIDATED": "Your identicaiton is not yet validated",
"ALREADY_VALIDATED": "The identification of this client has already been validated",
"ALREADY_VALIDATED": "The identification of this customer has already been validated",
"MODIFY_IDENTIFICATION": "Modify my identification",
"NOT_YET_IDENTIFY": "You are not yet identified",
"IDENTIFICATION": " Identification",
"CREATION_IDENTIFICATION": "Creation",
"CREATION_IDENTIFICATION_CLIENT": "Identify me",
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a client",
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a customer",
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a customer",
"VALIDATE_IDENTIFICATION": "Validation",
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
"IDENTIFICATION_INFORMATION": "Identification information",

View File

@ -38,6 +38,7 @@
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
"DESTINATAIRE": "Destinataire",
"ERROR_LABEL": "Erreur",
"NO_BANK_AVAILABLE": "Aucune banque disponible",
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
"SUCCESS": "Succès",
"ETAT": "Etat",
@ -172,7 +173,11 @@
"REFUND_DONE": "Remboursement effectué",
"CAUTION_CREDIT": "Cautionner une demande de crédit",
"ID_DEMAND": "Identifiant de la demande",
"PAIEMENT_EAU_ELECTRICITY": "Paiement eau/électricité",
"PAIEMENT_ECOLE": "Paiement école",
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
"DATE": "Date",
"DEMAND_DATE": "Date de la demande",
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
"DATE_REMBOURSEMENT": "Date de remboursement",
@ -181,7 +186,7 @@
"FINAL_DATE": "Date de fin",
"CASSATION_DATE": "Date de cassation",
"VALIDATION_DATE": "Date de validation",
"HISTORY_DETAIL": "Détail de l'historique",
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
"PAIEMENT_FACTURE": "Paiement de facture",
"NUMERO_ABONNE": "Numéro d'abonnée",

47
webservice/BankApi.js Normal file
View File

@ -0,0 +1,47 @@
import {store} from "../redux/store";
import axios from "axios";
import {getBankUrl} from "./IlinkConstants";
import I18n from "react-native-i18n";
import {
fetchGetBankListError,
fetchGetBankListPending,
fetchGetBankListReset,
fetchGetBankListSucsess
} from "../redux/actions/BankAction";
export const getBankListAction = (idWallet) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchGetBankListPending());
axios({
url: `${getBankUrl}/${idWallet}`,
method: 'GET',
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchGetBankListSucsess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchGetBankListError(error.response));
else if (error.request)
dispatch(fetchGetBankListError(error.request))
else
dispatch(fetchGetBankListError(error.message))
});
}
}
export const getBankListReset = () => {
return dispatch => {
dispatch(fetchGetBankListReset());
}
}

View File

@ -1,84 +1,114 @@
import axios from "axios";
import I18n from 'react-native-i18n';
import { store } from "../redux/store";
import { envoieUserWalletToWallet, envoieCommissionUrl } from "./IlinkConstants";
import { fetchEnvoieUserWalletToWalletPending, fetchEnvoieUserWalletToWalletSuccess, fetchEnvoieUserWalletToWalletError, fetchEnvoieUserWalletToCardGetCommissionError, fetchEnvoieUserWalletToWalletReset, fetchEnvoieUserWalletToWalleGetCommissiontPending, fetchEnvoieUserWalletToWalleGetCommissiontReset, fetchEnvoieUserWalletToWalletGetCommissionSuccess, fetchEnvoieUserWalletToWalletGetCommissionError, fetchEnvoieUserWalletToCashPending, fetchEnvoieUserWalletToCashSuccess, fetchEnvoieUserWalletToCashError, fetchEnvoieUserWalletToCashReset, fetchEnvoieUserWalletToCashGetCommissiontPending, fetchEnvoieUserWalletToCashGetCommissiontReset, fetchEnvoieUserWalletToCashGetCommissionError, fetchEnvoieUserWalletToCashGetCommissionSuccess, fetchEnvoieUserWalletToCardPending, fetchEnvoieUserWalletToCardSuccess, fetchEnvoieUserWalletToCardError, fetchEnvoieUserWalletToCardReset, fetchEnvoieUserWalletToCardGetCommissiontPending, fetchEnvoieUserWalletToCardGetCommissionSuccess, fetchEnvoieUserWalletToCardGetCommissiontReset } from "../redux/actions/EnvoieUserType";
import {store} from "../redux/store";
import {envoieCommissionUrl, envoieUserWalletToWallet} from "./IlinkConstants";
import {
fetchEnvoieUserWalletToCardError,
fetchEnvoieUserWalletToCardGetCommissionError,
fetchEnvoieUserWalletToCardGetCommissionSuccess,
fetchEnvoieUserWalletToCardGetCommissiontPending,
fetchEnvoieUserWalletToCardGetCommissiontReset,
fetchEnvoieUserWalletToCardPending,
fetchEnvoieUserWalletToCardReset,
fetchEnvoieUserWalletToCardSuccess,
fetchEnvoieUserWalletToCashError,
fetchEnvoieUserWalletToCashGetCommissionError,
fetchEnvoieUserWalletToCashGetCommissionSuccess,
fetchEnvoieUserWalletToCashGetCommissiontPending,
fetchEnvoieUserWalletToCashGetCommissiontReset,
fetchEnvoieUserWalletToCashPending,
fetchEnvoieUserWalletToCashReset,
fetchEnvoieUserWalletToCashSuccess,
fetchEnvoieUserWalletToWalleGetCommissiontPending,
fetchEnvoieUserWalletToWalleGetCommissiontReset,
fetchEnvoieUserWalletToWalletError,
fetchEnvoieUserWalletToWalletGetCommissionError,
fetchEnvoieUserWalletToWalletGetCommissionSuccess,
fetchEnvoieUserWalletToWalletPending,
fetchEnvoieUserWalletToWalletReset,
fetchEnvoieUserWalletToWalletSuccess
} from "../redux/actions/EnvoieUserType";
import {
fetchEnvoieWalletToBankUserError,
fetchEnvoieWalletToBankUserPending,
fetchEnvoieWalletToBankUserReset,
fetchEnvoieWalletToBankUserSucsess
} from "../redux/actions/BankAction";
export const envoieUserWalletToWalletAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalletPending());
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalletPending());
axios({
url: `${envoieUserWalletToWallet}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToWalletSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToWalletError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToWalletError(error.request))
else
dispatch(fetchEnvoieUserWalletToWalletError(error.message))
});
}
axios({
url: `${envoieUserWalletToWallet}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToWalletSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToWalletError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToWalletError(error.request))
else
dispatch(fetchEnvoieUserWalletToWalletError(error.message))
});
}
}
export const envoieUserWalletToWalletReset = () => {
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalletReset());
}
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalletReset());
}
}
export const getCommissionUserWalletToWalletAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontPending());
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontPending());
axios({
url: `${envoieCommissionUrl}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToWalletGetCommissionSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.request))
else
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.message))
});
}
axios({
url: `${envoieCommissionUrl}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToWalletGetCommissionSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.request))
else
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.message))
});
}
}
export const getCommissionUserWalletToWalletReset = () => {
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontReset());
}
return dispatch => {
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontReset());
}
}
@ -88,78 +118,78 @@ export const getCommissionUserWalletToWalletReset = () => {
export const envoieUserWalletToCashAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashPending());
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashPending());
axios({
url: `${envoieUserWalletToWallet}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCashSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCashError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCashError(error.request))
else
dispatch(fetchEnvoieUserWalletToCashError(error.message))
});
}
axios({
url: `${envoieUserWalletToWallet}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCashSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCashError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCashError(error.request))
else
dispatch(fetchEnvoieUserWalletToCashError(error.message))
});
}
}
export const envoieUserWalletToCashReset = () => {
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashReset());
}
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashReset());
}
}
export const getCommissionUserWalletToCashAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashGetCommissiontPending());
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashGetCommissiontPending());
axios({
url: `${envoieCommissionUrl}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCashGetCommissionSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.request))
else
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.message))
});
}
axios({
url: `${envoieCommissionUrl}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCashGetCommissionSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.request))
else
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.message))
});
}
}
export const getCommissionUserWalletToCashReset = () => {
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashGetCommissiontReset());
}
return dispatch => {
dispatch(fetchEnvoieUserWalletToCashGetCommissiontReset());
}
}
/**
@ -168,76 +198,114 @@ export const getCommissionUserWalletToCashReset = () => {
export const envoieUserWalletToCardAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardPending());
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardPending());
axios({
url: `${envoieUserWalletToWallet}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCardSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCardError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCardError(error.request))
else
dispatch(fetchEnvoieUserWalletToCardError(error.message))
});
}
axios({
url: `${envoieUserWalletToWallet}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCardSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCardError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCardError(error.request))
else
dispatch(fetchEnvoieUserWalletToCardError(error.message))
});
}
}
export const envoieUserWalletToCardReset = () => {
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardReset());
}
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardReset());
}
}
export const getCommissionUserWalletToCardAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardGetCommissiontPending());
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardGetCommissiontPending());
axios({
url: `${envoieCommissionUrl}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCardGetCommissionSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.request))
else
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.message))
});
}
axios({
url: `${envoieCommissionUrl}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieUserWalletToCardGetCommissionSuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.response));
else if (error.request)
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.request))
else
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.message))
});
}
}
export const getCommissionUserWalletToCardReset = () => {
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardGetCommissiontReset());
}
return dispatch => {
dispatch(fetchEnvoieUserWalletToCardGetCommissiontReset());
}
}
export const envoieUserWalletToBankAction = (data) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchEnvoieWalletToBankUserPending());
axios({
url: `${envoieUserWalletToWallet}`,
method: 'POST',
data,
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchEnvoieWalletToBankUserSucsess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchEnvoieWalletToBankUserError(error.response));
else if (error.request)
dispatch(fetchEnvoieWalletToBankUserError(error.request))
else
dispatch(fetchEnvoieWalletToBankUserError(error.message))
});
}
}
export const envoieUserWalletToBankReset = () => {
return dispatch => {
dispatch(fetchEnvoieWalletToBankUserReset());
}
}

View File

@ -69,14 +69,14 @@ export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCre
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_hyper_history';
export const getSuperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_super_history';
export const getBankUrl = testBaseUrl + '/walletService/wallets/users/banks';
export const authKeyUrl = testBaseUrl + '/oauth/token';
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
export const MARKER_URL = baseUrl + "/interacted/LocationAction.php";
export const authKeyData = {
"grant_type": "password",
"client_id": "2",
"client_secret": "rrbvxACJPBOG4cqjDNlstSljlmjydLon3P55JMav",
"grant_type": "password",
"client_id": "2",
"client_secret": "rrbvxACJPBOG4cqjDNlstSljlmjydLon3P55JMav",
};