This commit is contained in:
2026-03-28 17:01:47 +08:00
parent cb4eaadc3c
commit 416c33d5c9
2 changed files with 14 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import React, { useEffect, useRef } from 'react';
import { Alert, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { onProxyMessage, proxySendMessage, paytmPay, openMobikwikPayToBank, openPhonePePayToBank } from 'rnwalletman';
import { onProxyMessage, proxySendMessage, paytmPay, openMobikwikPayToBank, openPhonePePayToBank, openFreechargePayToBank } from 'rnwalletman';
export default function TestScreen() {
const subRef = useRef<ReturnType<typeof onProxyMessage> | null>(null);
@@ -17,7 +17,7 @@ export default function TestScreen() {
}, []);
const handlePaytmPay = () => {
paytmPay('100', 'Gurvir singh', '296001000405', 'ICIC0002960', 'ABCDEF')
paytmPay('2', 'Gurvir singh', '296001000405', 'ICIC0002960', '66666')
.then(result => console.log(result))
.catch(error => Alert.alert('Transfer Failed', String(error)));
};
@@ -27,17 +27,23 @@ export default function TestScreen() {
};
const handleMobikwikPayToBank = () => {
openMobikwikPayToBank('1234567890', '123456', 'John Doe', '100')
openMobikwikPayToBank('7528905079', 'AIRP0000001', 'FAZLE HAQ', '2')
.then(result => console.log('Mobikwik Pay To Bank', result ? 'Success' : 'Failed'))
.catch(err => Alert.alert('Error', String(err)));
};
const handlePhonePePayToBank = () => {
openPhonePePayToBank('7973837549', 'AIRP0000001', 'FAZLE HAQ', '99.20', 'D72C8BD001')
openPhonePePayToBank('7973837549', 'AIRP0000001', 'FAZLE HAQ', '2.20', 'D72C8BD001')
.then(result => console.log('PhonePe Pay To Bank', result ? 'Success' : 'Failed'))
.catch((err: Error) => Alert.alert('Error', String(err)));
};
const handleFreechargePayToBank = () => {
openFreechargePayToBank('7528905079', 'AIRP0000001', 'FAZLE HAQ', '3.20', 'D72C8BD001')
.then((result: boolean) => console.log('Freecharge Pay To Bank', result ? 'Success' : 'Failed'))
.catch((err: Error) => Alert.alert('Error', String(err)));
};
return (
<View style={styles.container}>
<Text style={styles.sectionTitle}>Test Tools</Text>
@@ -51,6 +57,9 @@ export default function TestScreen() {
<TouchableOpacity style={[styles.btn, { backgroundColor: '#5a2d9c' }]} onPress={handlePhonePePayToBank}>
<Text style={styles.btnText}>PhonePe Pay To Bank Test</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#5468db' }]} onPress={handleFreechargePayToBank}>
<Text style={styles.btnText}>Freecharge Pay To Bank Test</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handleEcho}>
<Text style={styles.btnText}>Echo Test</Text>
</TouchableOpacity>