Import zarinpal_unity.unitypackage 1.2 to your project.
After importing , click on Zarinpal/Setting menu to setup the plugin. Settings you can change :
Click on "update manifest and files" button to update your manifest and copy required files into your project.
Use method
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.