public class PurchaseHandler : ICheckoutPurchase
{
public void OnInitialized()
{
// Initialization was successful. You can now call GetPricePoints().
Debug.Log("Initialization successful.");
}
public void OnInitializeFailed(ErrorMessage error)
{
Debug.Log(string.Format("Code: {0}\nMessage: {1}\nDetails: {2}", error.code, error.message, error.data));
}
public void OnPricePointsSuccess(PricePointsModel pricePoints)
{
// You can now display the localized pricing in the webstore.
Debug.Log(string.Format("Total Found: {0}", pricePoints.pricingPoints.Length));
}
public void OnPricePointsFail(ErrorMessage error)
{
Debug.Log(string.Format("Code: {0}\nMessage: {1}\nDetails: {2}", error.code, error.message, error.data));
}
public void OnPurchaseSuccess(OrderResponseModel order)
{
// Purchase was successful.
Debug.Log(string.Format("Purchase Success:\nOrderId: {0}\nPayment Method: {1}", order.orderId, order.paymentMethodName));
}
public void OnPurchaseFailed(ErrorMessage error)
{
Debug.Log(string.Format("Code: {0}\nMessage: {1}\nDetails: {2}", error.code, error.message, error.data));
}
}