phonepe business otp 模式
This commit is contained in:
@@ -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={() => {}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user