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 <activity
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize" android:windowSoftInputMode="adjustResize"

View File

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

View File

@@ -22,7 +22,6 @@ import {
GooglePayBusinessBind, GooglePayBusinessBind,
WalletType, WalletType,
PaytmBusinessBindResult, PaytmBusinessBindResult,
PhonePeBusinessBindResult,
PaytmPersonalBind, PaytmPersonalBind,
MobikwikPersonalBindResult, MobikwikPersonalBindResult,
FreechargePersonalBindResult, FreechargePersonalBindResult,
@@ -518,65 +517,14 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
onRequestClose={close('showPhonePeBusinessBind')} onRequestClose={close('showPhonePeBusinessBind')}
> >
<PhonePeBusinessBind <PhonePeBusinessBind
processString="Processing..."
isDebug 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')} onSuccess={this.onOtpBindSuccess('showPhonePeBusinessBind', 'PhonePe Business bound successfully')}
onError={(e: string) => { Alert.alert('Bind Failed', e); close('showPhonePeBusinessBind')(); }} onError={() => {}}
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>
)}
/> />
</Modal> </Modal>
); );
@@ -626,14 +574,11 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
> >
<MobikwikOTPBind <MobikwikOTPBind
isDebug={true} isDebug={true}
deviceId={this.deviceId}
tuneUserId={this.tuneUserId}
androidId={this.androidId}
initialMobile={bindPrefillMobile} initialMobile={bindPrefillMobile}
onRequestOTP={async (wt, p) => 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) => 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')} onSuccess={this.onOtpBindSuccess('showMobikwikPersonalBind', 'Mobikwik bound successfully')}
onError={() => {}} onError={() => {}}
/> />