For those who have decided to implement billing processing using Unity IAP From the state where you do not understand the mechanism of billing processing, understand the mechanism of billing processing and leave the procedure from implementation to implementation.
Purchaser.cs
script implemented for the demo--Implementation of billing process in local environment using Unity IAP --Receipt verification on client terminal using Unity IAP --Introduction overview of receipt verification on server (Python)
Unity-Manual: Unity IAP Setup IAP test items are skipped if a test account has already been created
Unity-Manual: Unity IAP Cross-Platform
Here is a summary of what you need to know in order to implement billing processing.
OnInitialized
OnInitializeFailed
PurchaseProcessingResult
OnPurchaseFailed
ConfigurationBuilder
to make Unity IAP recognize the product ID of the billing item registered in Google Developer Console or iTunes Connect.(* If there are multiple billing items, you need to create your own script to recognize multiple items)
When verifying receipts on the server, Pending
is returned by ProcessPurchase
when purchasing a locally charged item, and ConfirmPendingPurchase
is called after the receipt is verified on the server.
You can check the receipt locally
Read it because it is essential knowledge to verify the receipt information on the server side. Unity-Manual: Unity IAP Purchase Receipt
How to use Unity IAP --SlideShare Unite2016TokyoWS01 - Github Very helpful for implementing Purchaser.cs in this Github repository Now, based on the knowledge gained in 1 and 2, read the source code ** carefully **.
[Android]
Perform receipt verification on the server side with Android item billing
Signature verification of Google Play billing receipt with Golang
For json in the purchase receipt of Unity IAP on Android
The two keys, json
and signature
, are the receipt data sent from Google Play.
Verification of public key and signature defined in Google Developer Console = Verification of receipt.
In Python I used M2Crypto
.
[IOS]
POST to the following URL with receipt-data
as the key and receipt data (the value that can be obtained with the payload key for Unity IAP) as the value.
https://buy.itunes.apple.com/verifyReceipt
If the response is 21007, send it to the sandbox URL again for verification
https://sandbox.itunes.apple.com/verifyReceipt
In Python I used ʻurllib2`.
What I thought about using Unity IAP
We would like to take this opportunity to thank all the people involved in the Unity2016Tokyo conference.
Recommended Posts