Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purchase not working for God of Blades #21

Closed
Stories8106 opened this issue Jan 23, 2020 · 8 comments
Closed

Purchase not working for God of Blades #21

Stories8106 opened this issue Jan 23, 2020 · 8 comments

Comments

@Stories8106
Copy link
Contributor

In game purchase prompt indicates purchase was made, but doesn't actually complete the purchase in games. On cweiske's server.

@cweiske
Copy link
Member

cweiske commented Jan 23, 2020

Actively buying games will never work on my server because mine only has static (unchanging) responses to API requests. Responses to purchase requests needs to contain some data item of the request, and this is not possible statically.

Instead of needing an active purchase process, the game should start up, check if it has been bought on the server and see that is has been.

Some games have a "sync purchases" button. Maybe God of Blades has one, too.

@Stories8106
Copy link
Contributor Author

Stories8106 commented Jan 23, 2020 via email

@cweiske
Copy link
Member

cweiske commented Jan 23, 2020

"check if it has been bought" does also work for in-app purchases. The game requests a list of "receipts" from the server and then looks which features have been bought and unlocks them.

@Stories8106
Copy link
Contributor Author

Stories8106 commented Jan 23, 2020 via email

@cweiske
Copy link
Member

cweiske commented Jan 24, 2020

Correct.

I looked at the source of the game, and unlike others it only fetches the receipts when it gets a "android account changed" notification:

public class GodOfBlades extends Activity implements InputManager.InputDeviceListener {
    private BroadcastReceiver mAuthChangeReceiver = new BroadcastReceiver() {
        public void onReceive(Context context, Intent intent) {
            TestOuyaFacade test = IOuyaActivity.GetTestOuyaFacade();
            if (test != null) {
                test.requestReceipts();
            }
        }
    };

    public void onStart() {
        super.onStart();
        IntentFilter accountsChangedFilter = new IntentFilter();
        accountsChangedFilter.addAction("android.accounts.LOGIN_ACCOUNTS_CHANGED");
        registerReceiver(this.mAuthChangeReceiver, accountsChangedFilter);
    }
}

I currently do not know how to trigger this event.

@cweiske
Copy link
Member

cweiske commented Jan 25, 2020

I built a dynamic purchase handler on my server, but the game does still not unlock - but also gives no more debug messages.

@cweiske
Copy link
Member

cweiske commented Jan 25, 2020

I've done all I could, but I don't know why it does not unlock. Closing this for now.

@cweiske cweiske closed this as completed Jan 25, 2020
@cweiske
Copy link
Member

cweiske commented Jan 26, 2020

Found it! The purchase response must be encrypted twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants