/* Ċ Ġ* ĠCopyright ĠÂ© Ġ 2 0 2 0 ĠBy ĠG eek s ĠEmp ire . Ċ Ġ* Ċ Ġ* ĠCreated Ġby ĠE li as ĠF azel Ċ Ġ* ĠLast Ġmodified Ġ 8 / 1 5 / 2 0 Ġ 5 : 4 2 ĠAM Ċ Ġ* Ċ Ġ* ĠLicensed ĠUnder ĠMIT ĠLicense . Ċ Ġ* Ġhttps :// opensource . org / licenses / MIT Ċ Ġ*/ Ċ Ċ package Ġnet . ge ek st ools . float short . PRO . Utils . In App Store . Digital Assets . Items . Subscription Purchase . Extensions Ċ Ċ import Ġcom . android . billing client . api . Billing Flow Params Ċ import Ġcom . android . billing client . api . Sku Details Ċ import Ġnet . ge ek st ools . float short . PRO . Utils . In App Store . Digital Assets . Initialize In App Billing Ċ import Ġnet . ge ek st ools . float short . PRO . Utils . In App Store . Digital Assets . Items . Subscription Purchase . Subscription Purchase Ċ Ċ fun ĠSubscription Purchase . subscription Purchase Flow ( sku Details : ĠSk u Details ) Ġ{ ĊĊĠĠĠ Ġin App Billing Subscription Purchase View Binding . center Purchase Button . root . setOnClickListener Ġ{ ĊĊĠĠĠĠĠĠĠ Ġpurchase Flow Command ( sku Details ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġin App Billing Subscription Purchase View Binding . bottom Purchase Button . root . setOnClickListener Ġ{ ĊĊĠĠĠĠĠĠĠ Ġpurchase Flow Command ( sku Details ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġfun ĠSubscription Purchase . purchase Flow Command ( sku Details : ĠSk u Details ) Ġ{ ĊĠĠĠ Ġval Ġbilling Flow Params Ġ= ĠBilling Flow Params . newBuilder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Sku Details ( sku Details ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġval Ġbilling Result Ġ= Ġbilling Client . launch Billing Flow ( require Activity () Ġas ĠInitialize In App Billing , Ġbilling Flow Params ) ĊĠĠĠ Ġpurchase Flow Controller ?. purchase Flow Initial ( billing Result ) Ċ }