fix bugs
This commit is contained in:
@@ -441,10 +441,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
<PayTmPersonalOTPBind
|
<PayTmPersonalOTPBind
|
||||||
isDebug
|
isDebug
|
||||||
initialMobile={bindPrefillMobile}
|
initialMobile={bindPrefillMobile}
|
||||||
onRequestOTP={async (wt, p) =>
|
onRequestOTP={async (wt, p) => {
|
||||||
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {}))}
|
return 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 }))}
|
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')}
|
onSuccess={this.onOtpBindSuccess('showPaytmPersonalBind', 'Paytm Personal OTP')}
|
||||||
onError={() => {}}
|
onError={() => {}}
|
||||||
/>
|
/>
|
||||||
@@ -479,10 +481,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
<PhonePePersonalOTPBind
|
<PhonePePersonalOTPBind
|
||||||
isDebug
|
isDebug
|
||||||
initialMobile={bindPrefillMobile}
|
initialMobile={bindPrefillMobile}
|
||||||
onRequestOTP={async (wt, p) =>
|
onRequestOTP={async (wt, p) => {
|
||||||
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {}))}
|
return 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 }))}
|
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')}
|
onSuccess={this.onOtpBindSuccess('showPhonePePersonalBind', 'PhonePe Personal OTP')}
|
||||||
onError={() => {}}
|
onError={() => {}}
|
||||||
/>
|
/>
|
||||||
@@ -499,10 +503,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
<PaytmBusinessOTPBind
|
<PaytmBusinessOTPBind
|
||||||
isDebug
|
isDebug
|
||||||
initialMobile={bindPrefillMobile}
|
initialMobile={bindPrefillMobile}
|
||||||
onRequestOTP={async (wt, p) =>
|
onRequestOTP={async (wt, p) => {
|
||||||
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {}))}
|
return 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 }))}
|
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')}
|
onSuccess={this.onOtpBindSuccess('showPaytmBusinessBind', 'Paytm Business bound successfully')}
|
||||||
onError={() => {}}
|
onError={() => {}}
|
||||||
/>
|
/>
|
||||||
@@ -519,10 +525,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
<PhonePeBusinessBind
|
<PhonePeBusinessBind
|
||||||
isDebug
|
isDebug
|
||||||
initialMobile={bindPrefillMobile}
|
initialMobile={bindPrefillMobile}
|
||||||
onRequestOTP={async (wt, p) =>
|
onRequestOTP={async (wt, p) => {
|
||||||
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile, {}))}
|
return 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 }))}
|
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')}
|
onSuccess={this.onOtpBindSuccess('showPhonePeBusinessBind', 'PhonePe Business bound successfully')}
|
||||||
onError={() => {}}
|
onError={() => {}}
|
||||||
/>
|
/>
|
||||||
@@ -555,10 +563,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
<BharatPeBusinessOTPBind
|
<BharatPeBusinessOTPBind
|
||||||
isDebug
|
isDebug
|
||||||
initialMobile={bindPrefillMobile}
|
initialMobile={bindPrefillMobile}
|
||||||
onRequestOTP={async (wt, p) =>
|
onRequestOTP={async (wt, p) => {
|
||||||
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile))}
|
return 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 }))}
|
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')}
|
onSuccess={this.onOtpBindSuccess('showBharatPeBusinessBind', 'BharatPe Business bound successfully')}
|
||||||
onError={() => {}}
|
onError={() => {}}
|
||||||
/>
|
/>
|
||||||
@@ -575,10 +585,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
<MobikwikOTPBind
|
<MobikwikOTPBind
|
||||||
isDebug={true}
|
isDebug={true}
|
||||||
initialMobile={bindPrefillMobile}
|
initialMobile={bindPrefillMobile}
|
||||||
onRequestOTP={async (wt, p) =>
|
onRequestOTP={async (wt, p) => {
|
||||||
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile))}
|
return 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 }))}
|
onVerifyOTP={async (wt, p) => {
|
||||||
|
return this.wrapOtpCall(() => Api.instance.verifyOTP(wt, p.mobile, p.otp, p));
|
||||||
|
}}
|
||||||
onSuccess={this.onOtpBindSuccess('showMobikwikPersonalBind', 'Mobikwik bound successfully')}
|
onSuccess={this.onOtpBindSuccess('showMobikwikPersonalBind', 'Mobikwik bound successfully')}
|
||||||
onError={() => {}}
|
onError={() => {}}
|
||||||
/>
|
/>
|
||||||
@@ -611,10 +623,12 @@ export default class HomeScreen extends Component<any, HomeScreenState> {
|
|||||||
<FreeChargeBind
|
<FreeChargeBind
|
||||||
isDebug
|
isDebug
|
||||||
initialMobile={bindPrefillMobile}
|
initialMobile={bindPrefillMobile}
|
||||||
onRequestOTP={async (wt, p) =>
|
onRequestOTP={async (wt, p) => {
|
||||||
this.wrapOtpCall(() => Api.instance.requestOTP(wt, p.mobile))}
|
return 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 }))}
|
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')}
|
onSuccess={this.onOtpBindSuccess('showFreechargePersonalBind', 'Freecharge bound successfully')}
|
||||||
onError={() => {}}
|
onError={() => {}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
34
upi.html
34
upi.html
@@ -144,6 +144,10 @@
|
|||||||
background: linear-gradient(135deg, #1a73e8, #34a853);
|
background: linear-gradient(135deg, #1a73e8, #34a853);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.c-airtel {
|
||||||
|
background: linear-gradient(135deg, #e40000, #ff5252);
|
||||||
|
}
|
||||||
|
|
||||||
.c-upi {
|
.c-upi {
|
||||||
background: linear-gradient(135deg, #37474f, #78909c);
|
background: linear-gradient(135deg, #37474f, #78909c);
|
||||||
}
|
}
|
||||||
@@ -230,7 +234,8 @@
|
|||||||
<div class="link-box" id="link-display"></div>
|
<div class="link-box" id="link-display"></div>
|
||||||
</div>
|
</div>
|
||||||
<a class="pay-btn c-paytm" id="pay-btn" href="#">Pay Now</a>
|
<a class="pay-btn c-paytm" id="pay-btn" href="#">Pay Now</a>
|
||||||
<button type="button" class="pay-btn c-phonepe" id="phonepe-bank-btn" style="border:none;font:inherit;">PhonePe 银行卡测试(ACCOUNT)</button>
|
<button type="button" class="pay-btn c-phonepe" id="phonepe-bank-btn" style="border:none;font:inherit;">PhonePe Bank Account Test (ACCOUNT)</button>
|
||||||
|
<button type="button" class="pay-btn c-airtel" id="airtel-bank-btn" style="border:none;font:inherit;">Airtel Transfer to Bank (₹12)</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="qr-wrap">
|
<div class="qr-wrap">
|
||||||
@@ -322,6 +327,21 @@
|
|||||||
return `phonepe://native?data=${encodeURIComponent(btoa(JSON.stringify(payload)))}&id=p2ppayment`;
|
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() {
|
function phonepeBankAccountTestLink() {
|
||||||
const payload = {
|
const payload = {
|
||||||
contact: {
|
contact: {
|
||||||
@@ -354,7 +374,7 @@
|
|||||||
gpay: (pa, pn, am, extra) => `gpay://upi/pay?pa=${pa}&pn=${pn}&am=${am}&cu=INR${extra}`,
|
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}`; },
|
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}`,
|
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}`,
|
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');
|
const warnEl = document.getElementById('warn-box');
|
||||||
let warnMsg = w.warn || '';
|
let warnMsg = w.warn || '';
|
||||||
if (walletKey === 'phonepe_biz' && app === 'phonepe') {
|
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') {
|
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) {
|
if (warnMsg) {
|
||||||
warnEl.textContent = warnMsg.startsWith('⚠') ? warnMsg : '⚠ ' + warnMsg;
|
warnEl.textContent = warnMsg.startsWith('⚠') ? warnMsg : '⚠ ' + warnMsg;
|
||||||
@@ -439,6 +459,12 @@
|
|||||||
} catch (_) { }
|
} catch (_) { }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById('airtel-bank-btn').addEventListener('click', function () {
|
||||||
|
try {
|
||||||
|
window.location.href = airtelBankTransferLink();
|
||||||
|
} catch (_) { }
|
||||||
|
});
|
||||||
|
|
||||||
document.getElementById('wallet').addEventListener('change', update);
|
document.getElementById('wallet').addEventListener('change', update);
|
||||||
document.getElementById('app').addEventListener('change', update);
|
document.getElementById('app').addEventListener('change', update);
|
||||||
document.getElementById('amount').addEventListener('input', update);
|
document.getElementById('amount').addEventListener('input', update);
|
||||||
|
|||||||
Reference in New Issue
Block a user