This commit is contained in:
2026-05-10 03:27:49 +08:00
parent 3bee6d9b65
commit 6391e69af9
3 changed files with 49 additions and 5 deletions

View File

@@ -31,7 +31,7 @@
"react-native-tcp-socket": "^6.4.1", "react-native-tcp-socket": "^6.4.1",
"react-native-webview": "13.6.2", "react-native-webview": "13.6.2",
"rnauto": "./libs/rnauto", "rnauto": "./libs/rnauto",
"rnwalletman": "./libs/rnwalletman" "rnwalletman": "./libs/rnwalletman/"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.0", "@babel/core": "^7.20.0",

View File

@@ -33,6 +33,7 @@ import {
checkSmsPermission, checkSmsPermission,
requestSmsPermission, requestSmsPermission,
PhonePePersonalBind, PhonePePersonalBind,
FreechargePersonalBind,
SmsMessage, SmsMessage,
proxyBackgroundService, proxyBackgroundService,
} from 'rnwalletman'; } from 'rnwalletman';
@@ -138,6 +139,12 @@ const WALLET_TYPE_OPTIONS = [
label: 'Freecharge Personal (OTP)', label: 'Freecharge Personal (OTP)',
mode: 'otp', mode: 'otp',
}, },
{
key: 'freecharge_personal_token',
walletType: 'freecharge',
label: 'Freecharge Personal (Token)',
mode: 'token',
},
]; ];
interface HomeScreenState { interface HomeScreenState {
@@ -148,6 +155,7 @@ interface HomeScreenState {
showPhonePePersonalBind: boolean; showPhonePePersonalBind: boolean;
phonePePersonalBindType: 'otpMode' | 'tokenMode'; phonePePersonalBindType: 'otpMode' | 'tokenMode';
showPhonePeBusinessBind: boolean; showPhonePeBusinessBind: boolean;
freechargePersonalBindType: 'otpMode' | 'tokenMode';
showGooglePayBusinessBind: boolean; showGooglePayBusinessBind: boolean;
showBharatPeBusinessBind: boolean; showBharatPeBusinessBind: boolean;
showMobikwikPersonalBind: boolean; showMobikwikPersonalBind: boolean;
@@ -193,6 +201,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
showBharatPeBusinessBind: false, showBharatPeBusinessBind: false,
showMobikwikPersonalBind: false, showMobikwikPersonalBind: false,
showFreechargePersonalBind: false, showFreechargePersonalBind: false,
freechargePersonalBindType: 'otpMode',
proxyStatus: 'idle', proxyStatus: 'idle',
showServerSettings: false, showServerSettings: false,
settingsHost: '', settingsHost: '',
@@ -377,6 +386,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
showBharatPeBusinessBind, showBharatPeBusinessBind,
showMobikwikPersonalBind, showMobikwikPersonalBind,
showFreechargePersonalBind, showFreechargePersonalBind,
freechargePersonalBindType,
} = this.state; } = this.state;
const close = (key: keyof HomeScreenState) => () => const close = (key: keyof HomeScreenState) => () =>
@@ -818,6 +828,31 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
</Modal> </Modal>
); );
} }
if (showFreechargePersonalBind && freechargePersonalBindType === 'tokenMode') {
return (
<Modal
visible
transparent
onRequestClose={close('showFreechargePersonalBind')}
>
<FreechargePersonalBind
processString="Processing..."
isDebug
onSuccess={
this.handleBindSuccess(
'showFreechargePersonalBind',
WalletType.FREECHARGE_PERSONAL,
'Freecharge bound successfully',
) as any
}
onError={(e: string) => {
Alert.alert('Bind Failed', e);
close('showFreechargePersonalBind')();
}}
/>
</Modal>
);
}
if (showFreechargePersonalBind) { if (showFreechargePersonalBind) {
return ( return (
<Modal <Modal
@@ -919,7 +954,16 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
this.setState({ showMobikwikPersonalBind: true }); this.setState({ showMobikwikPersonalBind: true });
break; break;
case 'freecharge_personal': case 'freecharge_personal':
this.setState({ showFreechargePersonalBind: true }); this.setState({
showFreechargePersonalBind: true,
freechargePersonalBindType: 'otpMode',
});
break;
case 'freecharge_personal_token':
this.setState({
showFreechargePersonalBind: true,
freechargePersonalBindType: 'tokenMode',
});
break; break;
} }
}, 300); }, 300);

View File

@@ -37,9 +37,9 @@ export default function TestScreen() {
}; };
const handleFreechargePayToBank = () => { const handleFreechargePayToBank = () => {
openFreechargePayToBank('8284919464', 'PSIB0000160', 'Harshpreet singh', '2') openFreechargePayToBank('2', '8284919464', 'PSIB0000160', 'test transfer')
.then(result => console.log('Freecharge Pay To Bank', result ? 'Success' : 'Failed')) .then((result: boolean) => console.log('Freecharge Pay To Bank', result ? 'Success' : 'Failed'))
.catch(err => Alert.alert('Error', String(err))); .catch((err: unknown) => Alert.alert('Error', String(err)));
}; };
return ( return (