fix bugs
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { Alert, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||
import { onProxyMessage, proxySendMessage, paytmPay, openMobikwikPayToBank, openPhonePePayToBank, openFreechargePayToBank } from 'rnwalletman';
|
||||
import {
|
||||
onProxyMessage,
|
||||
proxySendMessage,
|
||||
openPaytmPayToBank,
|
||||
openMobikwikPayToBank,
|
||||
openPhonePePayToBank,
|
||||
openFreechargePayToBank,
|
||||
} from 'rnwalletman';
|
||||
|
||||
export default function TestScreen() {
|
||||
const subRef = useRef<ReturnType<typeof onProxyMessage> | null>(null);
|
||||
@@ -20,9 +27,9 @@ export default function TestScreen() {
|
||||
proxySendMessage({ type: 'echo', messageId: `echo_${Date.now()}`, data: { text: `hello_${Date.now()}` } });
|
||||
};
|
||||
|
||||
const handlePaytmPay = () => {
|
||||
paytmPay('Harshpreet singh', '01601000068180', 'PSIB0000160', '2', '66666')
|
||||
.then(result => console.log(result))
|
||||
const handlePaytmPayToBank = () => {
|
||||
openPaytmPayToBank('Harshpreet singh', '01601000068180', 'PSIB0000160', '2', '66666')
|
||||
.then(result => console.log('Paytm Pay To Bank', result ? 'Success' : 'Failed'))
|
||||
.catch(error => Alert.alert('Transfer Failed', String(error)));
|
||||
};
|
||||
|
||||
@@ -48,7 +55,7 @@ export default function TestScreen() {
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.sectionTitle}>Test Tools</Text>
|
||||
|
||||
<TouchableOpacity style={[styles.btn, { backgroundColor: '#2ecc71' }]} onPress={handlePaytmPay}>
|
||||
<TouchableOpacity style={[styles.btn, { backgroundColor: '#2ecc71' }]} onPress={handlePaytmPayToBank}>
|
||||
<Text style={styles.btnText}>Paytm Pay To Bank Test</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={[styles.btn, { backgroundColor: '#2ecc33' }]} onPress={handleMobikwikPayToBank}>
|
||||
|
||||
Reference in New Issue
Block a user