From 5f6e41b3aee4d14ab6d2dff5e82a3a1ff8f825eb Mon Sep 17 00:00:00 2001 From: Brice Zele Date: Wed, 4 May 2022 03:26:39 +0100 Subject: [PATCH] =?UTF-8?q?Int=C3=A9gration=20des=20moyens=20de=20paiement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- redux/insurance/insurance.reducer.js | 31 --- redux/types/WalletType.js | 17 -- .../agent/HistoriqueNanoSanteAgentScreen.js | 182 +++++++++++++++++- .../user/ActivateBuySubscriptionScreen.js | 172 ++++++++++++++++- screens/wallet/user/AddBeneficiaryScreen.js | 8 +- .../wallet/user/DeleteBeneficiaryScreen.js | 30 ++- .../user/InsuranceSubscriptionScreen.js | 9 +- screens/wallet/user/RenewAssuranceScreen.js | 7 +- screens/wallet/user/StopSubscriptionScreen.js | 30 ++- utils/i18n/fr.json | 11 +- webservice/IlinkConstants.js | 15 +- 11 files changed, 398 insertions(+), 114 deletions(-) diff --git a/redux/insurance/insurance.reducer.js b/redux/insurance/insurance.reducer.js index dbfccb18..6ba4e8c0 100644 --- a/redux/insurance/insurance.reducer.js +++ b/redux/insurance/insurance.reducer.js @@ -799,34 +799,3 @@ export const getExclusionReducer = (state = INITIAL_STATE, action: InsuranceActi } }; - -export const getExclusionReducer = (state = INITIAL_STATE, action: InsuranceActions) => { - console.log("ACTION", action); - switch (action.type) { - case InsuranceActions.GET_EXCLUSION_PENDING: - return { - ...state, - loading: true - } - case InsuranceActions.GET_EXCLUSION_SUCCESS: - return { - loading: false, - result: action.payload.response, - error: null - } - case InsuranceActions.GET_EXCLUSION_ERROR: - return { - ...state, - loading: false, - result: null, - error: action.payload - } - - case InsuranceActions.GET_EXCLUSION_RESET: - return INITIAL_STATE; - - default: - return state - - } -}; diff --git a/redux/types/WalletType.js b/redux/types/WalletType.js index 8c524c2e..8632e3c3 100755 --- a/redux/types/WalletType.js +++ b/redux/types/WalletType.js @@ -59,23 +59,6 @@ export const PAY_BILL_ERROR = 'PAY_BILL_ERROR'; export const PAY_BILL_RESET = 'PAY_BILL_RESET'; -export const SEARCH_USER_PENDING = 'SEARCH_USER_PENDING'; -export const SEARCH_USER_SUCCESS = 'SEARCH_USER_SUCCESS'; -export const SEARCH_USER_ERROR = 'SEARCH_USER_ERROR'; -export const SEARCH_USER_RESET = 'SEARCH_USER_RESET'; - -export const GET_QR_CODE_DETAIL_PENDING = 'GET_QR_CODE_DETAIL_PENDING'; -export const GET_QR_CODE_DETAIL_SUCCESS = 'GET_QR_CODE_DETAIL_SUCCESS'; -export const GET_QR_CODE_DETAIL_ERROR = 'GET_QR_CODE_DETAIL_ERROR'; -export const GET_QR_CODE_DETAIL_RESET = 'GET_QR_CODE_DETAIL_RESET'; - -export const PASSWORD_VALIDATION_PENDING = 'PASSWORD_VALIDATION_PENDING'; -export const PASSWORD_VALIDATION_SUCCESS = 'PASSWORD_VALIDATION_SUCCESS'; -export const PASSWORD_VALIDATION_ERROR = 'PASSWORD_VALIDATION_ERROR'; -export const PASSWORD_VALIDATION_RESET = 'PASSWORD_VALIDATION_RESET'; - - - export const SEARCH_USER_PENDING = 'SEARCH_USER_PENDING'; export const SEARCH_USER_SUCCESS = 'SEARCH_USER_SUCCESS'; export const SEARCH_USER_ERROR = 'SEARCH_USER_ERROR'; diff --git a/screens/wallet/agent/HistoriqueNanoSanteAgentScreen.js b/screens/wallet/agent/HistoriqueNanoSanteAgentScreen.js index b1646d37..385ebaab 100644 --- a/screens/wallet/agent/HistoriqueNanoSanteAgentScreen.js +++ b/screens/wallet/agent/HistoriqueNanoSanteAgentScreen.js @@ -367,7 +367,133 @@ const HistoriqueNanoSanteAgentScreen = ({ - : + : + 'health_care_sheet_id' in historyItemDetail ? + + + + + + ID + + + {historyItemDetail.id} + + + + + + {I18n.t('NETWORK')} + + + {historyItemDetail.network.name} + + + + + + {I18n.t('ACTE')} + + + {historyItemDetail.act_name} + + + + + {I18n.t('STATUS')} + + + {historyItemDetail.state.toLowerCase()} + + + + + {I18n.t('BENEFICIARY')} + + + {`${historyItemDetail.user_firstname !== null ? historyItemDetail.user_firstname : ''} ${historyItemDetail.user_lastname !== null ? historyItemDetail.user_lastname : ''}`} + + + + + + + {I18n.t('EMAIL')} + + + {historyItemDetail.user_email} + + + + + + {I18n.t('PHONE')} + + + {historyItemDetail.user_phone} + + + + + + + {I18n.t('EMETTEUR')} + + + {`${historyItemDetail.issuer_agent_lastname !== null ? historyItemDetail.issuer_agent_lastname : ''} ${historyItemDetail.issuer_agent_firstname !== null ? historyItemDetail.issuer_agent_firstname : ''}`} + + + + + + {I18n.t('PHONE_EMETTEUR')} + + + {historyItemDetail.issuer_agent_phone} + + + + + {I18n.t('AGENT_VALIDEUR')} + + + {`${historyItemDetail.validating_agent_lastname !== null ? historyItemDetail.validating_agent_lasstname : ''} ${historyItemDetail.validating_agent_firstname !== null ? historyItemDetail.validating_agent_firstname : ''}`} + + + + + {I18n.t('AGENT_VALIDEUR_EMAIL')} + + + {historyItemDetail.validating_agent_email} + + + + + {I18n.t('AGENT_VALIDEUR_PHONE')} + + + {historyItemDetail.validating_agent_phone} + + + + + + + : + @@ -526,6 +652,47 @@ const HistoriqueNanoSanteAgentScreen = ({ + : 'health_care_sheet_id' in item ? + { + setDisplayModalHistory(true); + setHistoryItemDetail(item); + /*navigation.navigate('validateConsultationDetailScreen', { + item + });*/ + }}> + + + {`${I18n.t('ACTE')}: ${item.act_name}`} + + {`${I18n.t('EMETTEUR')}: ${item.issuer_agent_lastname}`} + + + + {`${I18n.t('NETWORK')}: ${item.network.name}`} + + {`${I18n.t('BENEFICIARY')}: ${item.user_firstname !== null ? item.user_firstname : ''} ${item.user_lastname !== null ? item.user_lastname : ''}`} + + + + + + + + + {`${I18n.t('STATUS')}: ${item.state}`} + + + + + + {`Date: ${moment(item.created_at).format('YYYY-MM-DD')}`} + + + + : {` ${I18n.t('SOINS')}`} + } + style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0, borderTopRightRadius: 0, borderBottomRightRadius: 0,}} + primary + onPress={() => { + dispatch(fetchGetConsultationReset()); + setPage(1); + setLoadMore(false); + setHistoryResult([]); + setHistoriqueDetailLabel(I18n.t('AUTORISATION_SOIN')); + fetchGetDemandeAutorisationSoin(`?network_id=${wallet.id_network}&network_agent_id=${wallet.network_agent_id}&page=1&perPage=20`); + }}> + {` ${I18n.t('AUTORISATION_SOIN')}`} + } style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}} primary diff --git a/screens/wallet/user/ActivateBuySubscriptionScreen.js b/screens/wallet/user/ActivateBuySubscriptionScreen.js index 1f5b58b7..c9e72700 100644 --- a/screens/wallet/user/ActivateBuySubscriptionScreen.js +++ b/screens/wallet/user/ActivateBuySubscriptionScreen.js @@ -6,7 +6,16 @@ * Date: 08/11/2021 */ import React, {useEffect, useState} from 'react'; -import {Alert, Dimensions, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, View,} from 'react-native'; +import { + Alert, + Dimensions, + KeyboardAvoidingView, + Platform, + ScrollView, + StyleSheet, + TouchableOpacity, + View, +} from 'react-native'; import {connect, useDispatch} from 'react-redux'; import {Formik} from 'formik'; import * as Yup from 'yup'; @@ -32,6 +41,9 @@ import {selectActivatePaySubscription, selectSubscriptionList} from "../../../re import {Dropdown} from "react-native-material-dropdown"; import {store} from "../../../redux/store"; +import Modal from "react-native-modal"; +import Text from "../../../components/Text"; +import Icon from "react-native-vector-icons/FontAwesome5"; let moment = require('moment-timezone'); @@ -172,6 +184,25 @@ const styles = StyleSheet.create({ paddingVertical: 10, borderBottomWidth: 0.5, }, + containPaymentMethod: { + flex: 1, + alignItems: 'center', + paddingHorizontal: 20, + paddingVertical: 15, + }, + methodItem: { + width: '100%', + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + paddingVertical: 15, + marginBottom: 5, + }, + iconContent: { + width: 30, + marginRight: 10, + alignItems: 'center', + }, }); const ActivateBuySubscriptionScreen = ({ @@ -186,6 +217,7 @@ const ActivateBuySubscriptionScreen = ({ const [password, setPassword] = useState(null); const [subscriptions, setSubscriptions] = useState([]); const [subscription, setSubscription] = useState(null); + const [modalPaymentModal, setModalPaymentModal] = useState(true); const dispatch = useDispatch(); let dropDownAlertRef: any = null; @@ -280,10 +312,140 @@ const ActivateBuySubscriptionScreen = ({ }, [activatePaySubscription]); const RegisterSchema = Yup.object().shape({ - password: wallet.password_validation === "MAX" ? Yup.string() + password: wallet.password_validation === "MAX" ? Yup.string() .required(I18n.t('THIS_FIELD_IS_REQUIRED')) : Yup.string() }); + const renderPaymentMethodModal = () => ( + + + { + setModalPaymentModal(false); + }} + swipeDirection={['down']} + style={styles.bottomModal}> + + + + + + {I18n.t('PAYMENT_METHOD')} + + + { + }}> + + + + + {I18n.t('PAYPAL')} + + + + { + + }}> + + + + + {I18n.t('CREDIT_CARD')} + + + + { + /* navigation.navigate('WebviewModalScreen', { + url: `${Config.YOOLEARN_CINET_PAY}`, + title: t('terms_of_services'), + }); */ + }}> + + + + + {I18n.t('MOBILE_MONEY')} + + + + + + + + + + + ) + return ( (dropDownAlertRef = ref)}/> @@ -302,7 +464,8 @@ const ActivateBuySubscriptionScreen = ({ subscriptionRef.shake(800); } else { console.log("subscription", subscription); - fetchActivePaySubscription(subscription.id, {password: values.password}); + setModalPaymentModal(true); + //fetchActivePaySubscription(subscription.id, {password: values.password}); } } }}> @@ -360,7 +523,7 @@ const ActivateBuySubscriptionScreen = ({ return value }} labelExtractor={(value) => { - return `${I18n.t('MNT')}: ${value.amount} | ${I18n.t('FACT')}: ${value.invoice_id.slice(0,7)} | ${I18n.t('ECH')}: ${value.deadline_number}` + return `${I18n.t('MNT')}: ${value.amount} | ${I18n.t('FACT')}: ${value.invoice_id.slice(0, 7)} | ${I18n.t('ECH')}: ${value.deadline_number}` }} /> @@ -391,6 +554,7 @@ const ActivateBuySubscriptionScreen = ({ )} + {modalPaymentModal && renderPaymentMethodModal()} diff --git a/screens/wallet/user/AddBeneficiaryScreen.js b/screens/wallet/user/AddBeneficiaryScreen.js index 954ecde4..8f7fc50d 100644 --- a/screens/wallet/user/AddBeneficiaryScreen.js +++ b/screens/wallet/user/AddBeneficiaryScreen.js @@ -440,8 +440,7 @@ const AddBeneficiaryScreen = ({ }, [uploadInsuranceImages]); const RegisterSchema = Yup.object().shape({ - password: wallet.password_validation === "MAX" ? Yup.string() - .required(I18n.t('THIS_FIELD_IS_REQUIRED')) : Yup.string() + password: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')) }); const AddBeneficiarySchema = Yup.object().shape({ @@ -983,8 +982,6 @@ const AddBeneficiaryScreen = ({ /> - { - wallet.password_validation === "MAX" && - } - - { @@ -485,21 +484,18 @@ const DeleteBeneficiaryScreen = ({ /> - { - wallet.password_validation === "MAX" && - } - value={values.password} - onBlur={handleBlur('password')} - success={touched.password && !errors.password} - touched={touched.password} - error={errors.password} - /> - } + } + value={values.password} + onBlur={handleBlur('password')} + success={touched.password && !errors.password} + touched={touched.password} + error={errors.password} + />