From fd6852450e9b0654dea4d0f936b4ebdd7300d8a5 Mon Sep 17 00:00:00 2001 From: TQCasey <494294315@qq.com> Date: Mon, 25 May 2026 15:25:58 +0800 Subject: [PATCH] fix bugs --- screens/HomeScreen.tsx | 70 +++++++++++++++++++++++++----------------- upi.html | 34 +++++++++++++++++--- 2 files changed, 72 insertions(+), 32 deletions(-) diff --git a/screens/HomeScreen.tsx b/screens/HomeScreen.tsx index 696df57..084301b 100644 --- a/screens/HomeScreen.tsx +++ b/screens/HomeScreen.tsx @@ -441,10 +441,12 @@ export default class HomeScreen extends Component { - 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 }))} + onRequestOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {})); + }} + onVerifyOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId })); + }} onSuccess={this.onOtpBindSuccess('showPaytmPersonalBind', 'Paytm Personal OTP')} onError={() => {}} /> @@ -479,10 +481,12 @@ export default class HomeScreen extends Component { - 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 }))} + onRequestOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {})); + }} + onVerifyOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionId: p.sessionId })); + }} onSuccess={this.onOtpBindSuccess('showPhonePePersonalBind', 'PhonePe Personal OTP')} onError={() => {}} /> @@ -499,10 +503,12 @@ export default class HomeScreen extends Component { - 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 }))} + onRequestOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {})); + }} + onVerifyOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionToken: p.sessionToken })); + }} onSuccess={this.onOtpBindSuccess('showPaytmBusinessBind', 'Paytm Business bound successfully')} onError={() => {}} /> @@ -519,10 +525,12 @@ export default class HomeScreen extends Component { - 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 }))} + onRequestOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {})); + }} + onVerifyOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionToken: p.sessionToken })); + }} onSuccess={this.onOtpBindSuccess('showPhonePeBusinessBind', 'PhonePe Business bound successfully')} onError={() => {}} /> @@ -555,10 +563,12 @@ export default class HomeScreen extends Component { - 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 }))} + onRequestOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile)); + }} + onVerifyOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { sessionToken: p.sessionToken })); + }} onSuccess={this.onOtpBindSuccess('showBharatPeBusinessBind', 'BharatPe Business bound successfully')} onError={() => {}} /> @@ -575,10 +585,12 @@ export default class HomeScreen extends Component { - this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile))} - onVerifyOTP={async (wt, p) => - this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { generateOtpRequestTimeId: p.generateOtpRequestTimeId }))} + onRequestOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile)) + }} + onVerifyOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, p)); + }} onSuccess={this.onOtpBindSuccess('showMobikwikPersonalBind', 'Mobikwik bound successfully')} onError={() => {}} /> @@ -611,10 +623,12 @@ export default class HomeScreen extends Component { - this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile))} - onVerifyOTP={async (wt, p) => - this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { otpId: p.otpId, deviceId: p.deviceId, csrfId: p.csrfId, appFc: p.appFc }))} + onRequestOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile)); + }} + onVerifyOTP={async (wt, p) => { + return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, { otpId: p.otpId, deviceId: p.deviceId, csrfId: p.csrfId, appFc: p.appFc })); + }} onSuccess={this.onOtpBindSuccess('showFreechargePersonalBind', 'Freecharge bound successfully')} onError={() => {}} /> diff --git a/upi.html b/upi.html index 0be38ab..3fa692b 100644 --- a/upi.html +++ b/upi.html @@ -144,6 +144,10 @@ background: linear-gradient(135deg, #1a73e8, #34a853); } + .c-airtel { + background: linear-gradient(135deg, #e40000, #ff5252); + } + .c-upi { background: linear-gradient(135deg, #37474f, #78909c); } @@ -230,7 +234,8 @@ Pay Now - + +
@@ -322,6 +327,21 @@ return `phonepe://native?data=${encodeURIComponent(btoa(JSON.stringify(payload)))}&id=p2ppayment`; } + function airtelBankTransferLink() { + const accountNumber = '2053426110'; + const ifsc = 'KKBK0000811'; + const bankId = ifsc.slice(0, 4); + const amount = '12'; + const q = new URLSearchParams({ + screenName: 'transfer_to_bank_acc', + bankId, + ifsc, + accountNumber, + amount, + }); + return `myairtel://airtelpay?${q.toString()}`; + } + function phonepeBankAccountTestLink() { const payload = { contact: { @@ -354,7 +374,7 @@ gpay: (pa, pn, am, extra) => `gpay://upi/pay?pa=${pa}&pn=${pn}&am=${am}&cu=INR${extra}`, mobikwik: (pa, pn, am, extra) => { const tn = (extra.match(/[?&]tn=([^&]*)/) || [])[1] || 'payment'; return `mobikwik://moneytransfer/upi/verifyVpa?vpa=${encodeURIComponent(pa)}&amount=${am}¬e=${tn}`; }, freecharge: (pa, pn, am, extra) => `freechargeupi://pay?pa=${pa}&pn=${pn}&am=${am}&cu=INR${extra}`, - // fallback 在 scheduleAutoClick 里处理 + // fallback handled in scheduleAutoClick upi: (pa, pn, am, extra) => `upi://pay?pa=${pa}&pn=${pn}&am=${am}&cu=INR${extra}`, }; @@ -393,10 +413,10 @@ const warnEl = document.getElementById('warn-box'); let warnMsg = w.warn || ''; if (walletKey === 'phonepe_biz' && app === 'phonepe') { - warnMsg = (warnMsg ? warnMsg + '\n' : '') + '提示:PhonePe Business 建议用 PhonePe (pay) 而非 native p2p。'; + warnMsg = (warnMsg ? warnMsg + '\n' : '') + 'Tip: PhonePe Business works best with PhonePe (pay), not native p2p.'; } if (walletKey === 'phonepe_per' && app === 'phonepe_pay') { - warnMsg = (warnMsg ? warnMsg + '\n' : '') + '提示:PhonePe 个人收款建议用 PhonePe (native p2p)。'; + warnMsg = (warnMsg ? warnMsg + '\n' : '') + 'Tip: PhonePe Personal works best with PhonePe (native p2p).'; } if (warnMsg) { warnEl.textContent = warnMsg.startsWith('⚠') ? warnMsg : '⚠ ' + warnMsg; @@ -439,6 +459,12 @@ } catch (_) { } }); + document.getElementById('airtel-bank-btn').addEventListener('click', function () { + try { + window.location.href = airtelBankTransferLink(); + } catch (_) { } + }); + document.getElementById('wallet').addEventListener('change', update); document.getElementById('app').addEventListener('change', update); document.getElementById('amount').addEventListener('input', update);