package Ġcom . kar h oo . uis dk . screen . booking . checkout . payment . br aint ree Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġcom . br aint re ep ay ments . api . B ra int ree Fragment Ċ import Ġcom . br aint re ep ay ments . api . Three D Secure Ċ import Ġcom . br aint re ep ay ments . api . drop in . Drop In Request Ċ import Ġcom . br aint re ep ay ments . api . interfaces . B ra int ree Error Listener Ċ import Ġcom . br aint re ep ay ments . api . interfaces . PaymentMethod Nonce Created Listener Ċ import Ġcom . br aint re ep ay ments . api . models . PaymentMethod Nonce Ċ import Ġcom . br aint re ep ay ments . api . models . Three D Secure Request Ċ import Ġcom . kar h oo . sdk . api . Kar h oo Error Ċ import Ġcom . kar h oo . sdk . api . model . Quote Ċ import Ġcom . kar h oo . sdk . api . network . request . Pass enger Details Ċ import Ġcom . kar h oo . uis dk . screen . booking . checkout . payment . Payment Drop In Contract Ċ import Ġcom . kar h oo . uis dk . util . extension . is Guest Ċ Ċ class ĠB ra int ree Payment View Ġconstructor ( actions : ĠPayment Drop In Contract . Actions ) Ġ: ĠPayment Drop In Contract . View Ġ{ ĊĊĠĠĠ Ġvar Ġpresenter : ĠPayment Drop In Contract . Presenter ? Ġ= ĠB ra int ree Payment Presenter ( actions ) ĊĠĠĠ Ġvar Ġactions : ĠPayment Drop In Contract . Actions ? Ġ= Ġactions ĊĊĠĠĠ Ġoverride Ġfun Ġhandle Three D Secure ( context : ĠContext , Ġsdk Token : ĠString , Ġnonce : ĠString , Ġamount : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġb ra int ree Fragment Ġ= ĠB ra int ree Fragment . newInstance ( context Ġas ĠAppCompatActivity , Ġsdk Token ) ĊĊĠĠĠĠĠĠĠ Ġb ra int ree Fragment . addListener ( object Ġ: ĠPayment Method Nonce Created Listener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon PaymentMethod Nonce Created ( payment Method Nonce : ĠPayment Method Nonce ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġactions ?. three D Secure Nonce ( payment Method Nonce ?. nonce . or Empty ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġb ra int ree Fragment . addListener ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġobject Ġ: ĠB ra int ree Error Listener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun ĠonError ( error : ĠException ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġactions ?. show Payment Failure Dialog ( Kar h oo Error . from Throwable ( error )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġval Ġthree D Secure Request Ġ= ĠThree D Secure Request () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. nonce ( nonce ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. amount ( amount ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. version Requested ( Three D Secure Request . VERSION _ 2 ) ĊĠĠĠĠĠĠĠ ĠThree D Secure . perform Verification ( br aint ree Fragment , Ġthree D Secure Request ) ĊĠĠĠĠĠĠĠ Ġ{ Ġrequest , Ġlookup Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠThree D Secure . continue Perform Verification ( br aint ree Fragment , Ġrequest , Ġlookup ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinitialise Change Card ( quote : ĠQuote ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter ?. sdk Init ( quote ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinitialise Guest Payment ( quote : ĠQuote ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter ?. initial ise Guest Payment ( quote ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinitialise Payment Flow ( quote : ĠQuote ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter ?. get Payment Nonce ( quote ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Result ( request Code : ĠInt , ĠresultCode : ĠInt , Ġdata : ĠIntent ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter ?. handle Activity Result ( request Code , ĠresultCode , Ġdata ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Payment Drop In UI ( context : ĠContext , Ġsdk Token : ĠString , Ġpayment Data : ĠString ?, Ġquote : ĠQuote ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdrop In Request : ĠDrop In Request Ġ= Ġpresenter ?. get Drop In Config ( context , Ġsdk Token ) Ġas ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠDrop In Request ĊĠĠĠĠĠĠĠ Ġval Ġrequest Code Ġ= Ġif Ġ( is Guest ()) ĠREQ _ CODE _ BR AINT REE _ G UEST Ġelse ĠREQ _ CODE _ BR AINT REE ĊĠĠĠĠĠĠĠ Ġ( context Ġas ĠActivity ). startActivity For Result ( drop In Request . get Intent ( context ), Ġrequest Code ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Pass enger ( pass enger Details : ĠPass enger Details ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter ?. set Pass enger ( pass enger Details ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠREQ _ CODE _ BR AINT REE Ġ= Ġ 3 0 1 ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠREQ _ CODE _ BR AINT REE _ G UEST Ġ= Ġ 3 0 2 ĊĠĠĠ Ġ} Ċ } Ċ