package Ġco . om ise go . omg shop . pages . checkout . caller Ċ Ċ import Ġco . om ise go . omg shop . R Ċ import Ġco . om ise go . omg shop . base . Base Caller Ċ import Ġco . om ise go . omg shop . helpers . Context or Ċ import Ġco . om ise go . omg shop . helpers . Preference Ċ import Ġco . om ise go . omg shop . models . Credential Ċ import Ġco . om ise go . omg shop . models . Product Ċ import Ġco . om ise go . omg shop . network . Combined API Manager Ċ Ċ /* Ċ Ġ* ĠOm ise GO Ċ Ġ* Ċ Ġ* ĠCreated Ġby ĠPh uch it ĠSi ri mong k ols ath ien Ġon Ġ 1 9 / 6 / 2 0 1 8 ĠAD . Ċ Ġ* ĠCopyright ĠÂ© Ġ 2 0 1 7 - 2 0 1 8 ĠOm ise GO . ĠAll Ġrights Ġreserved . Ċ Ġ*/ Ċ class ĠCheckout Caller ( ĊĠĠĠ Ġprivate Ġval Ġhandler : ĠCheckout Caller Contract . Handler , ĊĠĠĠ Ġoverride Ġval Ġcredential : ĠCredential Ġ= ĠPreference . load Credential () Ċ ) Ġ: ĠBase Caller (), ĠCheckout Caller Contract . Caller Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġbuy ( request : ĠProduct . Buy . Request ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġif Ġ( request . tokenId . isEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġerror Ġ= ĠThrowable ( Context or . context . getString ( R . string . activity _ checkout _ pay _ error _ token _ not _ set )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhandler . handle Buy Failed ( error ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġm Composite Subscription Ġ+= ĠCom bined API Manager . buy ( credential , Ġrequest ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. do On Subscribe Ġ{ Ġhandler . show Loading () Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe ( handler :: handle Buy Success , Ġhandler :: handle Buy Failed ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Wallet s ( auth Token : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġhandler . show Loading () ĊĠĠĠĠĠĠĠ ĠCom bined API Manager . get Wallet s ( auth Token , Ġhandler :: handle Load Wallet Failed , Ġhandler :: handle Load Wallet Success ) ĊĠĠĠ Ġ} Ċ } Ċ