token 内部不判断 参数
This commit is contained in:
@@ -31,12 +31,13 @@ import {
|
||||
type TokenAutoRebindDeps,
|
||||
PhonePePersonalBindResult,
|
||||
PaytmPersonalBindResult,
|
||||
MobikwikPersonalBind,
|
||||
MobikwikPersonalBindResult,
|
||||
BindErrorCode,
|
||||
} from 'rnwalletman';
|
||||
|
||||
import {
|
||||
FreeChargeBind,
|
||||
MobikwikPersonalTokenBind,
|
||||
MobikwikPersonalOTPBind,
|
||||
PayTmPersonalOTPBind,
|
||||
PhonePePersonalOTPBind,
|
||||
@@ -380,7 +381,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
this.setState({ [key]: false, bindPrefillMobile: '' } as any);
|
||||
|
||||
if (showPaytmPersonalBind && paytmPersonalBindType === 'tokenMode') {
|
||||
const remoteVersion = '1';
|
||||
const remoteVersion = '2';
|
||||
return (
|
||||
<Modal
|
||||
visible
|
||||
@@ -399,6 +400,10 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
Alert.alert('Bind Failed', 'App version outdated. Reinstall required');
|
||||
return;
|
||||
}
|
||||
if (!result.token) {
|
||||
Alert.alert('Bind Failed', 'Please login in paytm app first');
|
||||
return;
|
||||
}
|
||||
|
||||
this.handleBindSuccess('showPaytmPersonalBind', WalletType.PAYTM_PERSONAL, 'Paytm Personal bound successfully')(result);
|
||||
}}
|
||||
@@ -638,15 +643,54 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
transparent
|
||||
onRequestClose={close('showMobikwikPersonalBind')}
|
||||
>
|
||||
<MobikwikPersonalTokenBind
|
||||
<MobikwikPersonalBind
|
||||
processString="Binding Mobikwik..."
|
||||
userToken={Api.instance.getUserToken()}
|
||||
isDebug
|
||||
onClose={close('showMobikwikPersonalBind')}
|
||||
onSuccess={this.handleBindSuccess(
|
||||
'showMobikwikPersonalBind',
|
||||
WalletType.MOBIKWIK_PERSONAL,
|
||||
'Mobikwik bound successfully',
|
||||
)}
|
||||
onSuccess={(result: MobikwikPersonalBindResult) => {
|
||||
if (!result.hashId) {
|
||||
Alert.alert('Bind Failed', 'Please login in Mobikwik app first');
|
||||
return;
|
||||
}
|
||||
if (!result.token) {
|
||||
Alert.alert('Bind Failed', 'Invalid hashId from Mobikwik');
|
||||
return;
|
||||
}
|
||||
this.handleBindSuccess(
|
||||
'showMobikwikPersonalBind',
|
||||
WalletType.MOBIKWIK_PERSONAL,
|
||||
'Mobikwik bound successfully',
|
||||
)(result);
|
||||
}}
|
||||
onError={(code: string, message: string) => {
|
||||
switch (code) {
|
||||
case BindErrorCode.NATIVE_MODULE_UNAVAILABLE:
|
||||
Alert.alert('Bind Failed', 'Native module not available');
|
||||
break;
|
||||
case BindErrorCode.NOT_INSTALLED:
|
||||
Alert.alert('Bind Failed', 'Patched Mobikwik app not installed. Install mobikwik_ipay_2365.apk');
|
||||
break;
|
||||
case BindErrorCode.NOT_LOGGED_IN:
|
||||
Alert.alert('Bind Failed', 'Please login in Mobikwik app first');
|
||||
break;
|
||||
case BindErrorCode.SERVICE_DISCONNECTED:
|
||||
Alert.alert('Bind Failed', 'Mobikwik service unavailable. Open the app and try again');
|
||||
break;
|
||||
case BindErrorCode.NO_DATA:
|
||||
Alert.alert('Bind Failed', 'No login data received');
|
||||
break;
|
||||
case BindErrorCode.BIND_ERROR:
|
||||
Alert.alert('Bind Failed', 'Bind failed. Open Mobikwik manually and try again');
|
||||
break;
|
||||
case BindErrorCode.ERROR:
|
||||
Alert.alert('Bind Failed', message);
|
||||
break;
|
||||
default:
|
||||
Alert.alert('Bind Failed', `[${code}] ${message}`);
|
||||
break;
|
||||
}
|
||||
close('showMobikwikPersonalBind')();
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user