新的paytmbiz 魔改包
This commit is contained in:
+31
-4
@@ -49,6 +49,7 @@ import {
|
||||
PhonePePersonalOTPBind,
|
||||
BharatPeBusinessOTPBind,
|
||||
PaytmBusinessOTPBind,
|
||||
PaytmBusinessTokenBind,
|
||||
PhonePeBusinessOTPBind,
|
||||
} from '../components/WalletBindComponents';
|
||||
import { WalletSelectModal, WALLET_ICONS, WALLET_TYPE_COLORS } from '../components/WalletSelectModal';
|
||||
@@ -128,7 +129,7 @@ function getBindKeyForWallet(item: WalletItem): string | null {
|
||||
case 'phonepe':
|
||||
return otp ? 'phonepe_personal_otp' : 'phonepe_personal_token';
|
||||
case 'paytm business':
|
||||
return 'paytm_business';
|
||||
return item.otpMode ? 'paytm_business' : 'paytm_business_token';
|
||||
case 'phonepe business':
|
||||
return otp ? 'phonepe_business_otp' : 'phonepe_business_web';
|
||||
case 'googlepay business':
|
||||
@@ -151,6 +152,7 @@ interface HomeScreenState {
|
||||
showPaytmPersonalBind: boolean;
|
||||
paytmPersonalBindType: 'otpMode' | 'tokenMode';
|
||||
showPaytmBusinessBind: boolean;
|
||||
paytmBusinessBindType: 'otpMode' | 'tokenMode';
|
||||
showPhonePePersonalBind: boolean;
|
||||
phonePePersonalBindType: 'otpMode' | 'tokenMode';
|
||||
showPhonePeBusinessBind: boolean;
|
||||
@@ -202,6 +204,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
paytmPersonalBindType: 'otpMode',
|
||||
showPaytmPersonalBind: false,
|
||||
showPaytmBusinessBind: false,
|
||||
paytmBusinessBindType: 'otpMode',
|
||||
showPhonePePersonalBind: false,
|
||||
phonePePersonalBindType: 'otpMode',
|
||||
showPhonePeBusinessBind: false,
|
||||
@@ -518,7 +521,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
renderBindModal = () => {
|
||||
const {
|
||||
showPaytmPersonalBind, paytmPersonalBindType, showPhonePePersonalBind, phonePePersonalBindType,
|
||||
showPaytmBusinessBind, showPhonePeBusinessBind, phonePeBusinessBindType, showGooglePayBusinessBind, showBharatPeBusinessBind,
|
||||
showPaytmBusinessBind, paytmBusinessBindType, showPhonePeBusinessBind, phonePeBusinessBindType, showGooglePayBusinessBind, showBharatPeBusinessBind,
|
||||
showMobikwikPersonalBind, mobikwikPersonalBindType, showFreechargePersonalBind, freechargePersonalBindType,
|
||||
showAmazonPayPersonalBind,
|
||||
bindPrefillMobile,
|
||||
@@ -684,6 +687,27 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
if (showPaytmBusinessBind && paytmBusinessBindType === 'tokenMode') {
|
||||
return (
|
||||
<Modal
|
||||
visible
|
||||
transparent
|
||||
onRequestClose={close('showPaytmBusinessBind')}
|
||||
>
|
||||
<PaytmBusinessTokenBind
|
||||
isDebug
|
||||
processString="Connecting to Paytm Business..."
|
||||
onSuccess={(result) => {
|
||||
this.handleBindSuccess('showPaytmBusinessBind', WalletType.PAYTM_BUSINESS, 'Paytm Business bound successfully')(result);
|
||||
}}
|
||||
onError={(code, message) => {
|
||||
Alert.alert('Bind Failed', message || code);
|
||||
close('showPaytmBusinessBind')();
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
if (showPaytmBusinessBind) {
|
||||
return (
|
||||
<Modal
|
||||
@@ -759,7 +783,7 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
<GooglePayBusinessBind
|
||||
processString="Processing..."
|
||||
isDebug
|
||||
showClearCacheButton={GOOGLEPAY_BUSINESS_SHOW_CLEAR_CACHE}
|
||||
clearCookie={GOOGLEPAY_BUSINESS_SHOW_CLEAR_CACHE}
|
||||
onSuccess={(result: GooglePayBusinessBindResult) => {
|
||||
console.log('GooglePayBusinessBindResult', result);
|
||||
this.handleBindSuccess('showGooglePayBusinessBind', WalletType.GOOGLEPAY_BUSINESS, 'GooglePay Business bound successfully')(result);
|
||||
@@ -937,7 +961,10 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
||||
this.setState({ showPaytmPersonalBind: true, paytmPersonalBindType: 'tokenMode' });
|
||||
break;
|
||||
case 'paytm_business':
|
||||
this.setState({ showPaytmBusinessBind: true });
|
||||
this.setState({ showPaytmBusinessBind: true, paytmBusinessBindType: 'otpMode' });
|
||||
break;
|
||||
case 'paytm_business_token':
|
||||
this.setState({ showPaytmBusinessBind: true, paytmBusinessBindType: 'tokenMode' });
|
||||
break;
|
||||
case 'phonepe_personal_otp':
|
||||
this.setState({ showPhonePePersonalBind: true, phonePePersonalBindType: 'otpMode' });
|
||||
|
||||
Reference in New Issue
Block a user