Hi guys
My app has only one product and user can buy it how many times he want.
This product refers to different things every times user buy it.
So, if user requests a refund for his last purchase, how could my app know that this refund is referred only for the last thing and not for all the previous things purchased?
Each purchase is a unique event linked to the customer. Therefore, each purchase must be identified by a unique number + customer code (and it can also have a date)
before being able to purchase the same product again, you have to consume it…
so if you are using the same product id for different products, you have to maintain a list of purchased prroducts yourself
as others already said, it would be easier for you to have a seperate product id for each product
currently not… you will have to store a history yourself…
what you can get is a list of all owned products…
yes, the purchase token is used to verify the purchase
you can read more about it in the documenation 404 Not Found | Pura Vida Apps
Acknowledge purchases : your app must consume or acknowledge all purchases. This is a new feature Google added into the Billing library to prevent fraud. If you don’t consume or acknowledge a purchase within three days, Google automatically revokes the purchase and refunds the user.
If your app has a validating server component, you should only acknowledge a purchase after successfully validating it.
Verifying purchases is not required, but is considered a best practice when selling in-app products. For more about how to fight fraudulent purchases, check out chapter Verify purchases before granting entitlements in the Fight fraud and abuse page and chapter Processing Purchases in the Integrate the Google Play Billing Library into your app page.
After verifying the purchase, your app then needs to acknowledge the purchase.
How the billing extension can help: If you decide to not verify the purchase, you can use the AutoAcknowledge feature of the extension to automatically acknowledge after purchasing. If you choose to verify the purchase, use the PurchaseUpdated event to get the purchase token and follow chapter Verify purchases before granting entitlements in the Fight fraud and abuse page. After successful verification then use method Acknowledge together with the purchase token to acknowledge the purchase.
to get the purchase token, you also can use the PurchaseToken method
Get purchase token of a purchased product or subscription, jsonString can be a jsonObject returned from event PurchaseUpdated or a jsonArray returned from event GotPurchasedProducts or GotPurchasedSubscriptions .
Note : The use of this method is only required if AutoAcknowledge is false and you like to verify the purchase token on your backend server.