retrait de carte vers cash redirection vers la webView
This commit is contained in:
parent
d004571ee7
commit
9d3609a4a2
|
@ -120,27 +120,71 @@ class RetraitCarteVersCashUser extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
if (resultEnvoieWalletToCard !== null) {
|
||||
if (resultEnvoieWalletToCard.response !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("WITHDRAWAL_SUCCESS"),
|
||||
resultEnvoieWalletToCard.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.envoieUserWalletToCardReset();
|
||||
IlinkEmitter.emit("refreshWallet");
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
// if (resultEnvoieWalletToCard !== null) {
|
||||
// if (resultEnvoieWalletToCard.response !== null) {
|
||||
// Alert.alert(
|
||||
// I18n.t("WITHDRAWAL_SUCCESS"),
|
||||
// resultEnvoieWalletToCard.response,
|
||||
// [
|
||||
// {
|
||||
// text: I18n.t("OK"), onPress: () => {
|
||||
// this.props.envoieUserWalletToCardReset();
|
||||
// IlinkEmitter.emit("refreshWallet");
|
||||
// this.props.navigation.pop();
|
||||
// }
|
||||
// }
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
// ],
|
||||
// { cancelable: false }
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
if (resultEnvoieWalletToCard !== null) {
|
||||
if (resultEnvoieWalletToCard.status === 301) {
|
||||
this.props.envoieUserWalletToCardReset();
|
||||
try{
|
||||
this.props.navigation.push('webviewScreen', {
|
||||
url: resultEnvoieWalletToCard.response.payment_url,
|
||||
requestBody: this.getRequestBody()
|
||||
|
||||
});
|
||||
} catch(error) {
|
||||
console.log('error', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (resultEnvoieWalletToCard.status === 200) {
|
||||
if (resultEnvoieWalletToCard.response !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("WITHDRAWAL_SUCCESS"),
|
||||
resultEnvoieWalletToCard.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.envoieUserWalletToCardReset();
|
||||
IlinkEmitter.emit("refreshWallet");
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getRequestBody () {
|
||||
return {
|
||||
type: 11,
|
||||
cvv: this.state.codeCVV,
|
||||
id_wallet_user: this.state.wallet.id,
|
||||
montant: this.state.montant,
|
||||
password: this.state.password
|
||||
}
|
||||
}
|
||||
|
||||
renderDialogGetCommissionResponse = () => {
|
||||
|
||||
const { errorEnvoieWalletToCardGetCommission } = this.props;
|
||||
|
@ -222,13 +266,7 @@ class RetraitCarteVersCashUser extends Component {
|
|||
isModalConfirmVisible: false,
|
||||
isDataSubmit: true
|
||||
});
|
||||
this.props.envoieUserWalletToCardAction({
|
||||
type: 11,
|
||||
cvv: this.state.codeCVV,
|
||||
id_wallet_user: this.state.wallet.id,
|
||||
montant: this.state.montant,
|
||||
password: this.state.password
|
||||
});
|
||||
this.props.envoieUserWalletToCardAction(this.getRequestBody());
|
||||
this.props.getCommissionUserWalletToCardReset();
|
||||
}} />
|
||||
|
||||
|
|
|
@ -115,7 +115,6 @@ class RetraitCarteVersWalletUser extends Component {
|
|||
|
||||
if (errorEnvoieWalletToCard !== null) {
|
||||
if (typeof errorEnvoieWalletToCard.data !== 'undefined') {
|
||||
console.warn("errorEnvoieWalletToCard.data: ", errorEnvoieWalletToCard.data)
|
||||
Alert.alert(
|
||||
I18n.t("WITHDRAWAL_ERROR"),
|
||||
errorEnvoieWalletToCard.data.error,
|
||||
|
|
Loading…
Reference in New Issue