Bank operation OK
This commit is contained in:
parent
e18dae1f0a
commit
bae9ae54f4
12
App.js
12
App.js
|
|
@ -87,6 +87,7 @@ import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
|
||||||
import { IlinkEmitter } from './utils/events';
|
import { IlinkEmitter } from './utils/events';
|
||||||
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
|
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
|
||||||
import { readUser } from './webservice/AuthApi';
|
import { readUser } from './webservice/AuthApi';
|
||||||
|
import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent";
|
||||||
|
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
|
|
@ -149,10 +150,9 @@ const AppStack = createDrawerNavigator({
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
|
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
|
||||||
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
||||||
return (<IconWithBadge
|
return (<Icon
|
||||||
badgeCount={0}
|
|
||||||
size={20}
|
size={20}
|
||||||
name={"account-multiple-plus"}
|
name={"users-cog"}
|
||||||
color={focused ? tintColor : "grey"}
|
color={focused ? tintColor : "grey"}
|
||||||
/>)
|
/>)
|
||||||
}
|
}
|
||||||
|
|
@ -163,10 +163,9 @@ const AppStack = createDrawerNavigator({
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
tabBarLabel: I18n.t('MY_GROUP'),
|
tabBarLabel: I18n.t('MY_GROUP'),
|
||||||
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
||||||
return (<IconWithBadge
|
return (<Icon
|
||||||
badgeCount={0}
|
|
||||||
size={20}
|
size={20}
|
||||||
name={"account-multiple"}
|
name={"users"}
|
||||||
color={focused ? tintColor : "grey"}
|
color={focused ? tintColor : "grey"}
|
||||||
/>)
|
/>)
|
||||||
}
|
}
|
||||||
|
|
@ -269,6 +268,7 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
|
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
|
||||||
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
|
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
|
||||||
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
|
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
|
||||||
|
envoieWalletToBankAgent: EnvoieWalletToBankAgent,
|
||||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||||
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -35,6 +35,7 @@
|
||||||
"ASK_MEMBERS": "Membership applications",
|
"ASK_MEMBERS": "Membership applications",
|
||||||
"MY_ACCOUNT": "My account",
|
"MY_ACCOUNT": "My account",
|
||||||
"WALLET": "Wallet",
|
"WALLET": "Wallet",
|
||||||
|
"NO_BANK_AVAILABLE": "No bank available",
|
||||||
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
||||||
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
||||||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
||||||
"DESTINATAIRE": "Destinataire",
|
"DESTINATAIRE": "Destinataire",
|
||||||
"ERROR_LABEL": "Erreur",
|
"ERROR_LABEL": "Erreur",
|
||||||
|
"NO_BANK_AVAILABLE": "Aucune banque disponible",
|
||||||
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
||||||
"SUCCESS": "Succès",
|
"SUCCESS": "Succès",
|
||||||
"ETAT": "Etat",
|
"ETAT": "Etat",
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { AsyncStorage } from "react-native";
|
import {AsyncStorage} from "react-native";
|
||||||
import { persistCombineReducers } from "redux-persist";
|
import {persistCombineReducers} from "redux-persist";
|
||||||
import ActiveCountryListReducer from "./ActiveCountryListReducer";
|
import ActiveCountryListReducer from "./ActiveCountryListReducer";
|
||||||
import AskNanoCreditReducer from "./AskNanoCreditReducer";
|
import AskNanoCreditReducer from "./AskNanoCreditReducer";
|
||||||
import authKeyReducer from "./AuthKeyReducer";
|
import authKeyReducer from "./AuthKeyReducer";
|
||||||
|
|
@ -42,58 +42,61 @@ import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
|
||||||
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
import GetNanoCreditAccountUserReducer from "./GetNanoCreditAccountUserReducer";
|
||||||
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
import GetNanoCreditHistoryUserReducer from "./GetNanoCreditHistoryUserReducer";
|
||||||
import GetHyperSuperHistoryReducer from "./GetHyperSuperHistoryReducer";
|
import GetHyperSuperHistoryReducer from "./GetHyperSuperHistoryReducer";
|
||||||
|
import GetBankListReducer from "./GetBankListReducer";
|
||||||
|
import EnvoieUserWalletToBank from "./EnvoieUserWalletToBankReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
storage: AsyncStorage,
|
storage: AsyncStorage,
|
||||||
whitelist: ['authKeyReducer'],
|
whitelist: ['authKeyReducer'],
|
||||||
blacklist: []
|
blacklist: []
|
||||||
};
|
};
|
||||||
|
|
||||||
const rootReducer = persistCombineReducers(persistConfig, {
|
const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
walletReducer: walletReducer,
|
walletReducer: walletReducer,
|
||||||
walletDetailReducer: walletDetailReducer,
|
walletDetailReducer: walletDetailReducer,
|
||||||
authKeyReducer: authKeyReducer,
|
authKeyReducer: authKeyReducer,
|
||||||
depositReducer: depositReducer,
|
depositReducer: depositReducer,
|
||||||
walletHistoryReducer: walletHistoryReducer,
|
walletHistoryReducer: walletHistoryReducer,
|
||||||
walletTransferCommissionReducer: walletTransferCommissionReducer,
|
walletTransferCommissionReducer: walletTransferCommissionReducer,
|
||||||
creditTreatDemandReducer: creditTreatDemandReducer,
|
creditTreatDemandReducer: creditTreatDemandReducer,
|
||||||
creditCancelDemandReducer: creditCancelDemandReducer,
|
creditCancelDemandReducer: creditCancelDemandReducer,
|
||||||
walletGetCommission: WalletGetCommissionReducer,
|
walletGetCommission: WalletGetCommissionReducer,
|
||||||
createIdentificationReducer: CreateIdentificationReducer,
|
createIdentificationReducer: CreateIdentificationReducer,
|
||||||
getNumberInformationReducer: GetNumberInformation,
|
getNumberInformationReducer: GetNumberInformation,
|
||||||
getUserIdentificationReducer: GetUserIdentificationReducer,
|
getUserIdentificationReducer: GetUserIdentificationReducer,
|
||||||
validateIdentificationReducer: ValidateIdentificationReducer,
|
validateIdentificationReducer: ValidateIdentificationReducer,
|
||||||
payCountryNetworkReducer: PayCountryNetworkReducer,
|
payCountryNetworkReducer: PayCountryNetworkReducer,
|
||||||
activeCountryListReducer: ActiveCountryListReducer,
|
activeCountryListReducer: ActiveCountryListReducer,
|
||||||
countryByDialCode: CountryByDialCodeReducer,
|
countryByDialCode: CountryByDialCodeReducer,
|
||||||
envoieUserWalletToWalletReducer: EnvoieUserWalletToWalletReducer,
|
envoieUserWalletToWalletReducer: EnvoieUserWalletToWalletReducer,
|
||||||
envoieUserWalletToWalletGetCommissionReducer: EnvoieUserWalletToWalletGetCommissionReducer,
|
envoieUserWalletToWalletGetCommissionReducer: EnvoieUserWalletToWalletGetCommissionReducer,
|
||||||
countryByDialCode: CountryByDialCodeReducer,
|
envoieUserWalletToCashReducer: EnvoieUserWalletToCashReducer,
|
||||||
envoieUserWalletToCashReducer: EnvoieUserWalletToCashReducer,
|
envoieUserWalletToCashGetCommissionReducer: EnvoieUserWalletToCashGetCommissionReducer,
|
||||||
envoieUserWalletToCashGetCommissionReducer: EnvoieUserWalletToCashGetCommissionReducer,
|
envoieUserWalletToCardReducer: EnvoieUserWalletToCardReducer,
|
||||||
envoieUserWalletToCardReducer: EnvoieUserWalletToCardReducer,
|
envoieUserWalletToCardGetCommissionReducer: EnvoieUserWalletToCardGetCommissionReducer,
|
||||||
envoieUserWalletToCardGetCommissionReducer: EnvoieUserWalletToCardGetCommissionReducer,
|
linkCardReduder: LinkCardReducer,
|
||||||
linkCardReduder: LinkCardReducer,
|
retraitCashAgentIdVerificationReducer: RetraitCashAgentIdVerificationReducer,
|
||||||
retraitCashAgentIdVerificationReducer: RetraitCashAgentIdVerificationReducer,
|
createGroupReducer: CreateGroupReducer,
|
||||||
createGroupReducer: CreateGroupReducer,
|
saveOnesignalReducer: SaveOnesignalReducer,
|
||||||
saveOnesignalReducer: SaveOnesignalReducer,
|
getDemandsGroupReducer: GetDemandsGroupReducer,
|
||||||
getDemandsGroupReducer: GetDemandsGroupReducer,
|
getUniqueDemandsGroupReducer: GetUniqueDemandsGroupReducer,
|
||||||
getUniqueDemandsGroupReducer: GetUniqueDemandsGroupReducer,
|
treatDemandGroupReducer: TreatDemandGroupReducer,
|
||||||
treatDemandGroupReducer: TreatDemandGroupReducer,
|
joinGroupReducer: JoinGroupReducer,
|
||||||
joinGroupReducer: JoinGroupReducer,
|
getUserGroupDetailReducer: GetUserGroupDetailReducer,
|
||||||
getUserGroupDetailReducer: GetUserGroupDetailReducer,
|
getNotificationReducer: GetNotificationReducer,
|
||||||
getNotificationReducer: GetNotificationReducer,
|
askNanoCreditReducer: AskNanoCreditReducer,
|
||||||
askNanoCreditReducer: AskNanoCreditReducer,
|
getNanoCreditDemandDurationReducer: GetNanoCreditDemandDurationReducer,
|
||||||
getNanoCreditDemandDurationReducer: GetNanoCreditDemandDurationReducer,
|
cautionCreditDemandAgentReducer: CautionCreditDemandAgentReducer,
|
||||||
cautionCreditDemandAgentReducer: CautionCreditDemandAgentReducer,
|
refundCreditDemandReducer: RefundCreditDemandUserReducer,
|
||||||
refundCreditDemandReducer: RefundCreditDemandUserReducer,
|
getNanoCreditDemandDetailReducer: GetNanoCreditDemandDetailReducer,
|
||||||
getNanoCreditDemandDetailReducer: GetNanoCreditDemandDetailReducer,
|
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
||||||
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
casserEpargneUserReducer: CasserEpargneUserReducer,
|
||||||
casserEpargneUserReducer: CasserEpargneUserReducer,
|
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
||||||
getNanoCreditAccountUserReducer: GetNanoCreditAccountUserReducer,
|
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
|
||||||
getNanoCreditHistoryUserReducer: GetNanoCreditHistoryUserReducer,
|
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer,
|
||||||
getHyperSuperHistoryReducer: GetHyperSuperHistoryReducer
|
getBankListReducer: GetBankListReducer,
|
||||||
|
envoieUserWalletToBank: EnvoieUserWalletToBank
|
||||||
});
|
});
|
||||||
|
|
||||||
export default rootReducer;
|
export default rootReducer;
|
||||||
|
|
@ -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';
|
||||||
|
|
@ -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_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_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_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';
|
||||||
|
|
@ -43,6 +43,7 @@
|
||||||
"envoieWalletToCardUser": "envoieWalletToCardUser",
|
"envoieWalletToCardUser": "envoieWalletToCardUser",
|
||||||
"linkCard": "linkCard",
|
"linkCard": "linkCard",
|
||||||
"envoieWalletToBankUser": "envoieWalletToBankUser",
|
"envoieWalletToBankUser": "envoieWalletToBankUser",
|
||||||
|
"envoieWalletToBankAgent": "envoieWalletToBankAgent",
|
||||||
"retraitWalletVersCashUser": "retraitWalletVersCashUser",
|
"retraitWalletVersCashUser": "retraitWalletVersCashUser",
|
||||||
"retraitCarteVersCashUser": "retraitCarteVersCashUser",
|
"retraitCarteVersCashUser": "retraitCarteVersCashUser",
|
||||||
"retraitCarteVersWalletUser": "retraitCarteVersWalletUser",
|
"retraitCarteVersWalletUser": "retraitCarteVersWalletUser",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { StyleSheet, View, Text, Image, StatusBar, TouchableOpacity, ScrollView, ProgressBarAndroid, Alert } from 'react-native';
|
import { StyleSheet, View, Text, Image, StatusBar, TouchableOpacity, ScrollView, ProgressBarAndroid, Alert } from 'react-native';
|
||||||
let theme = require('./../../utils/theme.json');
|
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 { readUser, deleteUser } from './../../webservice/AuthApi';
|
||||||
import { getAgentNetworksList } from './../../webservice/NetworkApi'
|
import { getAgentNetworksList } from './../../webservice/NetworkApi'
|
||||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||||
|
|
@ -184,7 +184,7 @@ export default class UserAccount extends Component {
|
||||||
{this.showPhoneSup()}
|
{this.showPhoneSup()}
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
<Icon name={"signal-cellular-4-bar"} size={18} />
|
<Icon name={"account-balance-wallet"} size={18} />
|
||||||
{" " + this.state.user.network}</Text>
|
{" " + this.state.user.network}</Text>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</CardView>
|
</CardView>
|
||||||
|
|
|
||||||
4989
screens/home/Home.js
4989
screens/home/Home.js
File diff suppressed because it is too large
Load Diff
|
|
@ -68,7 +68,7 @@ class CreateIdentificationUser extends Component {
|
||||||
townName: null,
|
townName: null,
|
||||||
country: null,
|
country: null,
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
snackVisible: false,
|
snackVisible: false,
|
||||||
snackText: '',
|
snackText: '',
|
||||||
disableNetwork: false,
|
disableNetwork: false,
|
||||||
|
|
@ -531,8 +531,8 @@ class CreateIdentificationUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class ModifyIdentificationUser extends Component {
|
||||||
townName: null,
|
townName: null,
|
||||||
country: null,
|
country: null,
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
snackVisible: false,
|
snackVisible: false,
|
||||||
snackText: '',
|
snackText: '',
|
||||||
disableNetwork: false,
|
disableNetwork: false,
|
||||||
|
|
@ -533,8 +533,8 @@ class ModifyIdentificationUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class CreateIdentification extends Component {
|
||||||
townName: null,
|
townName: null,
|
||||||
country: null,
|
country: null,
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
snackVisible: false,
|
snackVisible: false,
|
||||||
snackText: '',
|
snackText: '',
|
||||||
disableNetwork: false,
|
disableNetwork: false,
|
||||||
|
|
@ -640,8 +640,8 @@ class CreateIdentification extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
<Animatable.View ref={(comp) => { this.numeroIdentiteAnim = comp }}>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class AskNanoCredit extends Component {
|
||||||
isDataSubmit: false,
|
isDataSubmit: false,
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
typeCaution: typeCaution(),
|
typeCaution: typeCaution(),
|
||||||
typeCautionName: (typeCaution()[0]).name,
|
typeCautionName: I18n.t((typeCaution()[0]).name),
|
||||||
typeCautionToSend: 'groupe',
|
typeCautionToSend: 'groupe',
|
||||||
wallet: store.getState().walletDetailReducer.result.response
|
wallet: store.getState().walletDetailReducer.result.response
|
||||||
};
|
};
|
||||||
|
|
@ -273,6 +273,7 @@ class AskNanoCredit extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
console.log(this.state);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(this.props.loading || this.props.loadingGetNanoCredit || this.state.modalVisible) && this.renderLoader()}
|
{(this.props.loading || this.props.loadingGetNanoCredit || this.state.modalVisible) && this.renderLoader()}
|
||||||
|
|
@ -332,10 +333,10 @@ class AskNanoCredit extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
typeCautionToSend: 'groupe',
|
typeCautionToSend: 'groupe',
|
||||||
typeCautionName: I18n.t('GROUP')
|
typeCautionName: I18n.t('GROUP')
|
||||||
})
|
});
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,8 @@ class DemandValidationGroup extends React.Component {
|
||||||
this.props.getNanoCreditDemandsAction(user.id);
|
this.props.getNanoCreditDemandsAction(user.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||||
|
|
||||||
this.props.getNanoCreditDemandsReset();
|
this.props.getNanoCreditDemandsReset();
|
||||||
this.navigation = this.props.navigation
|
this.navigation = this.props.navigation
|
||||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
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() {
|
componentDidMount() {
|
||||||
const { routeName } = this.navigation.state
|
const { routeName } = this.navigation.state
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class EpargnerArgentUser extends Component {
|
||||||
isDataSubmit: false,
|
isDataSubmit: false,
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
typeEpargne: typeEpargne(),
|
typeEpargne: typeEpargne(),
|
||||||
typeEpargneName: (typeEpargne()[0]).name,
|
typeEpargneName: I18n.t((typeEpargne()[0]).name),
|
||||||
typeEpargneToSend: 'simple',
|
typeEpargneToSend: 'simple',
|
||||||
wallet: store.getState().walletDetailReducer.result.response
|
wallet: store.getState().walletDetailReducer.result.response
|
||||||
};
|
};
|
||||||
|
|
@ -314,8 +314,8 @@ class EpargnerArgentUser extends Component {
|
||||||
displayDuration: true
|
displayDuration: true
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
@ -340,8 +340,8 @@ class EpargnerArgentUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ durationSelect: value });
|
this.setState({ durationSelect: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.value }}
|
valueExtractor={(value) => { return I18n.t(value.value) }}
|
||||||
labelExtractor={(value) => { return value.value }}
|
labelExtractor={(value) => { return I18n.t(value.value) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -544,7 +544,7 @@ export default class OptionsMenu extends Component {
|
||||||
text: I18n.t('YES'), onPress: () => {
|
text: I18n.t('YES'), onPress: () => {
|
||||||
disconnect().then(() => {
|
disconnect().then(() => {
|
||||||
IlinkEmitter.emit("userdisconnect");
|
IlinkEmitter.emit("userdisconnect");
|
||||||
AsyncStorage.clear();
|
//AsyncStorage.clear();
|
||||||
this.props.navigation.navigate("Auth");
|
this.props.navigation.navigate("Auth");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,238 +1,354 @@
|
||||||
import React, { Component } from 'react';
|
import React, {Component} from 'react';
|
||||||
import { FlatList, Image, StatusBar, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
import {
|
||||||
import { ScrollView } from 'react-native-gesture-handler';
|
ActivityIndicator,
|
||||||
|
Image,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import I18n from 'react-native-i18n';
|
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 Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
import { Color } from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
import { Typography } from '../../config/typography';
|
import {Typography} from '../../config/typography';
|
||||||
import * as Utils from '../../utils/DeviceUtils';
|
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');
|
const route = require('../../route.json');
|
||||||
let slugify = require('slugify');
|
let slugify = require('slugify');
|
||||||
|
|
||||||
export default class OperateurOptionSelect extends Component {
|
class OperateurOptionSelect extends Component {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||||
console.log("OPERATEUR OPTION PROPS", this.props);
|
console.log("OPERATEUR OPTION PROPS", this.props);
|
||||||
this.state = {
|
this.state = {
|
||||||
options: this.props.navigation.state.params.optionSelect.options,
|
options: this.props.navigation.state.params.optionSelect.options,
|
||||||
title: this.props.navigation.state.params.optionSelect.title,
|
title: this.props.navigation.state.params.optionSelect.title,
|
||||||
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
subTitle: this.props.navigation.state.params.optionSelect.subTitle,
|
||||||
}
|
wallet: store.getState().walletDetailReducer.result.response
|
||||||
|
}
|
||||||
|
this.props.getBankListReset();
|
||||||
|
|
||||||
}
|
readUser().then((user) => {
|
||||||
|
if (user) {
|
||||||
updateLangue() {
|
if (user !== undefined) {
|
||||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
if (user.category === undefined) {
|
||||||
this.forceUpdate();
|
this.props.getBankListAction(this.state.wallet.id_wallet_network);
|
||||||
}
|
} else {
|
||||||
|
if (user.category === 'geolocated')
|
||||||
static navigationOptions = ({ navigation }) => ({
|
this.props.getBankListAction(this.state.wallet.id_network);
|
||||||
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)
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
</ScrollView>
|
this.setState({user});
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
render() {
|
}
|
||||||
return (
|
|
||||||
<Provider>
|
|
||||||
<View style={{ flex: 1 }}>
|
|
||||||
|
|
||||||
<StatusBar
|
updateLangue() {
|
||||||
backgroundColor={Color.primaryDarkColor}
|
this.props.navigation.setParams({name: I18n.t('WALLET')})
|
||||||
barStyle="light-content"
|
this.forceUpdate();
|
||||||
translucent={false}
|
}
|
||||||
/>
|
|
||||||
|
|
||||||
<Appbar.Header dark={true} style={{ backgroundColor: Color.primaryColor }}>
|
static navigationOptions = ({navigation}) => ({
|
||||||
<Appbar.BackAction
|
header: null,
|
||||||
onPress={() => { this.props.navigation.pop() }}
|
headerMode: 'none',
|
||||||
/>
|
headerTitle: null,
|
||||||
<Appbar.Content
|
activeColor: '#f0edf6',
|
||||||
title={this.state.title}
|
inactiveColor: '#3e2465',
|
||||||
subtitle={this.state.subTitle}
|
barStyle: {backgroundColor: '#694fad'},
|
||||||
/>
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
</Appbar.Header>
|
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>
|
renderLoader = () => {
|
||||||
</View>
|
return (
|
||||||
<Icon
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
name="chevron-right"
|
{Platform.OS === 'android'
|
||||||
size={20}
|
?
|
||||||
color={Color.primaryColor}
|
(
|
||||||
enableRTL={true}
|
<>
|
||||||
/>
|
<ProgressBarAndroid/>
|
||||||
</TouchableOpacity>
|
<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>
|
</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({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
paymentItem: {
|
paymentItem: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
paddingVertical: 5,
|
paddingVertical: 5,
|
||||||
width: "100%",
|
width: "100%",
|
||||||
marginBottom: 15
|
marginBottom: 15
|
||||||
},
|
},
|
||||||
iconContent: {
|
iconContent: {
|
||||||
width: 60,
|
width: 60,
|
||||||
marginRight: 10,
|
marginRight: 10,
|
||||||
alignItems: "center"
|
alignItems: "center"
|
||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
paddingVertical: 15,
|
paddingVertical: 15,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "center"
|
alignItems: "center"
|
||||||
},
|
},
|
||||||
/* item: {
|
/* item: {
|
||||||
paddingVertical: 15,
|
paddingVertical: 15,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "center"
|
alignItems: "center"
|
||||||
}, */
|
}, */
|
||||||
lottie: {
|
lottie: {
|
||||||
width: 540,
|
width: 540,
|
||||||
height: 240
|
height: 240
|
||||||
},
|
},
|
||||||
checkDefault: {
|
checkDefault: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
marginTop: 5
|
marginTop: 5
|
||||||
},
|
},
|
||||||
transactionContainer: {
|
transactionContainer: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
},
|
},
|
||||||
containerTouch: {
|
containerTouch: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
shadowColor: Color.borderColor,
|
shadowColor: Color.borderColor,
|
||||||
borderColor: Color.borderColor,
|
borderColor: Color.borderColor,
|
||||||
borderWidth: 0.5,
|
borderWidth: 0.5,
|
||||||
shadowOffset: { width: 1.5, height: 1.5 },
|
shadowOffset: {width: 1.5, height: 1.5},
|
||||||
shadowOpacity: 1.0,
|
shadowOpacity: 1.0,
|
||||||
elevation: 5,
|
elevation: 5,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
backgroundColor: Color.cardBackgroundColor
|
backgroundColor: Color.cardBackgroundColor
|
||||||
},
|
},
|
||||||
|
|
||||||
contain: {
|
contain: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
},
|
},
|
||||||
imageBanner: {
|
imageBanner: {
|
||||||
marginTop: 15,
|
marginTop: 15,
|
||||||
marginLeft: 5,
|
marginLeft: 5,
|
||||||
width: Utils.scaleWithPixel(30),
|
width: Utils.scaleWithPixel(30),
|
||||||
height: Utils.scaleWithPixel(30)
|
height: Utils.scaleWithPixel(30)
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
height: Utils.scaleWithPixel(60),
|
height: Utils.scaleWithPixel(60),
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 10,
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
alignItems: 'flex-start',
|
alignItems: 'flex-start',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
contentTitle: {
|
contentTitle: {
|
||||||
paddingTop: 12,
|
paddingTop: 12,
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -442,7 +442,7 @@ class WalletDepot extends Component {
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => value.value}
|
valueExtractor={(value) => value.value}
|
||||||
labelExtractor={(value) => value.name}
|
labelExtractor={(value) => I18n.t(value.name)}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
<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>
|
||||||
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
|
|
@ -659,7 +659,7 @@ class WalletDetail extends Component {
|
||||||
|
|
||||||
<Dialog.Container useNativeDriver={true} visible={this.state.displaySuperHyperModalHistory}>
|
<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') &&
|
{isEqual(historyItemDetail.type_historique, 'N') &&
|
||||||
<ScrollView persistentScrollbar={true}>
|
<ScrollView persistentScrollbar={true}>
|
||||||
|
|
@ -669,7 +669,7 @@ class WalletDetail extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<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>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -1022,7 +1022,7 @@ class WalletDetail extends Component {
|
||||||
<View style={{ alignItems: 'center' }} key={index}>
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
{item.label}
|
{I18n.t(item.label)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
|
|
@ -1489,7 +1489,7 @@ class WalletDetail extends Component {
|
||||||
<View style={{ alignItems: 'center' }} key={index}>
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
{item.label}
|
{I18n.t(item.label)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -124,7 +124,7 @@ class WalletOptionSelect extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
this.props.navigation.setParams({ name: I18n.t('WALLET') });
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,7 +221,7 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
<View style={styles.contentTitle}>
|
<View style={styles.contentTitle}>
|
||||||
<Text style={[Typography.headline, Typography.semibold]}>
|
<Text style={[Typography.headline, Typography.semibold]}>
|
||||||
{options.title}
|
{I18n.t(options.title)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -267,7 +267,7 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
<View style={styles.contentTitle}>
|
<View style={styles.contentTitle}>
|
||||||
<Text style={[Typography.headline, Typography.semibold]}>
|
<Text style={[Typography.headline, Typography.semibold]}>
|
||||||
{options.title}
|
{I18n.t(options.title)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
@ -388,7 +388,7 @@ class WalletOptionSelect extends Component {
|
||||||
<View style={{ alignItems: 'center' }} key={index}>
|
<View style={{ alignItems: 'center' }} key={index}>
|
||||||
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
<Icon name={item.icon} size={24} color={Color.primaryColor} />
|
||||||
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
|
||||||
{item.label}
|
{I18n.t(item.label)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
))
|
))
|
||||||
|
|
@ -459,7 +459,7 @@ class WalletOptionSelect extends Component {
|
||||||
|
|
||||||
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
|
<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) ?
|
isNil(this.state.user.category) ?
|
||||||
isEqual(historyItemDetail.type_historique, 'N') ?
|
isEqual(historyItemDetail.type_historique, 'N') ?
|
||||||
|
|
@ -470,7 +470,7 @@ class WalletOptionSelect extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<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>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -586,7 +586,7 @@ class WalletOptionSelect extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<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>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -678,7 +678,7 @@ class WalletOptionSelect extends Component {
|
||||||
<Text style={[styles.body2]}>Type</Text>
|
<Text style={[styles.body2]}>Type</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<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>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
|
|
@ -853,8 +853,8 @@ class WalletOptionSelect extends Component {
|
||||||
onPress={() => { this.props.navigation.pop() }}
|
onPress={() => { this.props.navigation.pop() }}
|
||||||
/>
|
/>
|
||||||
<Appbar.Content
|
<Appbar.Content
|
||||||
title={this.state.title}
|
title={I18n.t(this.state.title)}
|
||||||
subtitle={this.state.subTitle}
|
subtitle={I18n.t(this.state.subTitle)}
|
||||||
/>
|
/>
|
||||||
</Appbar.Header>
|
</Appbar.Header>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,239 +1,250 @@
|
||||||
import React, { Component } from 'react';
|
import React, {Component} from 'react';
|
||||||
import { StyleSheet, View, Image, StatusBar, Alert, ScrollView, TouchableOpacity, ActivityIndicator, Platform, ProgressBarAndroid, Text } from 'react-native';
|
import {
|
||||||
|
ActivityIndicator,
|
||||||
|
Image,
|
||||||
|
Platform,
|
||||||
|
ProgressBarAndroid,
|
||||||
|
ScrollView,
|
||||||
|
StatusBar,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View
|
||||||
|
} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
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');
|
const route = require('./../../route.json');
|
||||||
let slugify = require('slugify');
|
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 {
|
class WalletSelect extends Component {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
slugify.extend({ '+': 'plus' });
|
slugify.extend({'+': 'plus'});
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||||
this.state = {
|
this.state = {
|
||||||
result: null,
|
result: null,
|
||||||
isDataLoaded: false,
|
isDataLoaded: false,
|
||||||
agentId: null
|
agentId: null
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static navigationOptions = ({ navigation }) => ({
|
static navigationOptions = ({navigation}) => ({
|
||||||
header: null,
|
header: null,
|
||||||
headerMode: 'none',
|
headerMode: 'none',
|
||||||
headerTitle: null,
|
headerTitle: null,
|
||||||
activeColor: '#f0edf6',
|
activeColor: '#f0edf6',
|
||||||
inactiveColor: '#3e2465',
|
inactiveColor: '#3e2465',
|
||||||
barStyle: { backgroundColor: '#694fad' },
|
barStyle: {backgroundColor: '#694fad'},
|
||||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({tintColor}) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>)
|
||||||
});
|
});
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
if (user.phone !== undefined) {
|
if (user.phone !== undefined) {
|
||||||
this.props.getWalletActivated(user.agentId);
|
this.props.getWalletActivated(user.agentId);
|
||||||
this.setState({ agentId: user.agentId });
|
this.setState({agentId: user.agentId});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* refresh() {
|
/* refresh() {
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
if (user.phone !== undefined) {
|
if (user.phone !== undefined) {
|
||||||
this.props.getWalletActivated(user.agentId);
|
this.props.getWalletActivated(user.agentId);
|
||||||
this.setState({ agentId: user.agentId });
|
this.setState({ agentId: user.agentId });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} */
|
} */
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
this.props.navigation.setParams({name: I18n.t('WALLET')})
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
renderLoader = () => {
|
renderLoader = () => {
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||||
{Platform.OS === 'android'
|
{Platform.OS === 'android'
|
||||||
?
|
?
|
||||||
(
|
(
|
||||||
<>
|
<>
|
||||||
<ProgressBarAndroid />
|
<ProgressBarAndroid/>
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
) :
|
) :
|
||||||
<>
|
<>
|
||||||
<ActivityIndicator size="large" color={'#ccc'} />
|
<ActivityIndicator size="large" color={'#ccc'}/>
|
||||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
renderWalletItem = (item) => {
|
renderWalletItem = (item) => {
|
||||||
let icon = `${baseUrl}/datas/img/network/${slugify(item.network, { lower: true })}-logo.png`;
|
let icon = `${baseUrl}/datas/img/network/${slugify(item.network, {lower: true})}-logo.png`;
|
||||||
let itemToSend = item;
|
let itemToSend = item;
|
||||||
itemToSend.agentId = this.state.agentId;
|
itemToSend.agentId = this.state.agentId;
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={item.id}
|
key={item.id}
|
||||||
style={[styles.paymentItem, { borderBottomColor: Color.borderColor }]}
|
style={[styles.paymentItem, {borderBottomColor: Color.borderColor}]}
|
||||||
onPress={() => this.props.navigation.navigate('walletDetail', {
|
onPress={() => this.props.navigation.navigate('walletDetail', {
|
||||||
wallet: itemToSend,/*
|
wallet: itemToSend,/*
|
||||||
onRefreshDetail: () => this.refresh() */
|
onRefreshDetail: () => this.refresh() */
|
||||||
})}>
|
})}>
|
||||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
<View style={{flexDirection: 'row', alignItems: 'center'}}>
|
||||||
<View style={styles.iconContent}>
|
<View style={styles.iconContent}>
|
||||||
<Image style={{ width: 48, height: 48 }} source={{ uri: icon }} />
|
<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>
|
</View>
|
||||||
</TouchableOpacity>
|
<View>
|
||||||
)
|
<Text style={Typography.body1}>{item.network}</Text>
|
||||||
}
|
<Text style={[Typography.footnote, Color.grayColor]} style={{marginTop: 5}}>
|
||||||
|
{I18n.t('COUNTRY')}: {item.country}
|
||||||
renderWalletList = () => {
|
</Text>
|
||||||
|
|
||||||
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>
|
</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 => ({
|
const mapStateToProps = state => ({
|
||||||
loading: state.walletReducer.loading,
|
loading: state.walletReducer.loading,
|
||||||
result: state.walletReducer.result,
|
result: state.walletReducer.result,
|
||||||
error: state.walletReducer.error
|
error: state.walletReducer.error
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
getWalletActivated
|
getWalletActivated
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(WalletSelect);
|
export default connect(mapStateToProps, mapDispatchToProps)(WalletSelect);
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: Color.containerBackgroundColor,
|
backgroundColor: Color.containerBackgroundColor,
|
||||||
},
|
},
|
||||||
paymentItem: {
|
paymentItem: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
paddingVertical: 5,
|
paddingVertical: 5,
|
||||||
width: "100%",
|
width: "100%",
|
||||||
marginBottom: 15
|
marginBottom: 15
|
||||||
},
|
},
|
||||||
iconContent: {
|
iconContent: {
|
||||||
width: 60,
|
width: 60,
|
||||||
marginRight: 10,
|
marginRight: 10,
|
||||||
alignItems: "center"
|
alignItems: "center"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -56,7 +56,7 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
identityPiecesEmetteur: identityPieces(),
|
identityPiecesEmetteur: identityPieces(),
|
||||||
identityPiecesNameEmetteur: (identityPieces()[0]).name,
|
identityPiecesNameEmetteur: I18n.t((identityPieces()[0]).name),
|
||||||
paysDestination: [],
|
paysDestination: [],
|
||||||
paysDestinationSelect: null,
|
paysDestinationSelect: null,
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
|
|
@ -559,8 +559,8 @@ class EnvoiCashVersCashAgent extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false });
|
this.setState({ identityPiecesNameEmetteur: value, isDataSubmit: false });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -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,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -1,466 +1,469 @@
|
||||||
import Button from 'apsl-react-native-button';
|
import Button from 'apsl-react-native-button';
|
||||||
import isEqual from 'lodash/isEqual';
|
import isEqual from 'lodash/isEqual';
|
||||||
import isNil from 'lodash/isNil';
|
import isNil from 'lodash/isNil';
|
||||||
import React, { Component } from 'react';
|
import React, {Component} from 'react';
|
||||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
import {Alert, ScrollView, StyleSheet, Text, View} from 'react-native';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import Dialog from "react-native-dialog";
|
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
import {ProgressDialog} from 'react-native-simple-dialogs';
|
||||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||||
import { Fumi } from 'react-native-textinput-effects';
|
import {Fumi} from 'react-native-textinput-effects';
|
||||||
import { connect } from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import { bindActionCreators } from 'redux';
|
import {bindActionCreators} from 'redux';
|
||||||
import thousands from 'thousands';
|
import {Color} from '../../../config/Color';
|
||||||
import { Color } from '../../../config/Color';
|
import {FontWeight, Typography} from '../../../config/typography';
|
||||||
import { FontWeight, Typography } from '../../../config/typography';
|
import {store} from "../../../redux/store";
|
||||||
import { store } from "../../../redux/store";
|
import {IlinkEmitter} from '../../../utils/events';
|
||||||
import { IlinkEmitter } from '../../../utils/events';
|
import {readUser} from '../../../webservice/AuthApi';
|
||||||
import { readUser } from '../../../webservice/AuthApi';
|
import {envoieUserWalletToBankAction, envoieUserWalletToBankReset} from '../../../webservice/EnvoieUserApi';
|
||||||
import { envoieUserWalletToCardAction, envoieUserWalletToCardReset, getCommissionUserWalletToCardAction, getCommissionUserWalletToCardReset } from '../../../webservice/EnvoieUserApi';
|
import {isNormalInteger} from '../../../utils/UtilsFunction';
|
||||||
import { isNormalInteger } from '../../../utils/UtilsFunction';
|
|
||||||
let theme = require('../../../utils/theme.json');
|
let theme = require('../../../utils/theme.json');
|
||||||
let route = require('../../../route.json');
|
let route = require('../../../route.json');
|
||||||
|
|
||||||
|
|
||||||
class EnvoieWalletToBankUser extends Component {
|
class EnvoieWalletToBankUser extends Component {
|
||||||
|
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
navBarBackgroundColor: Color.primaryColor,
|
navBarBackgroundColor: Color.primaryColor,
|
||||||
statusBarColor: Color.primaryDarkColor,
|
statusBarColor: Color.primaryDarkColor,
|
||||||
navBarTextColor: '#FFFFFF',
|
navBarTextColor: '#FFFFFF',
|
||||||
navBarButtonColor: '#FFFFFF'
|
navBarButtonColor: '#FFFFFF'
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static navigationOptions = () => {
|
static navigationOptions = () => {
|
||||||
return {
|
return {
|
||||||
drawerLabel: () => null,
|
drawerLabel: () => null,
|
||||||
headerTitle: I18n.t('DEPOSIT_WALLET_TO_BANK'),
|
headerTitle: I18n.t('DEPOSIT_WALLET_TO_BANK'),
|
||||||
headerTintColor: 'white',
|
headerTintColor: 'white',
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
backgroundColor: Color.primaryColor,
|
backgroundColor: Color.primaryColor,
|
||||||
marginTop: 0,
|
marginTop: 0,
|
||||||
color: 'white'
|
color: 'white'
|
||||||
},
|
},
|
||||||
headerTitleStyle: {
|
headerTitleStyle: {
|
||||||
color: "white"
|
color: "white"
|
||||||
},
|
},
|
||||||
title: I18n.t('ENVOIE_WALLET_TO_BANK')
|
title: I18n.t('DEPOSIT_WALLET_TO_BANK')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
montant: null,
|
montant: null,
|
||||||
password: null,
|
password: null,
|
||||||
codeCVV: null,
|
codeIban: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
user: null,
|
user: null,
|
||||||
triggerSubmitClick: false,
|
triggerSubmitClick: false,
|
||||||
isSubmitClick: false,
|
isSubmitClick: false,
|
||||||
isDataSubmit: false,
|
isDataSubmit: false,
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
wallet: store.getState().walletDetailReducer.result.response
|
wallet: store.getState().walletDetailReducer.result.response,
|
||||||
};
|
bank: this.props.navigation.state.params.bank
|
||||||
|
};
|
||||||
|
|
||||||
this.props.envoieUserWalletToCardReset();
|
this.props.envoieUserWalletToBankReset();
|
||||||
this.props.getCommissionUserWalletToCardReset();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
if (user !== undefined) {
|
if (user !== undefined) {
|
||||||
this.setState({ user });
|
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)
|
if (!nextProps.loadingEnvoieWalletToCardGetCommission)
|
||||||
this.setState({
|
this.setState({
|
||||||
isModalConfirmVisible: true
|
isModalConfirmVisible: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
renderEnvoieWalletToWalletResponse = () => {
|
renderEnvoieWalletToBankResponse = () => {
|
||||||
|
|
||||||
const { resultEnvoieWalletToCard, errorEnvoieWalletToCard } = this.props;
|
const {resultEnvoieWalletToBank, errorEnvoieWalletToBank} = this.props;
|
||||||
|
|
||||||
if (errorEnvoieWalletToCard !== null) {
|
if (errorEnvoieWalletToBank !== null) {
|
||||||
if (typeof errorEnvoieWalletToCard.data !== 'undefined') {
|
if (typeof errorEnvoieWalletToBank.data !== 'undefined') {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t("ERROR_TRANSFER"),
|
I18n.t("ERROR_TRANSFER"),
|
||||||
errorEnvoieWalletToCard.data.error,
|
errorEnvoieWalletToBank.data.error,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.envoieUserWalletToCardReset();
|
this.props.envoieUserWalletToBankReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultEnvoieWalletToCard !== null) {
|
if (resultEnvoieWalletToBank !== null) {
|
||||||
if (resultEnvoieWalletToCard.response !== null) {
|
if (resultEnvoieWalletToBank.response !== null) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t("SUCCESS_TRANSFER"),
|
I18n.t("SUCCESS_TRANSFER"),
|
||||||
resultEnvoieWalletToCard.response,
|
resultEnvoieWalletToBank.response,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.envoieUserWalletToCardReset();
|
this.props.envoieUserWalletToBankReset();
|
||||||
IlinkEmitter.emit("refreshWallet");
|
IlinkEmitter.emit("refreshWallet");
|
||||||
this.props.navigation.pop();
|
this.props.navigation.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{cancelable: false}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderDialogGetCommissionResponse = () => {
|
/* renderDialogGetCommissionResponse = () => {
|
||||||
|
|
||||||
const { errorEnvoieWalletToCardGetCommission } = this.props;
|
const { errorEnvoieWalletToCardGetCommission } = this.props;
|
||||||
|
|
||||||
if (errorEnvoieWalletToCardGetCommission !== null) {
|
if (errorEnvoieWalletToCardGetCommission !== null) {
|
||||||
if (typeof errorEnvoieWalletToCardGetCommission.data !== 'undefined') {
|
if (typeof errorEnvoieWalletToCardGetCommission.data !== 'undefined') {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t("ERROR_LABLE"),
|
I18n.t("ERROR_LABLE"),
|
||||||
errorEnvoieWalletToCardGetCommission.data.error,
|
errorEnvoieWalletToCardGetCommission.data.error,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: I18n.t("OK"), onPress: () => {
|
text: I18n.t("OK"), onPress: () => {
|
||||||
this.props.getCommissionUserWalletToCardReset();
|
this.props.getCommissionUserWalletToCardReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
{ cancelable: false }
|
{ cancelable: false }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
this.props.navigation.setParams({ name: I18n.t('DEPOSIT_TO_CARD') })
|
this.props.navigation.setParams({name: I18n.t('DEPOSIT_TO_CARD')})
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
modalConfirmTransaction = (data) => {
|
/*
|
||||||
|
modalConfirmTransaction = (data) => {
|
||||||
|
|
||||||
const frais = data.response.frais;
|
const frais = data.response.frais;
|
||||||
const montant_net = data.response.montant_net;
|
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={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(this.state.montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
|
<Text tyle={[Typography.body2]}>{I18n.t('FEES_AND_TAXES')}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(frais, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(frais, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ paddingVertical: 10 }}>
|
<View style={{ paddingVertical: 10 }}>
|
||||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
|
<Text tyle={[Typography.body2, FontWeight.bold]}>{I18n.t('NET_AMOUNT')}:</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant_net, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
|
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isModalConfirmVisible: false
|
isModalConfirmVisible: false
|
||||||
});
|
});
|
||||||
}} />
|
}} />
|
||||||
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isModalConfirmVisible: false,
|
isModalConfirmVisible: false,
|
||||||
isDataSubmit: true
|
isDataSubmit: true
|
||||||
});
|
});
|
||||||
this.props.envoieUserWalletToCardAction({
|
this.props.envoieUserWalletToCardAction({
|
||||||
type: 2,
|
type: 2,
|
||||||
cvv: this.state.codeCVV,
|
cvv: this.state.codeCVV,
|
||||||
id_wallet_user: this.state.wallet.id,
|
id_wallet_user: this.state.wallet.id,
|
||||||
montant: this.state.montant,
|
montant: this.state.montant,
|
||||||
password: this.state.password
|
password: this.state.password
|
||||||
});
|
});
|
||||||
this.props.getCommissionUserWalletToCardReset();
|
this.props.getCommissionUserWalletToCardReset();
|
||||||
}} />
|
}} />
|
||||||
|
|
||||||
</Dialog.Container>
|
</Dialog.Container>
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
ckeckIfFieldIsOK(champ) {
|
ckeckIfFieldIsOK(champ) {
|
||||||
return (isNil(champ) || isEqual(champ.length, 0));
|
return (isNil(champ) || isEqual(champ.length, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
isMontantValid = () => {
|
isMontantValid = () => {
|
||||||
const { montant } = this.state;
|
const {montant} = this.state;
|
||||||
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
||||||
return {
|
return {
|
||||||
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
||||||
isValid: false
|
isValid: false
|
||||||
};
|
};
|
||||||
|
|
||||||
else if (!isNormalInteger(montant))
|
else if (!isNormalInteger(montant))
|
||||||
return {
|
return {
|
||||||
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
|
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
|
||||||
isValid: false
|
isValid: false
|
||||||
};
|
};
|
||||||
|
|
||||||
else
|
else
|
||||||
return {
|
return {
|
||||||
errorMessage: '',
|
errorMessage: '',
|
||||||
isValid: true
|
isValid: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmitSendWalletToCard = () => {
|
onSubmitSendWalletToBank = () => {
|
||||||
const { codeCVV, montant, password } = this.state;
|
const {montant, password, codeIban} = this.state;
|
||||||
|
|
||||||
if (this.ckeckIfFieldIsOK(codeCVV) && codeCVV === 3)
|
if (this.ckeckIfFieldIsOK(codeIban)) {
|
||||||
this.codeCVVAnim.shake(800);
|
if (!(codeIban.length >= 14 && codeIban <= 34))
|
||||||
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
this.codeIbanAnim.shake(800);
|
||||||
this.montantAnim.shake(800);
|
else
|
||||||
}
|
this.codeIbanAnim.shake(800);
|
||||||
else if (this.ckeckIfFieldIsOK(password))
|
} else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) {
|
||||||
this.passwordAnim.shake(800);
|
this.montantAnim.shake(800);
|
||||||
else {
|
} else if (this.ckeckIfFieldIsOK(password))
|
||||||
|
this.passwordAnim.shake(800);
|
||||||
|
else {
|
||||||
|
|
||||||
this.props.getCommissionUserWalletToCardAction({
|
console.log("id wallet network", this.state.bank);
|
||||||
type: 2,
|
this.props.envoieUserWalletToBankAction({
|
||||||
id_wallet_user: this.state.wallet.id,
|
type: 4,
|
||||||
montant: this.state.montant,
|
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({
|
this.setState({
|
||||||
triggerSubmitClick: true
|
isDataSubmit: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
renderLoader = () => {
|
renderLoader = () => {
|
||||||
return (
|
return (
|
||||||
<ProgressDialog
|
<ProgressDialog
|
||||||
visible={this.props.loadingEnvoieWalletToCard || this.props.loadingEnvoieWalletToCardGetCommission}
|
visible={this.props.loadingEnvoieWalletToBank}
|
||||||
title={I18n.t('LOADING')}
|
title={I18n.t('LOADING')}
|
||||||
message={I18n.t('LOADING_INFO')}
|
message={I18n.t('LOADING_INFO')}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { resultEnvoieWalletToCardGetCommission } = this.props;
|
return (
|
||||||
return (
|
<>
|
||||||
<>
|
{this.props.loadingEnvoieWalletToBank && this.renderLoader()}
|
||||||
{(this.props.loadingEnvoieWalletToCard || this.props.loadingEnvoieWalletToCardGetCommission) && this.renderLoader()}
|
{this.state.isDataSubmit && this.renderEnvoieWalletToBankResponse()}
|
||||||
{this.state.isDataSubmit && this.renderEnvoieWalletToWalletResponse()}
|
<ScrollView style={styles.container}>
|
||||||
{this.state.triggerSubmitClick && this.renderDialogGetCommissionResponse()}
|
|
||||||
{
|
|
||||||
(resultEnvoieWalletToCardGetCommission !== null) &&
|
|
||||||
(typeof resultEnvoieWalletToCardGetCommission.response !== 'undefined') &&
|
|
||||||
this.modalConfirmTransaction(resultEnvoieWalletToCardGetCommission)
|
|
||||||
}
|
|
||||||
<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 }}>
|
<Animatable.View ref={(comp) => {
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
this.codeIbanAnim = comp
|
||||||
label={I18n.t('CODE_IBAN')}
|
}}>
|
||||||
iconColor={'#f95a25'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
||||||
iconSize={20}
|
label={I18n.t('CODE_IBAN')}
|
||||||
value={this.state.codeCVV}
|
iconColor={'#f95a25'}
|
||||||
onChangeText={(codeCVV) => {
|
iconSize={20}
|
||||||
|
value={this.state.codeIban}
|
||||||
|
onChangeText={(codeIban) => {
|
||||||
|
|
||||||
this.setState({ codeCVV })
|
this.setState({codeIban})
|
||||||
}}
|
}}
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
>
|
>
|
||||||
</Fumi>
|
</Fumi>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.montantAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
this.montantAnim = comp
|
||||||
label={I18n.t('AMOUNT')}
|
}}>
|
||||||
iconColor={'#f95a25'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
||||||
keyboardType='numeric'
|
label={I18n.t('AMOUNT')}
|
||||||
iconSize={20}
|
iconColor={'#f95a25'}
|
||||||
value={this.state.montant}
|
keyboardType='numeric'
|
||||||
onChangeText={(montant) => {
|
iconSize={20}
|
||||||
this.setState({ montant })
|
value={this.state.montant}
|
||||||
}}
|
onChangeText={(montant) => {
|
||||||
style={styles.input}
|
this.setState({montant})
|
||||||
>
|
}}
|
||||||
</Fumi>
|
style={styles.input}
|
||||||
<View style={{
|
>
|
||||||
position: 'absolute',
|
</Fumi>
|
||||||
left: responsiveWidth(82),
|
<View style={{
|
||||||
top: 35,
|
position: 'absolute',
|
||||||
flexDirection: 'row'
|
left: responsiveWidth(82),
|
||||||
}}>
|
top: 35,
|
||||||
<View
|
flexDirection: 'row'
|
||||||
style={{
|
}}>
|
||||||
width: 1,
|
<View
|
||||||
borderLeftColor: '#f0f0f0',
|
style={{
|
||||||
height: 40,
|
width: 1,
|
||||||
left: -8,
|
borderLeftColor: '#f0f0f0',
|
||||||
top: -10,
|
height: 40,
|
||||||
borderLeftWidth: 1,
|
left: -8,
|
||||||
|
top: -10,
|
||||||
|
borderLeftWidth: 1,
|
||||||
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
||||||
</View>
|
</View>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
<Animatable.View ref={(comp) => {
|
||||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
this.passwordAnim = comp
|
||||||
label={I18n.t('PASSWORD')}
|
}}>
|
||||||
iconColor={'#f95a25'}
|
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||||
iconSize={20}
|
label={I18n.t('PASSWORD')}
|
||||||
secureTextEntry={true}
|
iconColor={'#f95a25'}
|
||||||
value={this.state.password}
|
iconSize={20}
|
||||||
onChangeText={(password) => {
|
secureTextEntry={true}
|
||||||
this.setState({ password })
|
value={this.state.password}
|
||||||
}}
|
onChangeText={(password) => {
|
||||||
style={styles.input}
|
this.setState({password})
|
||||||
>
|
}}
|
||||||
</Fumi>
|
style={styles.input}
|
||||||
</Animatable.View>
|
>
|
||||||
|
</Fumi>
|
||||||
|
</Animatable.View>
|
||||||
|
|
||||||
<Button style={styles.btnvalide}
|
<Button style={styles.btnvalide}
|
||||||
textStyle={styles.textbtnvalide}
|
textStyle={styles.textbtnvalide}
|
||||||
onPress={() => { /* this.onSubmitSendWalletToCard(); */ }}>
|
onPress={() => {
|
||||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
this.onSubmitSendWalletToBank()
|
||||||
</ScrollView>
|
}}>
|
||||||
</>
|
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||||
)
|
</ScrollView>
|
||||||
}
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const maptStateToProps = state => ({
|
const maptStateToProps = state => ({
|
||||||
|
|
||||||
loadingEnvoieWalletToCard: state.envoieUserWalletToCardReducer.loading,
|
loadingEnvoieWalletToBank: state.envoieUserWalletToBank.loading,
|
||||||
resultEnvoieWalletToCard: state.envoieUserWalletToCardReducer.result,
|
resultEnvoieWalletToBank: state.envoieUserWalletToBank.result,
|
||||||
errorEnvoieWalletToCard: state.envoieUserWalletToCardReducer.error,
|
errorEnvoieWalletToBank: state.envoieUserWalletToBank.error,
|
||||||
|
|
||||||
loadingEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.loading,
|
|
||||||
resultEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.result,
|
|
||||||
errorEnvoieWalletToCardGetCommission: state.envoieUserWalletToCardGetCommissionReducer.error,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||||
|
|
||||||
envoieUserWalletToCardAction,
|
envoieUserWalletToBankAction,
|
||||||
envoieUserWalletToCardReset,
|
envoieUserWalletToBankReset,
|
||||||
|
|
||||||
getCommissionUserWalletToCardAction,
|
|
||||||
getCommissionUserWalletToCardReset
|
|
||||||
|
|
||||||
}, dispatch);
|
}, dispatch);
|
||||||
|
|
||||||
export default connect(maptStateToProps, mapDispatchToProps)(EnvoieWalletToBankUser);
|
export default connect(maptStateToProps, mapDispatchToProps)(EnvoieWalletToBankUser);
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: Color.primaryDarkColor,
|
backgroundColor: Color.primaryDarkColor,
|
||||||
},
|
},
|
||||||
textbtnvalide: {
|
textbtnvalide: {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontWeight: 'bold'
|
fontWeight: 'bold'
|
||||||
},
|
},
|
||||||
bigtitle: {
|
bigtitle: {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
margin: 20,
|
margin: 20,
|
||||||
},
|
},
|
||||||
blockView: {
|
blockView: {
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
borderBottomWidth: 1
|
borderBottomWidth: 1
|
||||||
},
|
},
|
||||||
subbigtitle: {
|
subbigtitle: {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
margin: 5,
|
margin: 5,
|
||||||
},
|
},
|
||||||
btnvalide: {
|
btnvalide: {
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
marginLeft: 20,
|
marginLeft: 20,
|
||||||
marginRight: 20,
|
marginRight: 20,
|
||||||
borderColor: 'transparent',
|
borderColor: 'transparent',
|
||||||
backgroundColor: Color.accentLightColor,
|
backgroundColor: Color.accentLightColor,
|
||||||
height: 52
|
height: 52
|
||||||
},
|
},
|
||||||
btnSubmit: {
|
btnSubmit: {
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
borderColor: 'transparent',
|
borderColor: 'transparent',
|
||||||
backgroundColor: Color.accentLightColor,
|
backgroundColor: Color.accentLightColor,
|
||||||
height: 52,
|
height: 52,
|
||||||
width: "30%",
|
width: "30%",
|
||||||
marginLeft: 20,
|
marginLeft: 20,
|
||||||
marginRight: 20,
|
marginRight: 20,
|
||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
height: 60,
|
height: 60,
|
||||||
marginTop: responsiveHeight(2),
|
marginTop: responsiveHeight(2),
|
||||||
marginLeft: responsiveWidth(5),
|
marginLeft: responsiveWidth(5),
|
||||||
marginRight: responsiveWidth(5),
|
marginRight: responsiveWidth(5),
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -56,7 +56,7 @@ class EnvoieWalletToCashUser extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
paysDestination: [],
|
paysDestination: [],
|
||||||
paysDestinationSelect: null,
|
paysDestinationSelect: null,
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
|
|
@ -631,8 +631,8 @@ class EnvoieWalletToCashUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class EnvoieWalletToWalletUser extends Component {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
identityPieces: identityPieces(),
|
identityPieces: identityPieces(),
|
||||||
identityPiecesName: (identityPieces()[0]).name,
|
identityPiecesName: I18n.t((identityPieces()[0]).name),
|
||||||
paysDestination: [],
|
paysDestination: [],
|
||||||
paysDestinationSelect: null,
|
paysDestinationSelect: null,
|
||||||
walletActifs: [],
|
walletActifs: [],
|
||||||
|
|
@ -603,8 +603,8 @@ class EnvoieWalletToWalletUser extends Component {
|
||||||
onChangeText={(value, index, data) => {
|
onChangeText={(value, index, data) => {
|
||||||
this.setState({ identityPiecesName: value });
|
this.setState({ identityPiecesName: value });
|
||||||
}}
|
}}
|
||||||
valueExtractor={(value) => { return value.name }}
|
valueExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
labelExtractor={(value) => { return value.name }}
|
labelExtractor={(value) => { return I18n.t(value.name) }}
|
||||||
/>
|
/>
|
||||||
</Animatable.View>
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -35,6 +35,7 @@
|
||||||
"ASK_MEMBERS": "Membership applications",
|
"ASK_MEMBERS": "Membership applications",
|
||||||
"MY_ACCOUNT": "My account",
|
"MY_ACCOUNT": "My account",
|
||||||
"WALLET": "Wallet",
|
"WALLET": "Wallet",
|
||||||
|
"NO_BANK_AVAILABLE": "No bank available",
|
||||||
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
"ENTER_VALID_AMOUNT": "Enter a valid amount",
|
||||||
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
"ENTER_AMOUNT_SUPERIOR_ZEROR": "Enter amount superior to zero",
|
||||||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
"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",
|
"DEPOSIT_WALLET_TO_BANK": "Your Wallet to bank",
|
||||||
"ENVOIE_WALLET_TO_BANK": "Send Wallet to bank",
|
"ENVOIE_WALLET_TO_BANK": "Send Wallet to bank",
|
||||||
"DEPOSIT_CASH_TO_CASH": "Cash to cash",
|
"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",
|
"TRANSACTION_DETAIL": "Transaction detail",
|
||||||
"DEMAND_DETAIL": "Demand detail",
|
"DEMAND_DETAIL": "Demand detail",
|
||||||
"CODE_IBAN": "IBAN Code",
|
"CODE_IBAN": "IBAN Code",
|
||||||
|
|
@ -140,7 +141,7 @@
|
||||||
"OPEN_ACCOUNT": "Open account",
|
"OPEN_ACCOUNT": "Open account",
|
||||||
"MANAGE_CREDIT": "Manage credit",
|
"MANAGE_CREDIT": "Manage credit",
|
||||||
"MANAGE_SAVINGS": "Manage savings",
|
"MANAGE_SAVINGS": "Manage savings",
|
||||||
"INIT_COUNTRY": "Departure countryt",
|
"INIT_COUNTRY": "Departure country",
|
||||||
"FINAL_COUNTRY": "Arrival country",
|
"FINAL_COUNTRY": "Arrival country",
|
||||||
"INIT_AMOUNT": "Init amount",
|
"INIT_AMOUNT": "Init amount",
|
||||||
"FINAL_AMOUNT": "Final amount",
|
"FINAL_AMOUNT": "Final amount",
|
||||||
|
|
@ -161,11 +162,15 @@
|
||||||
"DEMAND_NANO_CREDIT": "Nano credit demand",
|
"DEMAND_NANO_CREDIT": "Nano credit demand",
|
||||||
"REFUND_NANO_CREDIT": "Refund nano credit",
|
"REFUND_NANO_CREDIT": "Refund nano credit",
|
||||||
"REFUND_DONE": "Refund done",
|
"REFUND_DONE": "Refund done",
|
||||||
"SAVE_MONEY": "Epargner de l'argent",
|
"SAVE_MONEY": "Save money",
|
||||||
"SAVE_MONEY_TYPE": "Savings type",
|
"SAVE_MONEY_TYPE": "Savings type",
|
||||||
"CAUTION_CREDIT": "Caution credit demand",
|
"CAUTION_CREDIT": "Caution credit demand",
|
||||||
"ID_DEMAND": "Demand ID",
|
"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",
|
"DEMAND_DATE": "Demand date",
|
||||||
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
||||||
"DATE_REMBOURSEMENT": "Refund date",
|
"DATE_REMBOURSEMENT": "Refund date",
|
||||||
|
|
@ -174,7 +179,7 @@
|
||||||
"FINAL_DATE": "End date",
|
"FINAL_DATE": "End date",
|
||||||
"CASSATION_DATE": "Cassation date",
|
"CASSATION_DATE": "Cassation date",
|
||||||
"VALIDATION_DATE": "Validation date",
|
"VALIDATION_DATE": "Validation date",
|
||||||
|
"HISTORY_DETAIL": "History detail",
|
||||||
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
||||||
"PAIEMENT_FACTURE": "Bill payment",
|
"PAIEMENT_FACTURE": "Bill payment",
|
||||||
"NUMERO_ABONNE": "Subscriber number",
|
"NUMERO_ABONNE": "Subscriber number",
|
||||||
|
|
@ -273,6 +278,7 @@
|
||||||
"IDENTITY_NUMBER": "N° of piece",
|
"IDENTITY_NUMBER": "N° of piece",
|
||||||
"IDENTITY_PIECE_EXPIRY_DATE": "Expiry date",
|
"IDENTITY_PIECE_EXPIRY_DATE": "Expiry date",
|
||||||
"LAST_STEP": "Last step",
|
"LAST_STEP": "Last step",
|
||||||
|
"ID_TRANSACTION": "Transaction ID",
|
||||||
"ACTIVE_ACCOUNT": "Activate the account !",
|
"ACTIVE_ACCOUNT": "Activate the account !",
|
||||||
"ACTIVE_USER": "Active",
|
"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",
|
"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",
|
"CREATE_MY_IDENTIFICATION": "Create my identification",
|
||||||
"NOT_IDENTIFIED": "This number exists, its identification is not yet entered",
|
"NOT_IDENTIFIED": "This number exists, its identification is not yet entered",
|
||||||
"NOT_VALIDATED": "Your identicaiton is not yet validated",
|
"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",
|
"MODIFY_IDENTIFICATION": "Modify my identification",
|
||||||
"NOT_YET_IDENTIFY": "You are not yet identified",
|
"NOT_YET_IDENTIFY": "You are not yet identified",
|
||||||
"IDENTIFICATION": " Identification",
|
"IDENTIFICATION": " Identification",
|
||||||
"CREATION_IDENTIFICATION": "Creation",
|
"CREATION_IDENTIFICATION": "Creation",
|
||||||
"CREATION_IDENTIFICATION_CLIENT": "Identify me",
|
"CREATION_IDENTIFICATION_CLIENT": "Identify me",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a client",
|
"CREATION_IDENTIFICATION_DESCRIPTION": "Identify a customer",
|
||||||
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a client",
|
"CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN": "Enter the identity of a customer",
|
||||||
"VALIDATE_IDENTIFICATION": "Validation",
|
"VALIDATE_IDENTIFICATION": "Validation",
|
||||||
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
"VALIDATE_IDENTIFICATION_DESCRIPTION": "Validate an identi...",
|
||||||
"IDENTIFICATION_INFORMATION": "Identification information",
|
"IDENTIFICATION_INFORMATION": "Identification information",
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
"AMOUNT_LABEL_DESCRIPTION": "Veuillez saisir le montant",
|
||||||
"DESTINATAIRE": "Destinataire",
|
"DESTINATAIRE": "Destinataire",
|
||||||
"ERROR_LABEL": "Erreur",
|
"ERROR_LABEL": "Erreur",
|
||||||
|
"NO_BANK_AVAILABLE": "Aucune banque disponible",
|
||||||
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
||||||
"SUCCESS": "Succès",
|
"SUCCESS": "Succès",
|
||||||
"ETAT": "Etat",
|
"ETAT": "Etat",
|
||||||
|
|
@ -172,7 +173,11 @@
|
||||||
"REFUND_DONE": "Remboursement effectué",
|
"REFUND_DONE": "Remboursement effectué",
|
||||||
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
||||||
"ID_DEMAND": "Identifiant de la demande",
|
"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",
|
"DEMAND_DATE": "Date de la demande",
|
||||||
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
||||||
"DATE_REMBOURSEMENT": "Date de remboursement",
|
"DATE_REMBOURSEMENT": "Date de remboursement",
|
||||||
|
|
@ -181,7 +186,7 @@
|
||||||
"FINAL_DATE": "Date de fin",
|
"FINAL_DATE": "Date de fin",
|
||||||
"CASSATION_DATE": "Date de cassation",
|
"CASSATION_DATE": "Date de cassation",
|
||||||
"VALIDATION_DATE": "Date de validation",
|
"VALIDATION_DATE": "Date de validation",
|
||||||
|
"HISTORY_DETAIL": "Détail de l'historique",
|
||||||
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
||||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||||
"NUMERO_ABONNE": "Numéro d'abonnée",
|
"NUMERO_ABONNE": "Numéro d'abonnée",
|
||||||
|
|
|
||||||
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,84 +1,114 @@
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import { store } from "../redux/store";
|
import {store} from "../redux/store";
|
||||||
import { envoieUserWalletToWallet, envoieCommissionUrl } from "./IlinkConstants";
|
import {envoieCommissionUrl, envoieUserWalletToWallet} 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 {
|
||||||
|
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) => {
|
export const envoieUserWalletToWalletAction = (data) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToWalletPending());
|
dispatch(fetchEnvoieUserWalletToWalletPending());
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: `${envoieUserWalletToWallet}`,
|
url: `${envoieUserWalletToWallet}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': authKey,
|
'Authorization': authKey,
|
||||||
'X-Localization': I18n.currentLocale()
|
'X-Localization': I18n.currentLocale()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
dispatch(fetchEnvoieUserWalletToWalletSuccess(response));
|
dispatch(fetchEnvoieUserWalletToWalletSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchEnvoieUserWalletToWalletError(error.response));
|
dispatch(fetchEnvoieUserWalletToWalletError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
dispatch(fetchEnvoieUserWalletToWalletError(error.request))
|
dispatch(fetchEnvoieUserWalletToWalletError(error.request))
|
||||||
else
|
else
|
||||||
dispatch(fetchEnvoieUserWalletToWalletError(error.message))
|
dispatch(fetchEnvoieUserWalletToWalletError(error.message))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const envoieUserWalletToWalletReset = () => {
|
export const envoieUserWalletToWalletReset = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToWalletReset());
|
dispatch(fetchEnvoieUserWalletToWalletReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getCommissionUserWalletToWalletAction = (data) => {
|
export const getCommissionUserWalletToWalletAction = (data) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontPending());
|
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontPending());
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: `${envoieCommissionUrl}`,
|
url: `${envoieCommissionUrl}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': authKey,
|
'Authorization': authKey,
|
||||||
'X-Localization': I18n.currentLocale()
|
'X-Localization': I18n.currentLocale()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
dispatch(fetchEnvoieUserWalletToWalletGetCommissionSuccess(response));
|
dispatch(fetchEnvoieUserWalletToWalletGetCommissionSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.response));
|
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.request))
|
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.request))
|
||||||
else
|
else
|
||||||
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.message))
|
dispatch(fetchEnvoieUserWalletToWalletGetCommissionError(error.message))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getCommissionUserWalletToWalletReset = () => {
|
export const getCommissionUserWalletToWalletReset = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontReset());
|
dispatch(fetchEnvoieUserWalletToWalleGetCommissiontReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -88,78 +118,78 @@ export const getCommissionUserWalletToWalletReset = () => {
|
||||||
|
|
||||||
export const envoieUserWalletToCashAction = (data) => {
|
export const envoieUserWalletToCashAction = (data) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCashPending());
|
dispatch(fetchEnvoieUserWalletToCashPending());
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: `${envoieUserWalletToWallet}`,
|
url: `${envoieUserWalletToWallet}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': authKey,
|
'Authorization': authKey,
|
||||||
'X-Localization': I18n.currentLocale()
|
'X-Localization': I18n.currentLocale()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
dispatch(fetchEnvoieUserWalletToCashSuccess(response));
|
dispatch(fetchEnvoieUserWalletToCashSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchEnvoieUserWalletToCashError(error.response));
|
dispatch(fetchEnvoieUserWalletToCashError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
dispatch(fetchEnvoieUserWalletToCashError(error.request))
|
dispatch(fetchEnvoieUserWalletToCashError(error.request))
|
||||||
else
|
else
|
||||||
dispatch(fetchEnvoieUserWalletToCashError(error.message))
|
dispatch(fetchEnvoieUserWalletToCashError(error.message))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const envoieUserWalletToCashReset = () => {
|
export const envoieUserWalletToCashReset = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCashReset());
|
dispatch(fetchEnvoieUserWalletToCashReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getCommissionUserWalletToCashAction = (data) => {
|
export const getCommissionUserWalletToCashAction = (data) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCashGetCommissiontPending());
|
dispatch(fetchEnvoieUserWalletToCashGetCommissiontPending());
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: `${envoieCommissionUrl}`,
|
url: `${envoieCommissionUrl}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': authKey,
|
'Authorization': authKey,
|
||||||
'X-Localization': I18n.currentLocale()
|
'X-Localization': I18n.currentLocale()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
dispatch(fetchEnvoieUserWalletToCashGetCommissionSuccess(response));
|
dispatch(fetchEnvoieUserWalletToCashGetCommissionSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.response));
|
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.request))
|
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.request))
|
||||||
else
|
else
|
||||||
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.message))
|
dispatch(fetchEnvoieUserWalletToCashGetCommissionError(error.message))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getCommissionUserWalletToCashReset = () => {
|
export const getCommissionUserWalletToCashReset = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCashGetCommissiontReset());
|
dispatch(fetchEnvoieUserWalletToCashGetCommissiontReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -168,76 +198,114 @@ export const getCommissionUserWalletToCashReset = () => {
|
||||||
|
|
||||||
export const envoieUserWalletToCardAction = (data) => {
|
export const envoieUserWalletToCardAction = (data) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCardPending());
|
dispatch(fetchEnvoieUserWalletToCardPending());
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: `${envoieUserWalletToWallet}`,
|
url: `${envoieUserWalletToWallet}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': authKey,
|
'Authorization': authKey,
|
||||||
'X-Localization': I18n.currentLocale()
|
'X-Localization': I18n.currentLocale()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
dispatch(fetchEnvoieUserWalletToCardSuccess(response));
|
dispatch(fetchEnvoieUserWalletToCardSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchEnvoieUserWalletToCardError(error.response));
|
dispatch(fetchEnvoieUserWalletToCardError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
dispatch(fetchEnvoieUserWalletToCardError(error.request))
|
dispatch(fetchEnvoieUserWalletToCardError(error.request))
|
||||||
else
|
else
|
||||||
dispatch(fetchEnvoieUserWalletToCardError(error.message))
|
dispatch(fetchEnvoieUserWalletToCardError(error.message))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const envoieUserWalletToCardReset = () => {
|
export const envoieUserWalletToCardReset = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCardReset());
|
dispatch(fetchEnvoieUserWalletToCardReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getCommissionUserWalletToCardAction = (data) => {
|
export const getCommissionUserWalletToCardAction = (data) => {
|
||||||
|
|
||||||
const auth = store.getState().authKeyReducer;
|
const auth = store.getState().authKeyReducer;
|
||||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCardGetCommissiontPending());
|
dispatch(fetchEnvoieUserWalletToCardGetCommissiontPending());
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: `${envoieCommissionUrl}`,
|
url: `${envoieCommissionUrl}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data,
|
data,
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': authKey,
|
'Authorization': authKey,
|
||||||
'X-Localization': I18n.currentLocale()
|
'X-Localization': I18n.currentLocale()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
dispatch(fetchEnvoieUserWalletToCardGetCommissionSuccess(response));
|
dispatch(fetchEnvoieUserWalletToCardGetCommissionSuccess(response));
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.response)
|
if (error.response)
|
||||||
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.response));
|
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.response));
|
||||||
else if (error.request)
|
else if (error.request)
|
||||||
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.request))
|
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.request))
|
||||||
else
|
else
|
||||||
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.message))
|
dispatch(fetchEnvoieUserWalletToCardGetCommissionError(error.message))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getCommissionUserWalletToCardReset = () => {
|
export const getCommissionUserWalletToCardReset = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(fetchEnvoieUserWalletToCardGetCommissiontReset());
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -69,14 +69,14 @@ export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCre
|
||||||
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
||||||
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
|
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
|
||||||
export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_hyper_history';
|
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 authKeyUrl = testBaseUrl + '/oauth/token';
|
||||||
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY";
|
||||||
export const MARKER_URL = baseUrl + "/interacted/LocationAction.php";
|
export const MARKER_URL = baseUrl + "/interacted/LocationAction.php";
|
||||||
|
|
||||||
export const authKeyData = {
|
export const authKeyData = {
|
||||||
"grant_type": "password",
|
"grant_type": "password",
|
||||||
"client_id": "2",
|
"client_id": "2",
|
||||||
"client_secret": "rrbvxACJPBOG4cqjDNlstSljlmjydLon3P55JMav",
|
"client_secret": "rrbvxACJPBOG4cqjDNlstSljlmjydLon3P55JMav",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue