-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7c5e63
commit 4f4c6d8
Showing
10 changed files
with
193 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
443 changes: 139 additions & 304 deletions
443
funsol-billing-utils/src/main/java/com/funsol/iap/billing/helper/ProductPrices.kt
Large diffs are not rendered by default.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
funsol-billing-utils/src/main/java/com/funsol/iap/billing/helper/TypeExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,43 @@ | ||
package com.funsol.iap.billing.helper | ||
|
||
import com.android.billingclient.api.Purchase | ||
import com.funsol.iap.billing.model.FunsolPurchase | ||
|
||
fun List<Purchase>.toFunsolPurchases(): List<FunsolPurchase> { | ||
return this.map { purchase -> | ||
FunsolPurchase( | ||
products = purchase.products.toMutableList(), | ||
purchaseState = purchase.purchaseState, | ||
purchaseToken = purchase.purchaseToken, | ||
isAcknowledged = purchase.isAcknowledged, | ||
packageName = purchase.packageName, | ||
developerPayload = purchase.developerPayload, | ||
isAutoRenewing = purchase.isAutoRenewing, | ||
orderId = purchase.orderId, | ||
originalJson = purchase.originalJson, | ||
purchaseTime = purchase.purchaseTime, | ||
quantity = purchase.quantity, | ||
signature = purchase.signature, | ||
skus = purchase.skus | ||
) | ||
} | ||
} | ||
|
||
fun Purchase.toFunsolPurchase(): FunsolPurchase { | ||
return FunsolPurchase( | ||
products = this.products.toMutableList(), | ||
purchaseState = this.purchaseState, | ||
purchaseToken = this.purchaseToken, | ||
isAcknowledged = this.isAcknowledged, | ||
packageName = this.packageName, | ||
developerPayload = this.developerPayload, | ||
isAutoRenewing = this.isAutoRenewing, | ||
orderId = this.orderId, | ||
originalJson = this.originalJson, | ||
purchaseTime = this.purchaseTime, | ||
quantity = this.quantity, | ||
signature = this.signature, | ||
skus = this.skus | ||
|
||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
funsol-billing-utils/src/main/java/com/funsol/iap/billing/listeners/BillingEventListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
package com.funsol.iap.billing.listeners | ||
|
||
import com.android.billingclient.api.Purchase | ||
import com.funsol.iap.billing.model.ErrorType | ||
|
||
import com.funsol.iap.billing.model.FunsolPurchase | ||
|
||
interface BillingEventListener { | ||
fun onProductsPurchased(purchases: List<Purchase?>) | ||
fun onPurchaseAcknowledged(purchase: Purchase) | ||
fun onPurchaseConsumed(purchase: Purchase) | ||
fun onProductsPurchased(purchases: List<FunsolPurchase?>) | ||
fun onPurchaseAcknowledged(purchase: FunsolPurchase) | ||
fun onPurchaseConsumed(purchase: FunsolPurchase) | ||
fun onBillingError(error: ErrorType) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters