phonepe business otp 模式

This commit is contained in:
2026-05-23 23:02:36 +08:00
parent 97d78a72ac
commit ec6fc11a6d
3 changed files with 9 additions and 71 deletions

View File

@@ -16,6 +16,7 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"

View File

@@ -34,9 +34,6 @@ export class MobikwikOTPBind extends Component<{
onSuccess: (result: MobikwikPersonalBindResult) => void;
onError: (error: string) => void;
isDebug: boolean;
deviceId: string;
tuneUserId: string;
androidId: string;
initialMobile?: string;
}> {
render() {
@@ -50,11 +47,6 @@ export class MobikwikOTPBind extends Component<{
onSuccess={this.props.onSuccess}
onError={this.props.onError}
isDebug={this.props.isDebug}
additionalParams={{
deviceId: this.props.deviceId,
tuneUserId: this.props.tuneUserId,
androidId: this.props.androidId,
}}
initialMobile={this.props.initialMobile}
/>
);

View File

@@ -22,7 +22,6 @@ import {
GooglePayBusinessBind,
WalletType,
PaytmBusinessBindResult,
PhonePeBusinessBindResult,
PaytmPersonalBind,
MobikwikPersonalBindResult,
FreechargePersonalBindResult,
@@ -518,65 +517,14 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
onRequestClose={close('showPhonePeBusinessBind')}
>
<PhonePeBusinessBind
processString="Processing..."
isDebug
initialMobile={bindPrefillMobile}
onRequestOTP={async (wt, p) =>
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {}))}
onVerifyOTP={async (wt, p) =>
this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionToken: p.sessionToken }))}
onSuccess={this.onOtpBindSuccess('showPhonePeBusinessBind', 'PhonePe Business bound successfully')}
onError={(e: string) => { Alert.alert('Bind Failed', e); close('showPhonePeBusinessBind')(); }}
onRenderBottomView={({
showOtpInput,
loading,
formError,
phone,
otp,
onPhoneChange,
onOtpChange,
onGetOtp,
onSubmitOtp,
}) => (
<View style={s.otpBar}>
{!showOtpInput ? (
<>
<TextInput
style={s.otpInput}
placeholder="Mobile Number"
placeholderTextColor="#999"
keyboardType="phone-pad"
value={phone}
onChangeText={onPhoneChange}
editable={!loading}
/>
{!!formError && <Text style={s.errText}>{formError}</Text>}
<TouchableOpacity
style={[s.otpBtn, { opacity: loading ? 0.5 : 1 }]}
onPress={onGetOtp}
disabled={loading}
>
<Text style={s.otpBtnText}>{loading ? 'Loading...' : 'GET OTP'}</Text>
</TouchableOpacity>
</>
) : (
<>
<TextInput
style={s.otpInput}
placeholder="OTP"
placeholderTextColor="#999"
keyboardType="number-pad"
value={otp}
onChangeText={onOtpChange}
editable={!loading}
/>
{!!formError && <Text style={s.errText}>{formError}</Text>}
<TouchableOpacity
style={[s.otpBtn, { opacity: loading ? 0.5 : 1 }]}
onPress={onSubmitOtp}
disabled={loading}
>
<Text style={s.otpBtnText}>{loading ? 'Loading...' : 'Verify OTP'}</Text>
</TouchableOpacity>
</>
)}
</View>
)}
onError={() => {}}
/>
</Modal>
);
@@ -626,14 +574,11 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
>
<MobikwikOTPBind
isDebug={true}
deviceId={this.deviceId}
tuneUserId={this.tuneUserId}
androidId={this.androidId}
initialMobile={bindPrefillMobile}
onRequestOTP={async (wt, p) =>
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, { deviceId: p.deviceId, tuneUserId: p.tuneUserId, androidId: p.androidId }))}
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile))}
onVerifyOTP={async (wt, p) =>
this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId, deviceId: p.deviceId, tuneUserId: p.tuneUserId, nid: p.nid }))}
this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { generateOtpRequestTimeId: p.generateOtpRequestTimeId }))}
onSuccess={this.onOtpBindSuccess('showMobikwikPersonalBind', 'Mobikwik bound successfully')}
onError={() => {}}
/>