Accessing android library function using unity

So I have this .jar file, which will call a UI window that have in App payment function for Android.

Inside .jar file, it has Two Static functions that I need to call. One is going to call the activities using Intent which initiate the variables, creating the layout and the other will be calling the UI Window that has the function.

I have already put the jar file inside the assets/android/plugins folder and in Unity Script, I write the code like this:

    // Use this for initialization
    void Start () {
        AndroidJNI.AttachCurrentThread();

        using (AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
            using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity")) {
                AndroidJavaClass cls_MainActivity = new AndroidJavaClass ("com.test.user.MainActivity");
                cls_MainActivity.CallStatic ("InitFunction", obj_Activity, "LAKDJFADF", "ZCVZCXV");
                cls_MainActivity.CallStatic ("BuyItem", "Horray", "100", "10");
   }
}
        }

When I build and run it on android device, it results in nothing. Please help

Where did you define your static methods ?

From the code you attached, you’re trying to invoke static methods on your game’s main activity.
Did you override the game’s main activity with your own, and define those static methods there? If not, this will not work.

Instead, you should be creating a new AndroidJavaClass with the full name of the class that declares those methods, and then CallStatic on that.