{"id":19156151,"url":"https://github.com/applogistdev/easybilling-android","last_synced_at":"2025-08-15T17:09:37.035Z","repository":{"id":109654960,"uuid":"249360966","full_name":"applogistdev/easybilling-android","owner":"applogistdev","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-26T10:26:59.000Z","size":176,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T07:41:46.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/applogistdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-23T07:17:40.000Z","updated_at":"2024-07-26T10:27:02.000Z","dependencies_parsed_at":"2024-11-09T08:35:36.383Z","dependency_job_id":"9c5d1f5e-9cfa-45dd-849a-f96118df8338","html_url":"https://github.com/applogistdev/easybilling-android","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/applogistdev/easybilling-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applogistdev%2Feasybilling-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applogistdev%2Feasybilling-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applogistdev%2Feasybilling-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applogistdev%2Feasybilling-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/applogistdev","download_url":"https://codeload.github.com/applogistdev/easybilling-android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/applogistdev%2Feasybilling-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270602456,"owners_count":24614260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T08:33:25.224Z","updated_at":"2025-08-15T17:09:37.012Z","avatar_url":"https://github.com/applogistdev.png","language":"Kotlin","readme":"\n## Installation\n[![](https://jitpack.io/v/applogistdev/easybilling-android.svg)](https://jitpack.io/#applogistdev/easybilling-android)    \n```gradle \nallprojects {  \n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n}\ndependencies {\n\timplementation 'com.github.applogistdev:easybilling-android:Tag'\n}\n``` \n## What is Consume and Acknowledge\n[https://developer.android.com/google/play/billing/billing_library_overview#acknowledge](https://developer.android.com/google/play/billing/billing_library_overview#acknowledge)\n### Consume Example\nCandy Crush Buy Candy Bomb $1\n\nPurchase -\u003e onPurchasesUpdated -\u003e consumePurchase\n\nYou can buy again\n### Acknowledge Example\nCandy Crush Remove Ads $5\n\nPurchase -\u003e onPurchasesUpdated -\u003e acknowledgePurchase\n\nYou can't buy again\n\n## What is Developer Payload\nhttps://developer.android.com/google/play/billing/billing_library_overview#attach_a_developer_payload\n\nSome example: Developer Payload = User Email Address\n\nCandy Crush Buy Candy Bomb $1 OR Candy Crush Remove Ads $5\n\nPurchase -\u003e onPurchasesUpdated -\u003e consumePurchase(Developer Payload) OR acknowledgePurchase(Developer Payload)\n```kotlin\noverride fun onInAppPurchases(purchases: List\u003cPurchase\u003e) {  \n    Log.d(purchases[0].developerPayload)\n}\nOR\noverride fun onSubsPurchases(purchases: List\u003cPurchase\u003e) {  \n    Log.d(purchases[0].developerPayload)\n}\n```\n\n## Flow\nİnit -\u003e \n- onBillingInitialized() OR onBillingInitializedError()\n\t- onBillingInitializedError -\u003e Finish\n\t- onBillingInitialized -\u003e onInAppPurchases() AND onSubsPurchases()\n\t\t- onInAppPurchases -\u003e returned all BillingClient.SkuType.INAPP\n\t\t- onSubsPurchases -\u003e returned all BillingClient.SkuType.SUBS\n- billingViewModel.purchase(Context, PRODUCT_ID(Google Play Store), BillingClient.SkuType.INAPP or BillingClient.SkuType.SUBS) -\u003e onPurchasesUpdated (Only returns the items that were just now purchased or billed.)\n- billingViewModel.consumePurchase(Purchase Token) -\u003e onPurchaseConsumed()\n- billingViewModel.acknowledgePurchase(Purchase Token, AcknowledgePurchaseResponseListener, Devloper Payload) -\u003e https://developer.android.com/google/play/billing/billing_library_overview#acknowledge\n\n## Usage\n```kotlin  \nbillingViewModel = ViewModelProvider(this).get(EasyBillingViewModel::class.java)  \n  \nbillingViewModel.billingListener = object : EasyBillingListener {  \n  \n    override fun onBillingInitialized() {  \n        Log.d(\"onBillingInitialized\")\n    }  \n  \n    override fun onBillingInitializedError(errorCode: Int) {  \n        Log.e(\"onBillingInitializedError\", errorCode)  \n    }  \n  \n    override fun onInAppPurchases(purchases: List\u003cPurchase\u003e) {  \n        Log.d(\"onInAppPurchases\")  \n    }  \n  \n    override fun onSubsPurchases(purchases: List\u003cPurchase\u003e) {  \n        Log.e(\"subsPurchases\", purchases)  \n    }  \n  \n    override fun onPurchasesUpdated(billingResult: BillingResult, purchases: List\u003cPurchase\u003e?) {  \n        Log.e(\"onPurchasesUpdated\")\n    }  \n  \n    override fun onPurchaseConsumed(billingResult: BillingResult, purchaseToken: String) {  \n\t\tLog.e(\"onPurchaseConsumed\")\n    }  \n}\n```\n## Payment\n```kotlin\nbillingViewModel.purchase(Context, IN_APP_PRODUCT_ID)\n```\n## Test Payments\n```kotlin\nbillingViewModel.testPurchased(Context)\n\nbillingViewModel.testPurchaseCanceled(Context)\n\nbillingViewModel.testPurchaseItemUnavailable(Context)\n```\n\n## Get Items\n```kotlin\noverride fun onBillingInitialized() {   \n    billingViewModel.getSkuDetails(  \n            arrayListOf(IN_APP_PRODUCT_ID),  \n            BillingClient.SkuType.INAPP,  \n            SkuDetailsResponseListener { billingResult, skuDetailsList -\u003e  {\n\t            Log.d(\"getSkuDetails\", skuDetailsList[0].price)\n            }\n  )  \n}\nor\nif(billingViewModel.isBillingReady()){\n    billingViewModel.getSkuDetails(  \n            arrayListOf(IN_APP_PRODUCT_ID),  \n            BillingClient.SkuType.INAPP,  \n            SkuDetailsResponseListener { billingResult, skuDetailsList -\u003e  {\n\t            Log.d(\"getSkuDetails\", skuDetailsList[0].price)\n            }\n  )\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplogistdev%2Feasybilling-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapplogistdev%2Feasybilling-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplogistdev%2Feasybilling-android/lists"}