JusPayExpress Checkout报错JSURLNotPassed(102):网银支付初始化失败求助
Hey there, let's break down why your netbanking payment is throwing that Error 102 while card payments work flawlessly.
Root Cause Identification
JusPay Error 102 almost always ties to callback URL validation failure—the SDK can't match the final redirect URL against the regex patterns you provided. Looking at your code, there's an obvious mismatch:
- For card payments, your regex targets your actual callback URL:
https:\/\/dev\.merchant\.com\/payments\/app-success.*$ - For netbanking, you accidentally used an entirely different domain:
https:\/\/merchant\.acko\.com\/payments\/app-success.*$
Since your real callback URL is https://dev.merchant.com/payments/app-success, the netbanking regex is checking the wrong domain—this is the core issue triggering the error.
Fix: Correct the Regex Domain
Update your netbanking initialization code to use the same domain as your card payment setup. Here's the corrected version:
checkout.environment(SANDBOX, merchantId: AppConstants.PaymentString.merchantId, orderId: model.orderId, netbankingBank: model.bankId, endUrlRegexes: [ "https:\/\/dev\.merchant\.com\/payments\/app-success.*$" ])
If you're using Swift, you can use raw strings to avoid double-escaping slashes, making the regex easier to read:
checkout.environment(SANDBOX, merchantId: AppConstants.PaymentString.merchantId, orderId: model.orderId, netbankingBank: model.bankId, endUrlRegexes: [ #"https://dev\.merchant\.com/payments/app-success.*$"# ])
Additional Checks to Ensure Smooth Flow
- Merchant Dashboard Whitelist: Confirm your JusPay merchant dashboard has whitelisted
dev.merchant.comas an allowed callback domain. Even with a correct regex, a missing whitelist entry can cause validation failures. - Debug Log Verification: Enable JusPay's debug logs to see the exact URL the netbanking flow redirects to. Banks sometimes append extra parameters to the callback URL—your
.*$suffix already handles this, but it's good to confirm the full path matches. - Regex Logic: Your regex logic (
.*$to match any trailing characters) is correct for handling dynamic parameters in the callback URL. Just ensure the core domain and path are an exact match.
Once you fix the domain in the netbanking regex, Error 102 should disappear, and the flow will work just like your card payment setup.
内容的提问来源于stack exchange,提问作者G.Abhisek

