diff --git a/App.js b/App.js index d44e21b7..f3642433 100644 --- a/App.js +++ b/App.js @@ -55,6 +55,7 @@ import CreateIdentificationUser from './screens/identification/CreateIdentificat import OperateurOptionSelect from './screens/wallet/OperateurOptionSelect'; import PaiementFacture from './screens/wallet/PaiementFacture'; import EnvoieWalletToWalletUser from './screens/wallet/user/EnvoieWalletToWalletUser'; +import EnvoieWalletToCashUser from './screens/wallet/user/EnvoieWalletToCash'; const instructions = Platform.select({ ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu', @@ -98,7 +99,8 @@ const AppStack = createDrawerNavigator({ operateurOptionSelect: OperateurOptionSelect, operateurOptionSelect: OperateurOptionSelect, paiementFacture: PaiementFacture, - envoieWalletToWalletUser: EnvoieWalletToWalletUser + envoieWalletToWalletUser: EnvoieWalletToWalletUser, + envoieWalletToCashUser: EnvoieWalletToCashUser }) }, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } }) diff --git a/redux/actions/EnvoieUserType.js b/redux/actions/EnvoieUserType.js index e69de29b..910449cc 100644 --- a/redux/actions/EnvoieUserType.js +++ b/redux/actions/EnvoieUserType.js @@ -0,0 +1,19 @@ +import { ENVOIE_WALLET_TO_WALLET_USER_PENDING, ENVOIE_WALLET_TO_WALLET_USER_SUCCESS, ENVOIE_WALLET_TO_WALLET_USER_ERROR, ENVOIE_WALLET_TO_WALLET_USER_RESET } from "../types/EnvoieUserType"; + +export const fetchEnvoieUserWalletToWalletPending = () => ({ + type: ENVOIE_WALLET_TO_WALLET_USER_PENDING +}); + +export const fetchEnvoieUserWalletToWalletSuccess = (res) => ({ + type: ENVOIE_WALLET_TO_WALLET_USER_SUCCESS, + result: res, +}); + +export const fetchEnvoieUserWalletToWalletError = (error) => ({ + type: ENVOIE_WALLET_TO_WALLET_USER_ERROR, + result: error +}); + +export const fetchEnvoieUserWalletToWalletReset = (error) => ({ + type: ENVOIE_WALLET_TO_WALLET_USER_RESET +}); \ No newline at end of file diff --git a/redux/reducers/EnvoieUserWalletToWalletReducer.js b/redux/reducers/EnvoieUserWalletToWalletReducer.js new file mode 100644 index 00000000..1e7c12f1 --- /dev/null +++ b/redux/reducers/EnvoieUserWalletToWalletReducer.js @@ -0,0 +1,33 @@ +import { ENVOIE_WALLET_TO_WALLET_USER_PENDING, ENVOIE_WALLET_TO_WALLET_USER_SUCCESS, ENVOIE_WALLET_TO_WALLET_USER_ERROR, ENVOIE_WALLET_TO_WALLET_USER_RESET } from "../types/EnvoieUserType"; + +const initialState = { + loading: false, + result: null, + error: null +}; + +export default (state = initialState, action) => { + switch (action.type) { + case ENVOIE_WALLET_TO_WALLET_USER_PENDING: return { + ...state, + loading: true + } + case ENVOIE_WALLET_TO_WALLET_USER_SUCCESS: return { + ...state, + loading: false, + result: action.result.data, + error: null + } + case ENVOIE_WALLET_TO_WALLET_USER_ERROR: return { + ...state, + loading: false, + result: null, + error: action.result + } + case ENVOIE_WALLET_TO_WALLET_USER_RESET: return initialState; + + default: { + return state; + } + } +}; diff --git a/redux/reducers/index.js b/redux/reducers/index.js index c8f823c9..932ab181 100644 --- a/redux/reducers/index.js +++ b/redux/reducers/index.js @@ -16,6 +16,7 @@ import walletReducer from "./WalletReducer"; import walletHistoryReducer from "./WalletTransactionHistoryReducer"; import walletTransferCommissionReducer from "./WalletTransferCommission"; import CountryByDialCodeReducer from "./CountryByDialCodeReducer"; +import EnvoieUserWalletToWalletReducer from "./EnvoieUserWalletToWalletReducer"; const persistConfig = { key: 'root', @@ -40,7 +41,8 @@ const rootReducer = persistCombineReducers(persistConfig, { validateIdentificationReducer: ValidateIdentificationReducer, payCountryNetworkReducer: PayCountryNetworkReducer, activeCountryListReducer: ActiveCountryListReducer, - countryByDialCode: CountryByDialCodeReducer + countryByDialCode: CountryByDialCodeReducer, + envoieUserWalletToWalletReducer: EnvoieUserWalletToWalletReducer }); diff --git a/route.json b/route.json index 83b82ff5..db41cca7 100644 --- a/route.json +++ b/route.json @@ -38,5 +38,6 @@ "validateIdentification": "validateIdentification", "operateurOptionSelect": "operateurOptionSelect", "paiementFacture": "paiementFacture", - "envoieWalletToWalletUser": "envoieWalletToWalletUser" + "envoieWalletToWalletUser": "envoieWalletToWalletUser", + "envoieWalletToCashUser": "envoieWalletToCashUser" } diff --git a/screens/identification/createIdentification.js b/screens/identification/createIdentification.js index 12a29cf3..e213a0e5 100644 --- a/screens/identification/createIdentification.js +++ b/screens/identification/createIdentification.js @@ -525,6 +525,7 @@ class CreateIdentification extends Component { { diff --git a/screens/identification/validateIdentification.js b/screens/identification/validateIdentification.js index 78ada53c..4d428048 100644 --- a/screens/identification/validateIdentification.js +++ b/screens/identification/validateIdentification.js @@ -529,6 +529,7 @@ class ValidateIdentification extends Component { { diff --git a/screens/optionMenu/OptionsMenu.js b/screens/optionMenu/OptionsMenu.js index 24e9e57b..c2c2130a 100644 --- a/screens/optionMenu/OptionsMenu.js +++ b/screens/optionMenu/OptionsMenu.js @@ -253,7 +253,8 @@ export default class OptionsMenu extends Component { _renderItem = (item) => { if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks' || item === 'walletDetail' || item === 'walletDetailUser' || item === 'walletDepot' || item === 'walletRetrait' || item === 'createIdentification' || item === 'walletOptionSelect' || item === 'validateIdentification' - || item === 'createIdentificationUser' || item === 'operateurOptionSelect' || item === 'paiementFacture' || item === 'envoieWalletToWalletUser') { + || item === 'createIdentificationUser' || item === 'operateurOptionSelect' || item === 'paiementFacture' || item === 'envoieWalletToWalletUser' + || item === 'envoieWalletToCashUser') { return null } else { const color = this.state.currentId === item.id ? theme.accent : "grey" diff --git a/screens/wallet/WalletDetailUser.js b/screens/wallet/WalletDetailUser.js index 22065d6a..8d073605 100644 --- a/screens/wallet/WalletDetailUser.js +++ b/screens/wallet/WalletDetailUser.js @@ -86,7 +86,7 @@ class WalletDetailUser extends Component { if (user) { if (user !== undefined) { this.setState({ user }); - this.props.getUserIdentificationAction(user.id); + this.props.getUserIdentificationAction(user.phone); } } }); @@ -387,13 +387,18 @@ class WalletDetailUser extends Component { { - this.props.navigation.push(route.walletOptionSelect, { - optionSelect: optionDepotUserScreen, - lottie: { - source: require("./../../datas/json/wallet_with_cash.json"), - loop: false - } - }) + if (this.state.isIdentifiedValidated) { + this.props.navigation.push(route.walletOptionSelect, { + optionSelect: optionDepotUserScreen, + lottie: { + source: require("./../../datas/json/wallet_with_cash.json"), + loop: false + } + }) + } else if (this.state.isIdentified) + displayToast(I18n.t('NOT_IDENTIFIED')) + else + displayToast(I18n.t('NOT_VALIDATED')); }} activeOpacity={0.9}> { - this.props.navigation.push(route.walletOptionSelect, { - optionSelect: optionRetraitUserScreen, - lottie: { - source: require("./../../datas/json/wallet_with_cash.json"), - loop: true - } - }) + if (this.state.isIdentifiedValidated) { + this.props.navigation.push(route.walletOptionSelect, { + optionSelect: optionRetraitUserScreen, + lottie: { + source: require("./../../datas/json/wallet_with_cash.json"), + loop: true + } + }) + } else if (this.state.isIdentified) + displayToast(I18n.t('NOT_IDENTIFIED')) + else + displayToast(I18n.t('NOT_VALIDATED')); }} activeOpacity={0.9}> @@ -462,7 +472,14 @@ class WalletDetailUser extends Component { { }} + onPress={() => { + if (this.state.isIdentifiedValidated) { + + } else if (this.state.isIdentified) + displayToast(I18n.t('NOT_IDENTIFIED')) + else + displayToast(I18n.t('NOT_VALIDATED')); + }} activeOpacity={0.9}> { }} + onPress={() => { + if (this.state.isIdentifiedValidated) { + + } else if (this.state.isIdentified) + displayToast(I18n.t('NOT_IDENTIFIED')) + else + displayToast(I18n.t('NOT_VALIDATED')); + }} activeOpacity={0.9}> { - this.props.navigation.push(route.walletOptionSelect, { - optionSelect: optionPaiementFacture, - onGoBack: () => this.refresh(), - lottie: { - source: require("./../../datas/json/paiement_facture.json"), - loop: true - } - }) + + if (this.state.isIdentifiedValidated) { + this.props.navigation.push(route.walletOptionSelect, { + optionSelect: optionPaiementFacture, + onGoBack: () => this.refresh(), + lottie: { + source: require("./../../datas/json/paiement_facture.json"), + loop: true + } + }) + + } else if (this.state.isIdentified) + displayToast(I18n.t('NOT_IDENTIFIED')) + else + displayToast(I18n.t('NOT_VALIDATED')); }} activeOpacity={0.9}> { return { drawerLabel: () => null, - headerTitle: I18n.t('DEPOSIT_WALLET_TO_WALLET'), + headerTitle: I18n.t('DEPOSIT_TO_CASH'), headerTintColor: 'white', headerStyle: { backgroundColor: Color.primaryColor, @@ -46,7 +46,7 @@ class EnvoieWalletToCashUser extends Component { headerTitleStyle: { color: "white" }, - title: I18n.t('DEPOSIT_WALLET_TO_WALLET') + title: I18n.t('DEPOSIT_TO_CASH') } }; diff --git a/screens/wallet/user/EnvoieWalletToWalletUser.js b/screens/wallet/user/EnvoieWalletToWalletUser.js index e8ecefa8..4f2f7c14 100644 --- a/screens/wallet/user/EnvoieWalletToWalletUser.js +++ b/screens/wallet/user/EnvoieWalletToWalletUser.js @@ -2,10 +2,10 @@ import Button from 'apsl-react-native-button'; import isEqual from 'lodash/isEqual'; import isNil from 'lodash/isNil'; import React, { Component } from 'react'; -import { Keyboard, PermissionsAndroid, ProgressBarAndroid, ScrollView, StyleSheet, Text, View, Platform, Alert } from 'react-native'; +import { Alert, PermissionsAndroid, Platform, ScrollView, StyleSheet, Text } from 'react-native'; import * as Animatable from 'react-native-animatable'; +import Geolocation from 'react-native-geolocation-service'; import I18n from 'react-native-i18n'; -import { MaterialDialog } from "react-native-material-dialog"; import { Dropdown } from 'react-native-material-dropdown'; import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions'; import { ProgressDialog } from 'react-native-simple-dialogs'; @@ -13,12 +13,13 @@ import { Fumi } from 'react-native-textinput-effects'; import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import Geolocation from 'react-native-geolocation-service'; -import { identityPieces, paysDestinationData, walletActifData, typeIdIDestinataire, isIlinkWorldWallet } from '../../../utils/UtilsFunction'; import { Color } from '../../../config/Color'; +import { identityPieces, isIlinkWorldWallet, typeIdIDestinataire, isNormalInteger } from '../../../utils/UtilsFunction'; +import { readUser } from '../../../webservice/AuthApi'; import { getActiveCountryAction, getActiveCountryByDialCodeAction, getActiveCountryByDialCodeReset, getActiveCountryReset, getPayCountryNetworkAction, getPayCountryNetworkReset } from '../../../webservice/CountryApi'; -import { readUser, getTownInformationName, getListCountriesActive } from '../../../webservice/AuthApi'; +import { envoieUserWalletToWalletAction, envoieUserWalletToWalletReset } from '../../../webservice/EnvoieUserApi'; import { getPositionInformation } from '../../../webservice/MapService'; +import { store } from "../../../redux/store"; let theme = require('../../../utils/theme.json'); let route = require('../../../route.json'); const GEOLOCATION_OPTIONS = { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000, useSignificantChanges: true }; @@ -71,12 +72,14 @@ class EnvoieWalletToWalletUser extends Component { modalVisible: true, hasLoadActiveCountryList: true, hasLoadActivePayCountryNetworkList: true, - triggerSubmitClick: false + triggerSubmitClick: false, + wallet: store.getState().walletDetailReducer.result.response }; this.props.getActiveCountryReset(); this.props.getActiveCountryByDialCodeReset(); this.props.getPayCountryNetworkReset(); + this.props.envoieUserWalletToWalletReset(); } @@ -200,6 +203,47 @@ class EnvoieWalletToWalletUser extends Component { } } + renderEnvoieWalletToWalletResponse = () => { + + const { resultEnvoieWalletToWallet, errorEnvoieWalletToWallet } = this.props; + + if (errorEnvoieWalletToWallet !== null) { + if (typeof errorEnvoieWalletToWallet.data !== 'undefined') { + Alert.alert( + I18n.t("ERROR_TRANSFER"), + errorEnvoieWalletToWallet.data.error, + [ + { + text: I18n.t("OK"), onPress: () => { + this.props.envoieUserWalletToWalletReset(); + } + } + ], + { cancelable: false } + ) + } + } + + if (resultEnvoieWalletToWallet !== null) { + if (resultEnvoieWalletToWallet.response !== null) { + Alert.alert( + I18n.t("SUCCESS_TRANSFER"), + I18n.t("WALLET_TO_WALLET_SUCCESS_TRANSFER"), + [ + { + text: I18n.t("OK"), onPress: () => { + this.props.envoieUserWalletToWalletReset(); + this.props.navigation.pop(); + } + } + + ], + { cancelable: false } + ) + } + } + } + showErrorDialog() { Alert.alert("Une erreur est survenue", "Impossible de récuperer des informations du pays verifier que votre gps est activé," + "et que vous êtes connecté à internet puis ressayer", [{ @@ -339,7 +383,7 @@ class EnvoieWalletToWalletUser extends Component { isValid: false }; - else if (!this.isNormalInteger(montant)) + else if (!isNormalInteger(montant)) return { errorMessage: I18n.t('ENTER_VALID_AMOUNT'), isValid: false @@ -374,12 +418,27 @@ class EnvoieWalletToWalletUser extends Component { this.numeroIdentiteAnim.shake(800); else if (this.ckeckIfFieldIsOK(numeroTelephoneOrWalletCode)) this.numeroTelephoneAnim.shake(800); - else if (this.ckeckIfFieldIsOK(montant) || this.isMontantValid().isValid) + else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid) { + console.log("IS MONTANT VALID", this.isMontantValid()) this.montantAnim.shake(800); + } else if (this.ckeckIfFieldIsOK(password)) this.passwordAnim.shake(800); else { - this + + this.props.envoieUserWalletToWalletAction({ + type: 1, + id_wallet_user: this.state.wallet.id, + id_network: this.state.wallet.idNetwork, + init_country: (this.state.paysDestination.filter(element => element.code_country === this.state.shortCountry))[0].id, + final_country: (this.state.paysDestination.filter(element => element.name === this.state.paysDestinationSelect))[0].id, + id_destinataire: this.state.numeroTelephoneOrWalletCode, + type_document_destinataire: this.state.identityPiecesName, + id_document_destinataire: this.state.numeroIdentite, + network_destinataire: (this.state.walletActifs.filter(element => element.name === this.state.walletActifSelect))[0].id, + montant: this.state.montant, + password: this.state.password + }); } this.setState({ triggerSubmitClick: true @@ -390,7 +449,7 @@ class EnvoieWalletToWalletUser extends Component { renderLoader = () => { return ( @@ -401,11 +460,10 @@ class EnvoieWalletToWalletUser extends Component { console.log("STATE", this.state); return ( <> - {(this.state.modalVisible || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()} + {(this.state.modalVisible || this.props.loadingEnvoieWalletToWallet || this.props.loadingCountryByDialCode || this.props.loadingActiveCountryList || this.props.loadingCountryByDialCode) && this.renderLoader()} {this.state.hasLoadActiveCountryList && this.renderGetActionCountryList()} {this.state.hasLoadActivePayCountryNetworkList && this.renderGetPayCountryNetworkResponse()} {this.state.triggerSubmitClick && this.renderEnvoieWalletToWalletResponse()} - {this.state.triggerNextClick && this.renderGetNumberResponse()} */} {I18n.t('ENVOIE_WALLET_TO_WALLET')} @@ -529,6 +587,7 @@ class EnvoieWalletToWalletUser extends Component { { @@ -543,6 +602,7 @@ class EnvoieWalletToWalletUser extends Component { { @@ -558,6 +618,7 @@ class EnvoieWalletToWalletUser extends Component { label={I18n.t('PASSWORD')} iconColor={'#f95a25'} iconSize={20} + secureTextEntry={true} value={this.state.password} onChangeText={(password) => { this.setState({ password }) @@ -590,6 +651,10 @@ const maptStateToProps = state => ({ loadingPayCountryNetwork: state.payCountryNetworkReducer.loading, resultPayCountryNetwork: state.payCountryNetworkReducer.result, errorPayCountryNetwork: state.payCountryNetworkReducer.error, + + loadingEnvoieWalletToWallet: state.envoieUserWalletToWalletReducer.loading, + resultEnvoieWalletToWallet: state.envoieUserWalletToWalletReducer.result, + errorEnvoieWalletToWallet: state.envoieUserWalletToWalletReducer.error, }); const mapDispatchToProps = dispatch => bindActionCreators({ @@ -600,7 +665,10 @@ const mapDispatchToProps = dispatch => bindActionCreators({ getPayCountryNetworkReset, getActiveCountryAction, - getActiveCountryReset + getActiveCountryReset, + + envoieUserWalletToWalletAction, + envoieUserWalletToWalletReset }, dispatch); diff --git a/utils/UtilsFunction.js b/utils/UtilsFunction.js index 13e13e1d..42cf08bc 100644 --- a/utils/UtilsFunction.js +++ b/utils/UtilsFunction.js @@ -256,7 +256,7 @@ export const optionDepotUserScreen = { title: I18n.t('DEPOSIT_WALLET_TO_WALLET'), }, { - screen: route.walletDepot, + screen: route.envoieWalletToCashUser, icon: 'cash-refund', title: I18n.t('DEPOSIT_TO_CASH'), }, diff --git a/utils/i18n/en.json b/utils/i18n/en.json index 797049ca..7d25106f 100644 --- a/utils/i18n/en.json +++ b/utils/i18n/en.json @@ -41,6 +41,9 @@ "MAKE_DEPOSIT": "Make a deposit", "MAKE_WITHDRAWAL": "Make withdrawal", "DEPOSIT_DESCRIPTION": "Make a deposit", + "ERROR_TRANSFER": "Transfer error", + "SUCCESS_TRANSFER": "Transfer done", + "WALLET_TO_WALLET_SUCCESS_TRANSFER": "Wallet to wallet transfer successfully completed", "DEPOSIT": "Deposit", "CONFIRM_DEPOSIT": "Confirm deposit", "CONFIRM_WITHDRAWAL": "Confirm withdrawal", @@ -308,6 +311,7 @@ "ACCOUNT_INFO": "My Account Information", "ALREADY_IDENTIFIED": "You are already identified", "NOT_IDENTIFIED": "This number exists, its identification is not yet entered", + "NOT_VALIDATED": "Your identicaiton is not yet validated", "ALREADY_VALIDATED": "The identification of this client has already been validated", "IDENTIFICATION": " Identification", "CREATION_IDENTIFICATION": "Creation", diff --git a/utils/i18n/fr.json b/utils/i18n/fr.json index e6a5d2de..63e78d7c 100644 --- a/utils/i18n/fr.json +++ b/utils/i18n/fr.json @@ -67,6 +67,9 @@ "CHOOSE_OPTION": "Veuillez sélectionner une option", "CHOOSE_OPERATOR": "Veuillez sélectionner un opérateur", "DEPOSIT_DESCRIPTION": "Effectuer un dépôt", + "ERROR_TRANSFER": "Erreur de transfert", + "SUCCESS_TRANSFER": "Transfert effectué", + "WALLET_TO_WALLET_SUCCESS_TRANSFER": "Transfert de wallet à wallet effectué avec succès", "WITHDRAWAL": "Retrait", "WITHDRAWAL_IN_CASH": "Retrait en cash", "WITHDRAWAL_WALLET_TO_CASH": "Retrait wallet vers cash", @@ -311,6 +314,7 @@ "ACCOUNT_INFO": " Information sur mon compte", "ALREADY_IDENTIFIED": "Vous êtes déjà identifié", "NOT_IDENTIFIED": "Ce numéro existe, son identification n'est pas encore saisi", + "NOT_VALIDATED": "Votre identicaiton n'est pas encore validé", "ALREADY_VALIDATED": "L'identification de ce client a déjà été validée", "IDENTIFICATION": " Identification", "CREATION_IDENTIFICATION": "Création", diff --git a/webservice/EnvoieUserApi.js b/webservice/EnvoieUserApi.js new file mode 100644 index 00000000..058cbf4c --- /dev/null +++ b/webservice/EnvoieUserApi.js @@ -0,0 +1,44 @@ + +import axios from "axios"; +import I18n from 'react-native-i18n'; +import { store } from "../redux/store"; +import { envoieUserWalletToWallet } from "./IlinkConstants"; +import { fetchEnvoieUserWalletToWalletPending, fetchEnvoieUserWalletToWalletSuccess, fetchEnvoieUserWalletToWalletError, fetchEnvoieUserWalletToWalletReset } from "../redux/actions/EnvoieUserType"; + +export const envoieUserWalletToWalletAction = (data) => { + + const auth = store.getState().authKeyReducer; + const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : ''; + + return dispatch => { + dispatch(fetchEnvoieUserWalletToWalletPending()); + + axios({ + url: `${envoieUserWalletToWallet}`, + method: 'GET', + data, + headers: { + 'Authorization': authKey, + 'X-Localization': I18n.currentLocale() + } + }) + .then(response => { + console.log(response); + dispatch(fetchEnvoieUserWalletToWalletSuccess(response)); + }) + .catch(error => { + if (error.response) + dispatch(fetchEnvoieUserWalletToWalletError(error.response)); + else if (error.request) + dispatch(fetchEnvoieUserWalletToWalletError(error.request)) + else + dispatch(fetchEnvoieUserWalletToWalletError(error.message)) + }); + } +} + +export const envoieUserWalletToWalletReset = () => { + return dispatch => { + dispatch(fetchEnvoieUserWalletToWalletReset()); + } +} \ No newline at end of file diff --git a/webservice/IlinkConstants.js b/webservice/IlinkConstants.js index 1fa89779..b09a1c16 100644 --- a/webservice/IlinkConstants.js +++ b/webservice/IlinkConstants.js @@ -44,6 +44,8 @@ export const getUserIdentifiedInformationUrl = testBaseUrl + '/walletService/ide export const activeCountryUrl = testBaseUrl + '/walletService/countries'; export const payCountryNetworkUrl = testBaseUrl + '/walletService/paying_networks'; +export const envoieUserWalletToWallet = testBaseUrl + '/walletService/transactions/ilink'; + export const authKeyUrl = testBaseUrl + '/oauth/token'; export const videoUrl = "https://www.youtube.com/watch?v=wwGPDPsSLWY"; export const MARKER_URL = baseUrl + "/interacted/LocationAction.php";