This commit is contained in:
2026-05-28 03:06:19 +08:00
parent d7e16ee9c4
commit 6eaa171ba4
8 changed files with 76 additions and 9 deletions

View File

@@ -801,7 +801,10 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {}));
}}
onVerifyOTP={async (wt, p) => {
return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId }));
return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, {
sessionId: p.sessionId,
...(p.password ? { password: p.password } : {}),
}));
}}
onSuccess={this.onOtpBindSuccess('showAmazonPayPersonalBind', 'Amazon Pay bound successfully')}
onError={() => {}}
@@ -1054,10 +1057,6 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
bounces={false}
>
{groups.map(({ walletType, items }) => {
if (items.length === 1) {
return this.renderWalletItem(items[0]);
}
const expanded = !!expandedBoundWalletGroups[walletType];
const color = WALLET_TYPE_COLORS[walletType] ?? '#888';
@@ -1079,7 +1078,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
</View>
<View style={{ flex: 1, marginLeft: 12 }}>
<Text style={s.boundWalletGroupTitle}>{formatWalletTypeLabel(walletType)}</Text>
<Text style={s.boundWalletGroupSub}>{items.length} accounts</Text>
<Text style={s.boundWalletGroupSub}>{items.length} account{items.length > 1 ? 's' : ''}</Text>
</View>
<Text style={s.walletGroupChevron}>{expanded ? '▼' : '▶'}</Text>
</TouchableOpacity>

View File

@@ -7,6 +7,7 @@ import {
openMobikwikPayToBank,
openPhonePePayToBank,
openFreechargePayToBank,
openAmazonPayPayToBank,
} from 'rnwalletman';
export default function TestScreen() {
@@ -51,6 +52,12 @@ export default function TestScreen() {
.catch((err: unknown) => Alert.alert('Error', String(err)));
};
const handleAmazonPayPayToBank = () => {
openAmazonPayPayToBank()
.then((result: boolean) => console.log('Amazon Pay To Bank', result ? 'Success' : 'Failed'))
.catch((err: unknown) => Alert.alert('Error', String(err)));
};
return (
<View style={styles.container}>
<Text style={styles.sectionTitle}>Test Tools</Text>
@@ -67,6 +74,9 @@ export default function TestScreen() {
<TouchableOpacity style={[styles.btn, { backgroundColor: '#5468db' }]} onPress={handleFreechargePayToBank}>
<Text style={styles.btnText}>Freecharge Pay To Bank Test</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#ff9900' }]} onPress={handleAmazonPayPayToBank}>
<Text style={styles.btnText}>Amazon Pay To Bank Test</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.btn, { backgroundColor: '#3498db' }]} onPress={handleEcho}>
<Text style={styles.btnText}>Echo Test</Text>
</TouchableOpacity>