package Ġnet . gin i . pay . gin ipay business . review . bank Ċ Ċ import Ġandroid . content . Component Name Ċ import Ġandroid . content . Intent Ċ import Ġandroid . content . pm . PackageManager Ċ import Ġandroid . content . pm . Resolve Info Ċ import Ġandroid . graphics . drawable . Drawable Ċ import Ġandroid . net . Uri Ċ Ċ internal Ġconst Ġval ĠScheme Ġ= Ġ" gin ipay " Ġ// ĠIt Ġhas Ġto Ġmatch Ġthe Ġscheme Ġin Ġquery Ġtag Ġin Ġmanifest Ċ private Ġconst Ġval ĠPayment Path Ġ= Ġ" payment " Ċ internal Ġconst Ġval ĠQuery Uri Ġ= Ġ"$ Scheme :// $ Payment Path / id " Ċ internal Ġfun Ġget Bank Uri ( requestId : ĠString ) Ġ= Ġ"$ Scheme :// $ Payment Path /$ requestId " Ċ Ċ fun ĠPackage Manager . getB anks (): ĠList < Bank App > Ġ= Ġquery Intent Activities ( get Bank Query Intent (), Ġ 0 ). map Ġ{ Ġapp Ġ-> ĊĠĠĠ ĠBank App ( package Manager Ġ= Ġthis , Ġresolve Info Ġ= Ġapp ) Ċ } Ċ Ċ fun Ġget Bank Query Intent () Ġ= ĠIntent (). apply Ġ{ ĊĠĠĠ Ġaction Ġ= ĠIntent . ACTION _ VIEW ĊĠĠĠ Ġdata Ġ= ĠUri . parse ( Query Uri ) Ċ } Ċ Ċ class ĠBank App ( ĊĠĠĠ Ġpackage Manager : ĠPackage Manager , ĊĠĠĠ Ġprivate Ġval Ġresolve Info : ĠResolve Info , Ċ ) Ġ{ ĊĊĠĠĠ Ġval Ġname : ĠString Ġ= Ġresolve Info . load Label ( package Manager ). toString () ĊĠĠĠ Ġval ĠpackageName : ĠString Ġ= Ġresolve Info . activity Info . application Info . packageName ĊĠĠĠ Ġval Ġversion : ĠString Ġ= Ġpackage Manager . get Package Info ( packageName , Ġ 0 ). version Name ĊĠĠĠ Ġprivate Ġval Ġcomponent : ĠComponent Name Ġ= ĠComponent Name ( resolve Info . activity Info . packageName , Ġresolve Info . activity Info . name ) ĊĊĠĠĠ Ġfun Ġget Icon Drawable ( package Manager : ĠPackage Manager ): ĠDrawable Ġ= Ġresolve Info . load Icon ( package Manager ) ĊĊĠĠĠ Ġfun Ġget Intent ( payment RequestId : ĠString ) Ġ= ĠIntent (). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġaction Ġ= ĠIntent . ACTION _ VIEW ĊĠĠĠĠĠĠĠ Ġdata Ġ= ĠUri . parse ( get Bank Uri ( payment RequestId )) ĊĠĠĠĠĠĠĠ Ġcomponent Ġ= Ġthis @ Bank App . component ĊĠĠĠ Ġ} Ċ }