fix demo
This commit is contained in:
23
App.tsx
23
App.tsx
@@ -320,8 +320,7 @@ export default class App extends Component<AppProps, AppState> {
|
||||
handleUploadPhonePePersonal = async (result: PhonePePersonalBindResult) => {
|
||||
try {
|
||||
console.log(JSON.stringify(result));
|
||||
const response = await Api.instance.register(WalletType.PHONEPE_PERSONAL, result);
|
||||
console.log(response);
|
||||
Alert.alert('绑定成功', 'PhonePe Personal 绑定成功');
|
||||
this.setState({ showPhonePePersonalBind: false });
|
||||
} catch (error) {
|
||||
Alert.alert('Bind PhonePe Personal Error', (error as Error).message || 'Unknown error');
|
||||
@@ -402,11 +401,31 @@ export default class App extends Component<AppProps, AppState> {
|
||||
<PhonePePersonalBind
|
||||
processString="Processing PhonePe Personal..."
|
||||
isDebug={true}
|
||||
otpMode={true}
|
||||
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: PhonePePersonalBindResult) => {
|
||||
this.handleUploadPhonePePersonal(result);
|
||||
}}
|
||||
onError={(error: string) => {
|
||||
console.log(error);
|
||||
Alert.alert('绑定失败', error);
|
||||
this.setState({ showPhonePePersonalBind: false });
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user