switch to test branch

This commit is contained in:
Brice Zele 2020-07-15 17:25:32 +01:00
parent 27acb86dff
commit 7339ecb3dd
9 changed files with 504 additions and 255 deletions

File diff suppressed because one or more lines are too long

View File

@ -45,5 +45,11 @@
"envoieWalletToBankUser": "envoieWalletToBankUser",
"retraitWalletVersCashUser": "retraitWalletVersCashUser",
"retraitCarteVersCashUser": "retraitCarteVersCashUser",
"retraitCarteVersWalletUser": "retraitCarteVersWalletUser"
"retraitCarteVersWalletUser": "retraitCarteVersWalletUser",
"retraitEnCashAgent": "retraitEnCashAgent",
"retraitCarteVersCashAgent": "retraitCarteVersCashAgent",
"envoieCashVersWalletAgent": "envoieCashVersWalletAgent",
"envoieCashVersAutreWalletAgent": "envoieCashVersAutreWalletAgent",
"envoieCashVersCarteAgent": "envoieCashVersCarteAgent",
"envoiCashVersCashAgent": "envoiCashVersCashAgent"
}

View File

@ -43,6 +43,8 @@
"DEPOSIT_DESCRIPTION": "Make a deposit",
"ERROR_TRANSFER": "Transfer error",
"SUCCESS_TRANSFER": "Transfer done",
"WITHDRAWAL_SUCCESS": "Withdrawal done",
"WITHDRAWAL_ERROR": "Withdrawal error",
"WALLET_TO_WALLET_SUCCESS_TRANSFER": "Wallet to wallet transfer successfully completed",
"DEPOSIT": "Deposit",
"ENVOIE_ARGENT": "Send money",
@ -75,10 +77,15 @@
"WITHDRAWAL_CARD_TO_WALLET": "Withdrawal card to wallet",
"WITHDRAWAL_CARD_TO_WALLET_DESCRIPTION": "Withdrawal money from your card to your wallet",
"WITHDRAWAL_CARD_TO_CASH": "Withdrawal card to cash",
"WITHDRAWAL_CARD_TO_CASH_AGENT": "Withdrawal card to cash",
"WITHDRAWAL_CARD_TO_CASH_DESCRIPTION": "Withdrawal money from card to cash",
"DEPOSIT_CASH_TO_WALLET": "Cash to wallet",
"WITHDRAWAL_CARD_TO_CASH_DESCRIPTION_AGENT": "Withdrawal money from card to cash",
"DEPOSIT_CASH_TO_WALLET": "Cash to iLinkWorld wallet",
"DEPOSIT_CASH_TO_WALLET_DESCRIPTION": "Deposit Cash to iLinkWorld wallet",
"DEPOSIT_CASH_TO_OTHER_WALLET": "Cash to another wallet",
"DEPOSIT_CASH_TO_OTHER_WALLET_DESCRIPTION": "Send Cash to another wallet",
"DEPOSIT_CASH_TO_VISA": "Cash to visa card",
"DEPOSIT_CASH_TO_VISA_DESCRIPTION": "Deposit money Cash to visa card",
"DEPOSIT_CASH_TO_BANK": "Cash to bank",
"DEPOSIT_WALLET_TO_WALLET": "Wallet to wallet",
"ENVOIE_WALLET_TO_WALLET": "Send Wallet to wallet",
@ -88,14 +95,19 @@
"ENVOIE_WALLET_TO_CASH": "Send Wallet to cash",
"DEPOSIT_WALLET_TO_BANK": "Your Wallet to bank",
"ENVOIE_WALLET_TO_BANK": "Send Wallet to bank",
"DEPOSIT_CASH_TO_CASH": "Cash to cash",
"ENVOIE_CASH_TO_CASH": "Send money in cash to cash",
"TRANSACTION_DETAIL": "Transaction detail",
"CODE_IBAN": "IBAN Code",
"FEES_AND_TAXES": "Fees and taxes",
"INIT_COUNTRY": "Departure countryt",
"FINAL_COUNTRY": "Arrival country",
"INIT_AMOUNT": "Init amount",
"FINAL_AMOUNT": "Final amount",
"NET_AMOUNT": "Net amount",
"CODE_WALLET": "Wallet Code",
"ACTIVE_WALLET": "Active wallet",
"CODE_RETRAIT": "Withdrawal code",
"ACTIVE_WALLET": "Paying network",
"TYPE_IDENTIFIANT": "ID type",
"PAYS_DESTINATION": "Destination country",
"DEPOSIT_TO_CASH": "Your Wallet to cash",
@ -123,6 +135,8 @@
"PRINCIPAL": "Principal",
"ENTER_YOUR_CARD_ID": "Please enter your bank card ID",
"SELECT_YOUR_WALLET": "Select your wallet",
"TRANSACTION_ID": "Transaction number",
"OPERATION": "Operation",
"TRANSACTIONS": "Transactions",
"TRANSACTION_HISTORY": "Transactions history",
"HISTORY": "History",
@ -150,6 +164,16 @@
"GROUP_MEMBERS": "The group members",
"NAME": "Last name(s)",
"FIRSTNAME": "First name(s) ",
"NAME_EMETTEUR": "Issuer first name(s)",
"EMETTEUR": "Issuer",
"FIRSTNAME_EMETTEUR": "Issuer last name(s) ",
"EMAIL_EMETTEUR": "Issuer email ",
"ID_DESTINATAIRE": "Destination ID",
"NUMERO_IDENTITE_EMETTEUR": "Issuer ID number",
"NAME_DESTINATAIRE": "Recipient first name(s)",
"FIRSTNAME_DESTINATAIRE": "Recipient last name(s)",
"EMAIL_DESTINATAIRE": "Recipient email ",
"NUMERO_IDENTITE_DESTINATAIRE": "Recipient's identity number",
"AND": "and",
"ADMIN": "Administrator",
"SUPER_ADMIN": "Super administrator",

View File

@ -71,6 +71,8 @@
"DEPOSIT_DESCRIPTION": "Effectuer un dépôt",
"ERROR_TRANSFER": "Erreur de transfert",
"SUCCESS_TRANSFER": "Transfert effectué",
"WITHDRAWAL_SUCCESS": "Retrait effectué",
"WITHDRAWAL_ERROR": "Erreur de retrait",
"WALLET_TO_WALLET_SUCCESS_TRANSFER": "Transfert de wallet à wallet effectué avec succès",
"WITHDRAWAL": "Retrait",
"LINK_CARD": "Lier ma carte",
@ -80,10 +82,15 @@
"WITHDRAWAL_CARD_TO_WALLET": "Retrait de votre carte vers wallet",
"WITHDRAWAL_CARD_TO_WALLET_DESCRIPTION": "Retrait d'argent de votre carte vers wallet",
"WITHDRAWAL_CARD_TO_CASH": "Retrait de votre carte vers cash",
"WITHDRAWAL_CARD_TO_CASH_AGENT": "Retrait carte vers cash",
"WITHDRAWAL_CARD_TO_CASH_DESCRIPTION": "Retrait de l'argent de votre carte vers cash",
"DEPOSIT_CASH_TO_WALLET": "Cash vers wallet",
"WITHDRAWAL_CARD_TO_CASH_DESCRIPTION_AGENT": "Retrait de l'argent de carte vers cash",
"DEPOSIT_CASH_TO_WALLET": "Cash vers wallet iLinkWorld",
"DEPOSIT_CASH_TO_WALLET_DESCRIPTION": "Dépôt Cash vers wallet iLinkWorld",
"DEPOSIT_CASH_TO_OTHER_WALLET": "Cash vers autre wallet",
"DEPOSIT_CASH_TO_OTHER_WALLET_DESCRIPTION": "Envoie de Cash vers autre wallet",
"DEPOSIT_CASH_TO_VISA": "Cash vers carte visa",
"DEPOSIT_CASH_TO_VISA_DESCRIPTION": "Envoie d'argent de Cash vers carte visa",
"DEPOSIT_CASH_TO_BANK": "Cash vers banque",
"DEPOSIT_WALLET_TO_WALLET": "Votre Wallet vers wallet",
"ENVOIE_WALLET_TO_WALLET": "Envoie Wallet vers wallet",
@ -93,16 +100,21 @@
"ENVOIE_WALLET_TO_CARD": "Envoie Wallet vers carte",
"DEPOSIT_WALLET_TO_BANK": "Votre Wallet vers banque",
"ENVOIE_WALLET_TO_BANK": "Envoie Wallet vers banque",
"DEPOSIT_CASH_TO_CASH": "Cash vers cash",
"ENVOIE_CASH_TO_CASH": "Envoie d'argent en cash vers cash",
"TRANSACTION_DETAIL": "Détail de la transaction",
"FEES_AND_TAXES": "Frais et taxes",
"CODE_IBAN": "Code IBAN",
"INIT_COUNTRY": "Pays de départ",
"FINAL_COUNTRY": "Pays d'arrivée",
"INIT_AMOUNT": "Montant initial",
"FINAL_AMOUNT": "Montant final",
"NET_AMOUNT": "Montant net",
"CODE_WALLET": "Code Wallet",
"CODE_RETRAIT": "Code Retrait",
"TYPE_IDENTIFIANT": "Type d'identifiant",
"PAYS_DESTINATION": "Pays destination",
"ACTIVE_WALLET": "Wallet actif",
"ACTIVE_WALLET": "Réseau payeur",
"DEPOSIT_TO_CASH": "Votre Wallet vers cash",
"DEPOSIT_TO_CARD": "Votre Wallet vers carte",
"DEPOSIT_TO_BANK": "Votre Wallet vers banque",
@ -121,6 +133,8 @@
"NUMERO_COMPTE": "N° de compte",
"COMMISSION_TRANSFER_SUCCESS": "Les commissions ont été transférées vers le compte principal",
"COMMISSION_TRANSFER_ERROR_EMPTY": "Le solde commission est vide",
"TRANSACTION_ID": "Numéro de transaction",
"OPERATION": "Opération",
"TRANSACTIONS": "Transactions",
"TRANSACTION_HISTORY": "Historique des transactions",
"HISTORY": "Historique",
@ -154,6 +168,16 @@
"GROUP_MEMBERS": "Les membres du groupe",
"NAME": "Nom(s)",
"FIRSTNAME": "Prénom(s) ",
"NAME_EMETTEUR": "Nom(s) émetteur",
"EMETTEUR": "Emetteur",
"FIRSTNAME_EMETTEUR": "Prénom(s) émetteur",
"EMAIL_EMETTEUR": "Email émetteur ",
"ID_DESTINATAIRE": "Identifiant destinataire ",
"NUMERO_IDENTITE_EMETTEUR": "Numéro d'identité de l'émetteur",
"NAME_DESTINATAIRE": "Nom(s) destinataire",
"FIRSTNAME_DESTINATAIRE": "Prénom(s) destinatire",
"EMAIL_DESTINATAIRE": "Email destinataire ",
"NUMERO_IDENTITE_DESTINATAIRE": "Numéro d'identité du destinataire",
"AND": "et",
"ADMIN": "Administrateur",
"SUPER_ADMIN": "Super administrateur",
@ -185,6 +209,7 @@
"IDENTITY_NUMBER": "N° de la pièce",
"IDENTITY_PIECE_EXPIRY_DATE": "Date d'expiration",
"LAST_STEP": "Derniere étape",
"ID_TRANSACTION": "Identifiant de la transaction",
"ACTIVE_ACCOUNT": "Activez le compte !",
"ACTIVE_USER": "Activer",
"LAST_STEP_TEXT": "Activez votre compte à l'aide du code de validation qui vous a été envoyé sur votre adresse e-mail et sur votre numero de téléphone",

View File

@ -1390,7 +1390,7 @@ class Home extends BaseScreen {
translucent={true}
/>
{/* Start here to comment */}
{/* {
{
(this.state.loadingDialog || this.props.loading) ?
<View
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
@ -1426,7 +1426,7 @@ class Home extends BaseScreen {
this.setState({ showProgress: false })
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
}}
/> */}
/>
{this.makeCardSearch()}
{this.makeSlidingUp()}
{this.makeDialogLoader()}

View File

@ -256,7 +256,8 @@ export default class OptionsMenu extends Component {
|| item === 'createIdentificationUser' || item === 'operateurOptionSelect' || item === 'paiementFacture' || item === 'envoieWalletToWalletUser'
|| item === 'envoieWalletToCashUser' || item === 'linkCard' || item === 'envoieWalletToCardUser' || item === 'envoieWalletToBankUser' || item === 'retraitWalletVersCashUser'
|| item === 'retraitCarteVersWalletUser' || item === 'retraitEnCashAgent' || item === 'retraitCarteVersCashAgent' || item === 'envoieCashVersWalletAgent'
|| item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent') {
|| item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent'
|| item === 'envoieCashVersCarteAgent') {
return null
} else {
const color = this.state.currentId === item.id ? theme.accent : "grey"

View File

@ -8,6 +8,7 @@ import Icons from 'react-native-vector-icons/Ionicons'
import { Images } from '../../config/Images';
import CustomButton from '../../components/CustomButton';
import { Color } from '../../config/Color';
import omit from 'lodash/omit';
import Tag from '../../components/Tag';
import { IlinkEmitter } from "../../utils/events";
import { CreditCardInput } from "react-native-credit-card-input";
@ -15,11 +16,11 @@ import { Typography, FontWeight } from '../../config/typography';
import { responsiveHeight, responsiveWidth, } from 'react-native-responsive-dimensions';
import { getWalletDetailActivated, resetWalletListDetailReducer } from '../../webservice/WalletApi';
import { depositActionReset } from '../../webservice/DepositApi';
import { getWalletTransactionHistory, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
import { getWalletTransactionHistoryUser, getWalletTransactionHistoryReset } from '../../webservice/WalletTransactionHistoryApi';
import { getUserIdentificationAction, getUserIdentificationResetAction } from '../../webservice/IdentificationApi';
import { transferCommissionAction } from '../../webservice/WalletTransferCommission';
import { resetCommissionReducer } from '../../webservice/WalletTransferCommission';
import Dialog, { DialogContent, DialogTitle, DialogFooter, DialogButton } from 'react-native-popup-dialog';
import Dialog from "react-native-dialog";
import isEqual from 'lodash/isEqual';
import { baseUrl } from '../../webservice/IlinkConstants';
let moment = require('moment-timezone');
@ -33,7 +34,7 @@ import 'moment/locale/en-nz'
import 'moment/locale/en-gb'
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { thousandsSeparators, isEmptyObject, transactionHistoryUser, optionDepotUserScreen, optionRetraitUserScreen, transactionHistoryLabel, optionPaiementFacture, displayToast } from '../../utils/UtilsFunction';
import { thousandsSeparators, isEmptyObject, transactionHistoryUser, optionDepotUserScreen, optionRetraitUserScreen, transactionHistoryLabel, optionPaiementFacture, displayToast, transactionHistoryIlinkLabel, isIlinkWorldWallet, cutStringWithoutDot } from '../../utils/UtilsFunction';
import DeviceInfo from 'react-native-device-info';
import { readUser } from '../../webservice/AuthApi';
const thousands = require('thousands');
@ -56,6 +57,8 @@ class WalletDetailUser extends Component {
isTriggerRefresh: false,
scrollHeaderY: 0,
user: null,
displayModalHistory: false,
historyItemDetail: null,
isIdentified: false,
isIdentifiedValidated: false,
@ -80,7 +83,6 @@ class WalletDetailUser extends Component {
this.props.resetWalletListDetailReducer();
this.props.getWalletDetailActivated(this.props.navigation.state.params.userId, null);
this.props.getWalletTransactionHistory(this.props.navigation.state.params.userId, true);
this.props.getUserIdentificationResetAction();
readUser().then((user) => {
@ -88,6 +90,7 @@ class WalletDetailUser extends Component {
if (user !== undefined) {
this.setState({ user });
this.props.getUserIdentificationAction(user.phone);
this.props.getWalletTransactionHistoryUser(user.id);
}
}
});
@ -126,10 +129,11 @@ class WalletDetailUser extends Component {
if (result !== null) {
if (typeof result.response !== 'undefined') {
const wallet = result.response[0];
console.log("WALLET RECUPERER", wallet);
this.setState({
wallet: wallet,
isTriggerRefresh: false
})
});
}
}
@ -606,7 +610,7 @@ class WalletDetailUser extends Component {
</View>
</>
{this.renderHistoryTransaction()}
{this.renderHistoryTransaction(wallet)}
</View>
@ -625,25 +629,151 @@ class WalletDetailUser extends Component {
}
renderHistoryTransactionItem = (item, index) => {
renderModalHistoryDetail = () => {
const { historyItemDetail } = this.state;
return (
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
<Dialog.Container useNativeDriver={true} visible={this.state.displayModalHistory}>
<Dialog.Title>Détail de l'historique</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('OPERATION')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.operation}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text style={[styles.body2]}>{I18n.t('TRANSACTION_ID')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_transaction}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text style={[styles.body2]}>Date</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('INIT_COUNTRY')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.init_country}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant}</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]}>{this.state.historyItemDetail.frais}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('NET_AMOUNT')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_net_init}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('EMETTEUR')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.emetteur}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('DESTINATAIRE')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.destinataire}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('FINAL_COUNTRY')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.final_country}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('NET_AMOUNT')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_net_final}</Text>
</View>
</View>
<View style={{ flexDirection: 'row', marginTop: 10 }}>
<View style={{ flex: 1 }}>
<Text tyle={[Typography.body2]}>{I18n.t('ACTIVE_WALLET')}</Text>
</View>
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.reseau_payeur}</Text>
</View>
</View>
</View>
</View>
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
this.setState({
displayModalHistory: !this.state.displayModalHistory,
});
}} />
</Dialog.Container>
);
}
renderHistoryTransactionItem = (item, index, wallet) => {
return (
<TouchableOpacity onPress={() => { this.setState({ displayModalHistory: true, historyItemDetail: item }) }} style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
{
Object.keys(item).map((element, i) => (
Object.keys(omit(item, ['id', 'id_transaction', 'type', 'frais', 'init_country', 'final_country', 'source', 'emetteur', 'montant_net_final', 'montant_net_init', 'reseau_payeur', 'operation'])).map((element, i) => (
<View style={{ alignItems: 'center' }} key={i}>
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
{isEqual(element, 'date')
? this.getCreationDateToHumanFormat(item[element])
:
item[element]
{
isEqual(element, 'montant') ?
`${thousands(item[element], ' ')}`
: isEqual(element, 'destinataire') ?
item[element].length > 13 ? cutString(item[element], 13) : item[element]
: isEqual(element, 'date') ?
cutStringWithoutDot(item[element], 16)
: item[element]
}
</Text>
</View>
))
}
</View>
</TouchableOpacity>
);
/* <View
@ -665,38 +795,62 @@ class WalletDetailUser extends Component {
}
renderHistoryTransactionList = () => {
return (
<>
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
<Text
style={[Typography.title3, Typography.semibold]}>
{I18n.t('TRANSACTION_HISTORY')}
</Text>
</View>
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
{
transactionHistoryLabel().map((item, index) => (
<View style={{ alignItems: 'center' }} key={index}>
<Icon name={item.icon} size={24} color={Color.primaryColor} />
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
{item.label}
</Text>
renderHistoryTransactionList = (wallet) => {
const { resultTransaction, errorTransaction } = this.props;
if (errorTransaction !== null) {
if (typeof errorTransaction.data !== 'undefined') {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text style={Typography.body1}>{errorTransaction.data.error}</Text>
</View>
)
}
else {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text style={Typography.body1}>{errorTransaction}</Text>
</View>
)
}
}
if (resultTransaction !== null) {
if (resultTransaction.response !== null) {
return (
Array.isArray(resultTransaction.response) && (resultTransaction.response.length) > 0 ?
(
<>
<View style={[styles.contentService, { borderBottomColor: Color.primaryColor }]}>
{
transactionHistoryIlinkLabel().map((item, index) => (
<View style={{ alignItems: 'center' }} key={index}>
<Icon name={item.icon} size={24} color={Color.primaryColor} />
<Text style={[Typography.overline, Color.grayColor], { marginTop: 4 }}>
{item.label}
</Text>
</View>
))
}
</View>
{
resultTransaction.response.map((item, index) => (
this.renderHistoryTransactionItem(item, index, wallet)
))
}
</>
) :
(
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'flex-start' }}>
<Text style={Typography.body1}>{I18n.t('NO_WALLET_HISTORY')}</Text>
</View>
))
}
</View>
{
transactionHistoryUser().map((item, index) => (
this.renderHistoryTransactionItem(item, index)
))
}
</>
)
)
)
}
}
}
renderHistoryTransaction = () => {
renderHistoryTransaction = (wallet) => {
return (
<>
@ -719,16 +873,28 @@ class WalletDetailUser extends Component {
</>
}
</View>
) : this.renderHistoryTransactionList()
) :
<>
<View style={[styles.checkDefault, { borderBottomColor: Color.borderColor }]}>
<Text
style={[Typography.title3, Typography.semibold]}>
{I18n.t('TRANSACTION_HISTORY')}
</Text>
</View>
{this.renderHistoryTransactionList(wallet)}
</>
}
</>
)
}
render() {
return (
<>
{this.state.displayModalHistory && this.renderModalHistoryDetail()}
<StatusBar
backgroundColor={Color.primaryDarkColor}
barStyle="light-content"
@ -776,7 +942,7 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => bindActionCreators({
getWalletDetailActivated,
getWalletTransactionHistory,
getWalletTransactionHistoryUser,
transferCommissionAction,
resetWalletListDetailReducer,
resetCommissionReducer,

View File

@ -7,11 +7,11 @@ export const isDebugMode = false
//export const baseUrl = "http://test.ilink-app.com:8080/mobilebackendtest";
//const baseUrl = "https://ilink-app.com/mobilebackendtest2"
export const baseUrl = "http://test.ilink-app.com:8080/mobilebackend";
export const testBaseUrl = "https://test.ilink-app.com";
/* export const baseUrl = "http://test.ilink-app.com:8080/mobilebackend";
export const testBaseUrl = "https://test.ilink-app.com"; */
/* export const baseUrl = "https://preprod.ilink-app.com:8080/mobilebackend";
export const testBaseUrl = "https://preprod.ilink-app.com"; */
export const baseUrl = "https://preprod.ilink-app.com:8080/mobilebackend";
export const testBaseUrl = "https://preprod.ilink-app.com";
//base url agent test
//const baseUrl = "https://ilink-app.com/mobilebackendtest";
@ -33,7 +33,7 @@ export const creditCancelDemand = testBaseUrl + '/walletService/credits/cancelDe
export const commissionAmount = testBaseUrl + '/walletService/transactions/commission';
export const transactionUrl = testBaseUrl + '/walletService/transactions';
export const transactionIlinkUrl = testBaseUrl + '/walletService/transactions/ilink/agent';
export const transactionIlinkUrl = testBaseUrl + '/walletService/transactions/ilink';
export const transferCommission = testBaseUrl + '/walletService/virement';
export const createIdentificationUrl = testBaseUrl + '/walletService/identifications';

View File

@ -10,11 +10,43 @@ export const getWalletTransactionHistory = (walletID, isiLinkWorldWallet) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchWalletHistoryPending());
axios({
url: isiLinkWorldWallet ? `${transactionIlinkUrl}/${walletID}` : `${transactionUrl}/${walletID}`,
url: isiLinkWorldWallet ? `${transactionIlinkUrl}/agent/${walletID}` : `${transactionUrl}/${walletID}`,
method: 'GET',
headers: {
'Authorization': authKey,
'X-Localization': I18n.currentLocale()
}
})
.then(response => {
console.log(response);
dispatch(fetchWalletHistorySuccess(response));
})
.catch(error => {
if (error.response)
dispatch(fetchWalletHistoryError(error.response));
else if (error.request)
dispatch(fetchWalletHistoryError(error.request))
else
dispatch(fetchWalletHistoryError(error.message))
});
}
}
export const getWalletTransactionHistoryUser = (walletID) => {
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
return dispatch => {
dispatch(fetchWalletHistoryPending());
axios({
url: `${transactionIlinkUrl}/user/${walletID}`,
method: 'GET',
headers: {
'Authorization': authKey,