Compare commits
14 Commits
5f0d79aa92
...
24d80ef505
| Author | SHA1 | Date | |
|---|---|---|---|
| 24d80ef505 | |||
| c1bf6690a2 | |||
| 061c690948 | |||
| d4127b1eba | |||
| 53f91447e4 | |||
| 5ed34ffc06 | |||
| b52bab194f | |||
| 5136e470e4 | |||
| d4cd1cecee | |||
| 795ccbfd51 | |||
| 7211525ef8 | |||
| 11cce27665 | |||
| 099880ab72 | |||
| 25aa9e9cbe |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ android/.gradle/file-system.probe
|
|||||||
android/.gradle/8.0.1/checksums/checksums.lock
|
android/.gradle/8.0.1/checksums/checksums.lock
|
||||||
android/.gradle/8.0.1/checksums/md5-checksums.bin
|
android/.gradle/8.0.1/checksums/md5-checksums.bin
|
||||||
android/.gradle/8.0.1/checksums/sha1-checksums.bin
|
android/.gradle/8.0.1/checksums/sha1-checksums.bin
|
||||||
|
android/.idea/caches
|
||||||
|
|||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -7,3 +7,6 @@
|
|||||||
[submodule "libs/rnauto"]
|
[submodule "libs/rnauto"]
|
||||||
path = libs/rnauto
|
path = libs/rnauto
|
||||||
url = https://gitea.seaflygames.live/true_casey/rnauto.git
|
url = https://gitea.seaflygames.live/true_casey/rnauto.git
|
||||||
|
[submodule "servers/usdtman"]
|
||||||
|
path = servers/usdtman
|
||||||
|
url = https://gitea.seaflygames.live/true_casey/usdtman.git
|
||||||
|
|||||||
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
@@ -12,6 +12,18 @@
|
|||||||
"env": {
|
"env": {
|
||||||
"PATH": "/Users/hybro/go/bin:${env:PATH}"
|
"PATH": "/Users/hybro/go/bin:${env:PATH}"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug USDTMan Server",
|
||||||
|
"type": "go",
|
||||||
|
"request": "launch",
|
||||||
|
"mode": "debug",
|
||||||
|
"program": "${workspaceFolder}/servers/usdtman/cmd/server",
|
||||||
|
"cwd": "${workspaceFolder}/servers/usdtman",
|
||||||
|
"preLaunchTask": "build usdtman",
|
||||||
|
"env": {
|
||||||
|
"PATH": "/Users/hybro/go/bin:${env:PATH}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
23
.vscode/tasks.json
vendored
23
.vscode/tasks.json
vendored
@@ -21,6 +21,27 @@
|
|||||||
"kind": "build",
|
"kind": "build",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"label": "build usdtman",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "go",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"-o",
|
||||||
|
"${workspaceFolder}/servers/usdtman/bin/server",
|
||||||
|
"./cmd/server"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/servers/usdtman"
|
||||||
|
},
|
||||||
|
"problemMatcher": [
|
||||||
|
"$go"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
299
App.tsx
299
App.tsx
@@ -1,5 +1,6 @@
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Alert, Modal, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
import { Alert, AppState, AppStateStatus, Modal, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
||||||
|
import DeviceInfo from 'react-native-device-info';
|
||||||
import {
|
import {
|
||||||
PaytmBusinessBind,
|
PaytmBusinessBind,
|
||||||
PhonePeBusinessBind,
|
PhonePeBusinessBind,
|
||||||
@@ -33,25 +34,38 @@ import {
|
|||||||
PhonePePersonalBind,
|
PhonePePersonalBind,
|
||||||
SmsMessage,
|
SmsMessage,
|
||||||
NotificationMessage,
|
NotificationMessage,
|
||||||
|
proxyManager,
|
||||||
} from "rnwalletman";
|
} from "rnwalletman";
|
||||||
|
|
||||||
import BarcodeScanning from '@react-native-ml-kit/barcode-scanning';
|
import BarcodeScanning from '@react-native-ml-kit/barcode-scanning';
|
||||||
import RNFS from 'react-native-fs';
|
import RNFS from 'react-native-fs';
|
||||||
|
|
||||||
import rnauto from 'rnauto';
|
|
||||||
|
|
||||||
interface AppProps {
|
interface AppProps {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AppState {
|
interface WalletmanAppState {
|
||||||
showPaytmBusinessBind: boolean;
|
|
||||||
|
/* Paytm Personal */
|
||||||
showPaytmPersonalBind: boolean;
|
showPaytmPersonalBind: boolean;
|
||||||
|
paytmPersonalBindType: 'otpMode' | 'authMode';
|
||||||
|
showPaytmBusinessBind: boolean;
|
||||||
|
|
||||||
|
/* PhonePe Personal */
|
||||||
showPhonePePersonalBind: boolean;
|
showPhonePePersonalBind: boolean;
|
||||||
|
phonePePersonalBindType: 'otpMode' | 'authMode';
|
||||||
showPhonePeBusinessBind: boolean;
|
showPhonePeBusinessBind: boolean;
|
||||||
|
|
||||||
|
/* GooglePay Business */
|
||||||
showGooglePayBusinessBind: boolean;
|
showGooglePayBusinessBind: boolean;
|
||||||
|
|
||||||
|
/* BharatPe Business */
|
||||||
showBharatPeBusinessBind: boolean;
|
showBharatPeBusinessBind: boolean;
|
||||||
|
|
||||||
|
/* Mobikwik Personal */
|
||||||
showMobikwikPersonalBind: boolean;
|
showMobikwikPersonalBind: boolean;
|
||||||
|
|
||||||
|
/* Freecharge Personal */
|
||||||
showFreechargePersonalBind: boolean;
|
showFreechargePersonalBind: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +81,7 @@ const styles = StyleSheet.create({
|
|||||||
backgroundColor: "lightblue",
|
backgroundColor: "lightblue",
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
width: 200,
|
width: 200,
|
||||||
height: 50,
|
height: 55,
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
@@ -84,28 +98,38 @@ const styles = StyleSheet.create({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
bindButton: {
|
bindButton: {
|
||||||
padding: 10,
|
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
width: 250,
|
width: 350,
|
||||||
height: 40,
|
height: 50,
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
margin: 10,
|
marginBottom : 10,
|
||||||
},
|
},
|
||||||
bindButtonText: {
|
bindButtonText: {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
|
textAlign: "center",
|
||||||
|
textAlignVertical: "center",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
class Api {
|
class Api {
|
||||||
|
|
||||||
private static readonly BASE_URL = 'http://192.168.1.155:16000';
|
public static readonly BASE_URL = 'http://192.168.1.117:16000';
|
||||||
private static _instance: Api | null = null;
|
private static _instance: Api | null = null;
|
||||||
|
private userId: number = 0;
|
||||||
|
|
||||||
private constructor() {
|
private constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setUserId(userId: number) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getUserId(): number {
|
||||||
|
return this.userId;
|
||||||
|
}
|
||||||
|
|
||||||
public static get instance() {
|
public static get instance() {
|
||||||
if (Api._instance === null) {
|
if (Api._instance === null) {
|
||||||
Api._instance = new Api();
|
Api._instance = new Api();
|
||||||
@@ -113,42 +137,72 @@ class Api {
|
|||||||
return Api._instance;
|
return Api._instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async register(walletType: WalletType, params: any) {
|
private headers(): Record<string, string> {
|
||||||
const response = await fetch(`${Api.BASE_URL}/register`, {
|
const h: Record<string, string> = { 'Content-Type': 'application/json' };
|
||||||
|
if (this.userId) h['X-User-ID'] = String(this.userId);
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async login(username: string, password: string): Promise<number> {
|
||||||
|
const res = await fetch(`${Api.BASE_URL}/login`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ username, password }),
|
||||||
|
});
|
||||||
|
const data = await res.json();
|
||||||
|
if (!data.success) throw new Error(data.message);
|
||||||
|
this.userId = data.data.userId;
|
||||||
|
return this.userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async register(walletType: WalletType, params: any) {
|
||||||
|
const res = await fetch(`${Api.BASE_URL}/register`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: this.headers(),
|
||||||
body: JSON.stringify({ walletType, params }),
|
body: JSON.stringify({ walletType, params }),
|
||||||
});
|
});
|
||||||
return response.json();
|
const data = await res.json();
|
||||||
|
if (!data.success) throw new Error(data.message);
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async requestOTP(walletType: WalletType, mobile: string, params: any = {}) {
|
public async requestOTP(walletType: WalletType, mobile: string, params: any = {}) {
|
||||||
const response = await fetch(`${Api.BASE_URL}/request-otp`, {
|
const res = await fetch(`${Api.BASE_URL}/request-otp`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: this.headers(),
|
||||||
body: JSON.stringify({ walletType, mobile, params }),
|
body: JSON.stringify({ walletType, mobile, ...params }),
|
||||||
});
|
});
|
||||||
return response.json();
|
const data = await res.json();
|
||||||
|
if (!data.success) throw new Error(data.message);
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async verifyOTP(walletType: WalletType, mobile: string, otp: string, params: any = {}) {
|
public async verifyOTP(walletType: WalletType, mobile: string, otp: string, params: any = {}) {
|
||||||
const response = await fetch(`${Api.BASE_URL}/verify-otp`, {
|
const res = await fetch(`${Api.BASE_URL}/verify-otp`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: this.headers(),
|
||||||
body: JSON.stringify({ walletType, mobile, otp, params }),
|
body: JSON.stringify({ walletType, mobile, otp, params }),
|
||||||
});
|
});
|
||||||
return response.json();
|
const data = await res.json();
|
||||||
|
if (!data.success) throw new Error(data.message);
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class App extends Component<AppProps, AppState> {
|
export default class App extends Component<AppProps, WalletmanAppState> {
|
||||||
private deviceId: string;
|
private deviceId: string;
|
||||||
private tuneUserId: string;
|
private tuneUserId: string;
|
||||||
|
private clientId: string = '';
|
||||||
|
private appStateSubscription?: any;
|
||||||
|
|
||||||
constructor(props: AppProps) {
|
constructor(props: AppProps) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
paytmPersonalBindType: 'otpMode',
|
||||||
showPaytmBusinessBind: false,
|
showPaytmBusinessBind: false,
|
||||||
showPaytmPersonalBind: false,
|
showPaytmPersonalBind: false,
|
||||||
|
phonePePersonalBindType: 'otpMode',
|
||||||
showPhonePeBusinessBind: false,
|
showPhonePeBusinessBind: false,
|
||||||
showPhonePePersonalBind: false,
|
showPhonePePersonalBind: false,
|
||||||
showGooglePayBusinessBind: false,
|
showGooglePayBusinessBind: false,
|
||||||
@@ -163,6 +217,30 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
|
/* 获取真实 Android ID */
|
||||||
|
try {
|
||||||
|
this.clientId = await DeviceInfo.getAndroidId();
|
||||||
|
console.log('[设备ID]', this.clientId);
|
||||||
|
} catch (error) {
|
||||||
|
this.clientId = `android_${Date.now()}`;
|
||||||
|
console.warn('[设备ID] 获取失败,使用随机ID:', this.clientId);
|
||||||
|
}
|
||||||
|
/* 监听应用状态 */
|
||||||
|
this.appStateSubscription = AppState.addEventListener('change', this.handleAppStateChange);
|
||||||
|
|
||||||
|
/* 登录获取 userId */
|
||||||
|
try {
|
||||||
|
await Api.instance.login('test123', '123456');
|
||||||
|
console.log('[登录成功] userId:', Api.instance.getUserId());
|
||||||
|
} catch (error) {
|
||||||
|
console.error('[登录失败]', error);
|
||||||
|
Alert.alert('登录失败', String(error));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 初始化代理客户端 */
|
||||||
|
await this.initProxyClient();
|
||||||
|
|
||||||
/* 权限申请 */
|
/* 权限申请 */
|
||||||
let smsPermission = await checkSmsPermission();
|
let smsPermission = await checkSmsPermission();
|
||||||
let notificationPermission = await checkNotificationPermission();
|
let notificationPermission = await checkNotificationPermission();
|
||||||
@@ -188,7 +266,7 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
{ text: '取消' }
|
{ text: '取消' }
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
return; // 等用户手动授权后重启应用
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 启动监听
|
// 启动监听
|
||||||
@@ -201,9 +279,6 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
console.log('[Notification]', notification);
|
console.log('[Notification]', notification);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
* 获取所有短信和通知
|
|
||||||
*/
|
|
||||||
if (smsPermission) {
|
if (smsPermission) {
|
||||||
getAllSms().then((sms: SmsMessage[]) => {
|
getAllSms().then((sms: SmsMessage[]) => {
|
||||||
console.log('[所有短信]', sms.length, '条');
|
console.log('[所有短信]', sms.length, '条');
|
||||||
@@ -217,11 +292,81 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private wsHeartbeatTimer?: NodeJS.Timeout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化代理客户端
|
||||||
|
*/
|
||||||
|
async initProxyClient() {
|
||||||
|
const wsUrl = `ws://${Api.BASE_URL.replace('http://', '')}/ws`;
|
||||||
|
|
||||||
|
proxyManager.start({
|
||||||
|
wsUrl,
|
||||||
|
clientId: this.clientId,
|
||||||
|
userId: Api.instance.getUserId(),
|
||||||
|
debug: true,
|
||||||
|
onConnected: () => {
|
||||||
|
console.log('[代理] ✅ 已连接');
|
||||||
|
},
|
||||||
|
onDisconnected: () => {
|
||||||
|
console.log('[代理] ❌ 已断开');
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.error('[代理] 错误:', error);
|
||||||
|
},
|
||||||
|
// 自定义注册逻辑(可选)
|
||||||
|
onRegister: (ws, clientId, userId) => {
|
||||||
|
// 可以在这里自定义发送的注册消息
|
||||||
|
ws.send(JSON.stringify({
|
||||||
|
type: 'register',
|
||||||
|
clientId,
|
||||||
|
messageId: 'register_' + Date.now(),
|
||||||
|
data: {
|
||||||
|
userId,
|
||||||
|
// 可以添加额外参数
|
||||||
|
deviceInfo: {
|
||||||
|
platform: 'android',
|
||||||
|
version: '1.0.0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('[代理] 启动失败:', err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止代理客户端
|
||||||
|
*/
|
||||||
|
stopProxyClient() {
|
||||||
|
proxyManager.stop();
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount(): void {
|
componentWillUnmount(): void {
|
||||||
|
// 清理应用状态监听
|
||||||
|
this.appStateSubscription?.remove();
|
||||||
|
|
||||||
|
// 停止代理
|
||||||
|
this.stopProxyClient();
|
||||||
|
|
||||||
stopSmsListener();
|
stopSmsListener();
|
||||||
stopNotificationListener();
|
stopNotificationListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理应用状态变化
|
||||||
|
*/
|
||||||
|
handleAppStateChange = (nextAppState: AppStateStatus) => {
|
||||||
|
if (nextAppState === 'background' || nextAppState === 'inactive') {
|
||||||
|
console.log('[AppState] 应用进入后台,关闭代理');
|
||||||
|
this.stopProxyClient();
|
||||||
|
} else if (nextAppState === 'active') {
|
||||||
|
console.log('[AppState] 应用回到前台,重连代理');
|
||||||
|
this.initProxyClient();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
decodeQRFromUrl = async (url: string) => {
|
decodeQRFromUrl = async (url: string) => {
|
||||||
const localPath = `${RNFS.CachesDirectoryPath}/temp_qr_${Date.now()}.jpg`;
|
const localPath = `${RNFS.CachesDirectoryPath}/temp_qr_${Date.now()}.jpg`;
|
||||||
|
|
||||||
@@ -242,8 +387,8 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* 绑定 Paytm Personal */
|
/* 绑定 Paytm Personal */
|
||||||
handlePaytmPersonalBind = () => {
|
handlePaytmPersonalBind = (type: 'otpMode' | 'authMode') => {
|
||||||
this.setState({ showPaytmPersonalBind: true });
|
this.setState({ showPaytmPersonalBind: true ,paytmPersonalBindType: type});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 上传 Paytm Personal 到服务器 */
|
/* 上传 Paytm Personal 到服务器 */
|
||||||
@@ -314,8 +459,8 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 绑定 PhonePe Personal */
|
/* 绑定 PhonePe Personal */
|
||||||
handlePhonePePersonalBind = () => {
|
handlePhonePePersonalBind = (type: 'otpMode' | 'authMode') => {
|
||||||
this.setState({ showPhonePePersonalBind: true });
|
this.setState({ showPhonePePersonalBind: true ,phonePePersonalBindType: type});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 上传 PhonePe Personal 到服务器 */
|
/* 上传 PhonePe Personal 到服务器 */
|
||||||
@@ -396,6 +541,44 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
|
|
||||||
renderBindModal = () => {
|
renderBindModal = () => {
|
||||||
|
|
||||||
|
/* 绑定 Paytm Personal */
|
||||||
|
if (this.state.showPaytmPersonalBind) {
|
||||||
|
return (
|
||||||
|
<Modal visible={this.state.showPaytmPersonalBind} transparent={true} onRequestClose={() => this.setState({ showPaytmPersonalBind: false })}>
|
||||||
|
<PaytmPersonalBind
|
||||||
|
processString="Processing Paytm Personal..."
|
||||||
|
isDebug={true}
|
||||||
|
otpMode={this.state.paytmPersonalBindType === 'otpMode'}
|
||||||
|
onRequestOTP={async (walletType: WalletType, params: any) => {
|
||||||
|
try {
|
||||||
|
const response = await Api.instance.requestOTP(walletType, params.mobile, {});
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
return { success: false, message: (error as Error).message };
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onVerifyOTP={async (walletType: WalletType, params: any) => {
|
||||||
|
try {
|
||||||
|
const response = await Api.instance.verifyOTP(walletType, params.mobile, params.otp, {
|
||||||
|
sessionId: params.sessionId, // 只需要传 sessionId
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
return { success: false, message: (error as Error).message };
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onSuccess={(result: PaytmPersonalBindResult) => {
|
||||||
|
this.handleUploadPaytmPersonal(result);
|
||||||
|
}}
|
||||||
|
onError={(error) => {
|
||||||
|
console.log(error);
|
||||||
|
this.setState({ showPaytmPersonalBind: false });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/* 绑定 PhonePe Personal */
|
/* 绑定 PhonePe Personal */
|
||||||
if (this.state.showPhonePePersonalBind) {
|
if (this.state.showPhonePePersonalBind) {
|
||||||
return (
|
return (
|
||||||
@@ -403,7 +586,7 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
<PhonePePersonalBind
|
<PhonePePersonalBind
|
||||||
processString="Processing PhonePe Personal..."
|
processString="Processing PhonePe Personal..."
|
||||||
isDebug={true}
|
isDebug={true}
|
||||||
otpMode={true}
|
otpMode={this.state.phonePePersonalBindType === 'otpMode'}
|
||||||
onRequestOTP={async (walletType: WalletType, params: any) => {
|
onRequestOTP={async (walletType: WalletType, params: any) => {
|
||||||
try {
|
try {
|
||||||
const response = await Api.instance.requestOTP(walletType, params.mobile, {});
|
const response = await Api.instance.requestOTP(walletType, params.mobile, {});
|
||||||
@@ -511,25 +694,6 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 绑定 Paytm Personal */
|
|
||||||
if (this.state.showPaytmPersonalBind) {
|
|
||||||
return (
|
|
||||||
<Modal visible={this.state.showPaytmPersonalBind} transparent={true} onRequestClose={() => this.setState({ showPaytmPersonalBind: false })}>
|
|
||||||
<PaytmPersonalBind
|
|
||||||
processString="Processing Paytm Personal..."
|
|
||||||
isDebug={true}
|
|
||||||
onSuccess={(result: PaytmPersonalBindResult) => {
|
|
||||||
this.handleUploadPaytmPersonal(result);
|
|
||||||
}}
|
|
||||||
onError={(error) => {
|
|
||||||
console.log(error);
|
|
||||||
this.setState({ showPaytmPersonalBind: false });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 绑定 Mobikwik Personal */
|
/* 绑定 Mobikwik Personal */
|
||||||
if (this.state.showMobikwikPersonalBind) {
|
if (this.state.showMobikwikPersonalBind) {
|
||||||
return (
|
return (
|
||||||
@@ -617,28 +781,29 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePaytmPay = async () => {
|
|
||||||
try {
|
|
||||||
const result = await paytmPay("100", "test", "1234567890", "1234567890", "test");
|
|
||||||
Alert.alert('Paytm Pay Success', result.toString());
|
|
||||||
} catch (error) {
|
|
||||||
Alert.alert('Paytm Pay Error', (error as Error).message || 'Unknown error');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{this.renderBindModal()}
|
{this.renderBindModal()}
|
||||||
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "purple" }]} onPress={this.handlePaytmPersonalBind}>
|
<View style={[styles.bindButton, { backgroundColor: "transparent", flexDirection: "row", justifyContent: "space-between", alignItems: "center" }]}>
|
||||||
<Text style={styles.bindButtonText}>绑定 Paytm Personal</Text>
|
<TouchableOpacity style={[styles.bindButton, { marginBottom : 0,width : '45%', backgroundColor: "#888888" }]} onPress={this.handlePaytmPersonalBind.bind(this, 'otpMode')}>
|
||||||
</TouchableOpacity>
|
<Text style={styles.bindButtonText}>绑定 Paytm Personal(OTP)</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity style={[styles.bindButton, { marginBottom : 0,width : '45%', backgroundColor: "#F88888" }]} onPress={this.handlePaytmPersonalBind.bind(this, 'authMode')}>
|
||||||
|
<Text style={styles.bindButtonText}>绑定 Paytm Personal(授权)</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "lightblue" }]} onPress={this.handlePaytmBusinessBind}>
|
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "lightblue" }]} onPress={this.handlePaytmBusinessBind}>
|
||||||
<Text style={styles.bindButtonText}>绑定 Paytm Business</Text>
|
<Text style={styles.bindButtonText}>绑定 Paytm Business</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "#1890ff" }]} onPress={this.handlePhonePePersonalBind}>
|
<View style={[styles.bindButton, { backgroundColor: "transparent", flexDirection: "row", justifyContent: "space-between", alignItems: "center" }]}>
|
||||||
<Text style={styles.bindButtonText}>绑定 PhonePe Personal</Text>
|
<TouchableOpacity style={[styles.bindButton, { marginBottom : 0,width : '45%', backgroundColor: "#C88888" }]} onPress={this.handlePhonePePersonalBind.bind(this, 'otpMode')}>
|
||||||
</TouchableOpacity>
|
<Text style={styles.bindButtonText}>绑定 PhonePe Personal(OTP)</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity style={[styles.bindButton, { marginBottom : 0,width : '45%', backgroundColor: "#A88888" }]} onPress={this.handlePhonePePersonalBind.bind(this, 'authMode')}>
|
||||||
|
<Text style={styles.bindButtonText}>绑定 PhonePe Personal(授权)</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "lightgreen" }]} onPress={this.handlePhonePeBusinessBind}>
|
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "lightgreen" }]} onPress={this.handlePhonePeBusinessBind}>
|
||||||
<Text style={styles.bindButtonText}>绑定 PhonePe Business</Text>
|
<Text style={styles.bindButtonText}>绑定 PhonePe Business</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -648,10 +813,6 @@ export default class App extends Component<AppProps, AppState> {
|
|||||||
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "pink" }]} onPress={this.handleBharatPeBusinessBind}>
|
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "pink" }]} onPress={this.handleBharatPeBusinessBind}>
|
||||||
<Text style={styles.bindButtonText}>绑定 BharatPe Business</Text>
|
<Text style={styles.bindButtonText}>绑定 BharatPe Business</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "orange" }]} onPress={this.handlePaytmPay}>
|
|
||||||
<Text style={styles.bindButtonText}>代付 Paytm Personal</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "brown" }]} onPress={this.handleMobikwikPersonalBind}>
|
<TouchableOpacity style={[styles.bindButton, { backgroundColor: "brown" }]} onPress={this.handleMobikwikPersonalBind}>
|
||||||
<Text style={styles.bindButtonText}>绑定 Mobikwik Personal</Text>
|
<Text style={styles.bindButtonText}>绑定 Mobikwik Personal</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
1258
android/.idea/caches/deviceStreaming.xml
generated
1258
android/.idea/caches/deviceStreaming.xml
generated
File diff suppressed because it is too large
Load Diff
2
android/.idea/gradle.xml
generated
2
android/.idea/gradle.xml
generated
@@ -25,7 +25,9 @@
|
|||||||
<option value="$PROJECT_DIR$/../node_modules/@react-native-cookies/cookies/android" />
|
<option value="$PROJECT_DIR$/../node_modules/@react-native-cookies/cookies/android" />
|
||||||
<option value="$PROJECT_DIR$/../node_modules/@react-native-ml-kit/barcode-scanning/android" />
|
<option value="$PROJECT_DIR$/../node_modules/@react-native-ml-kit/barcode-scanning/android" />
|
||||||
<option value="$PROJECT_DIR$/../node_modules/@react-native/gradle-plugin" />
|
<option value="$PROJECT_DIR$/../node_modules/@react-native/gradle-plugin" />
|
||||||
|
<option value="$PROJECT_DIR$/../node_modules/react-native-device-info/android" />
|
||||||
<option value="$PROJECT_DIR$/../node_modules/react-native-fs/android" />
|
<option value="$PROJECT_DIR$/../node_modules/react-native-fs/android" />
|
||||||
|
<option value="$PROJECT_DIR$/../node_modules/react-native-tcp-socket/android" />
|
||||||
<option value="$PROJECT_DIR$/../node_modules/react-native-webview/android" />
|
<option value="$PROJECT_DIR$/../node_modules/react-native-webview/android" />
|
||||||
<option value="$PROJECT_DIR$/../node_modules/rnauto/android" />
|
<option value="$PROJECT_DIR$/../node_modules/rnauto/android" />
|
||||||
<option value="$PROJECT_DIR$/../node_modules/rnwalletman/android" />
|
<option value="$PROJECT_DIR$/../node_modules/rnwalletman/android" />
|
||||||
|
|||||||
2
android/.idea/vcs.xml
generated
2
android/.idea/vcs.xml
generated
@@ -5,6 +5,8 @@
|
|||||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/../libs/rnauto" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/../libs/rnauto" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/../libs/rnwalletman" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/../libs/rnwalletman" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/../node_modules/rnauto" vcs="Git" />
|
||||||
|
<mapping directory="$PROJECT_DIR$/../node_modules/rnwalletman" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/../servers/walletman" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$/../servers/walletman" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -12,9 +12,12 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-native-cookies/cookies": "^6.2.1",
|
"@react-native-cookies/cookies": "^6.2.1",
|
||||||
"@react-native-ml-kit/barcode-scanning": "^2.0.0",
|
"@react-native-ml-kit/barcode-scanning": "^2.0.0",
|
||||||
|
"buffer": "^6.0.3",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-native": "0.72.10",
|
"react-native": "0.72.10",
|
||||||
|
"react-native-device-info": "14.0.4",
|
||||||
"react-native-fs": "^2.20.0",
|
"react-native-fs": "^2.20.0",
|
||||||
|
"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"
|
||||||
|
|||||||
1
servers/usdtman
Submodule
1
servers/usdtman
Submodule
Submodule servers/usdtman added at 753bd4a4d6
Reference in New Issue
Block a user