Android Billing. How to purchase multiple quantity of multiple items?

73 Views Asked by At

Do we have the possibility to purchase multiple different items with different quantity within a single purchase?

Sample:

  • item_sku_0
  • item_sku_1
  • item_sku_2

The user selects

  • item_sku_0 : qty: 3
  • item_sku_1 : qty: 2
  • item_sku_2 : qty: 4

the application combines the user cart into List<BillingFlowParams.ProductDetailsParams> and then passes it to the library

val productDetailsParamsList = listOf<BillingFlowParams.ProductDetailsParams>(
     ProductDetails(/* item_sku_0  */),
     ProductDetails(/* item_sku_0  */),
     ProductDetails(/* item_sku_0  */),

     ProductDetails(/* item_sku_1  */),
     ProductDetails(/* item_sku_1  */),

     ProductDetails(/* item_sku_2  */),
     ProductDetails(/* item_sku_2  */),
     ProductDetails(/* item_sku_2  */),
     ProductDetails(/* item_sku_2  */),
)


val billingFlowParams = BillingFlowParams.newBuilder()
     .setProductDetailsParamsList(productDetailsParamsList)
     .build()
billingClient.launchBillingFlow(activity, billingFlowParams)

The Google Billing Library v6 demonstrates its native BottomSheet with Error while retrieving information from server. DF-DFERH-01 error.


Is this feature able to be implemented based on the Google Play Billing Library?

0

There are 0 best solutions below