- Add support iOS platform : you can now make purchasing on iOS Devices version 8 or higher.
- Fix error when copying android manifest to plugins folder in Mac OS.
- Fix a few bugs
After importing , click on Zarinpal/Setting menu to setup the plugin. Settings you can change :
- MercantID : Set your MerchantID that you get from zarinpal.
- Auto Verify : If you want to verify pucrahse in client automatically , then select this option.
- Scheme/Host : Choose a unique scheme and host. for example : if you set "gt-club" as scheme and "zarinpal_result" as host , Then zarinpal uses "gt-club://zarinpal_result" uri to return the purchase result to your unity game.
Zarinpal.Initialize()at the start of your game to makes zarinpal initialized. Please note to call it once. You can take a look at zarinpal example scene and scripts to see how to use the plugin in your code.. Use
Zarinpal.Purchase(int amount,string productID , string desc)to make a purchase . Use Callback to be aware when a purchase is succeed or failed For example subscribe to event Zarinpal.PurchaseSucceed using this line of code :
Zarinpal.PurchaseSucceed+=(string productID,string authority)=>
{
Debug.Log("purchase succeed with authority : "+authority);
}
On Android : If you wish to change the way Zarinpal activity work or applying your style to the activity , you can go and do it here : https://github.com/mujpir/UnityZarinpalPurchaseAndroidStudio After customizing android part of the plugin , then come back here and change the c# code in unity to make plugin works with the way you have changed.
Happy making games.
Mojtaba Pirveisi Game developer at Darbache Studio.