question

cdcilley avatar image
cdcilley asked ·

Trying to get remote-pay-android-example-pos application working with Dev CloverGo

I've cloned the GitHub project remote-pay-android-go. It contains a sample application remote-pay-android-example-pos. When I first installed it on my tablet, I would select the "Clover Go" radio button and hit "Demo Mode". It would crash. NullPointerException.

Upon digging I found there are a bunch of values that need to be set in the setGoParams() method in StartupActivity.java. I'm guessing not having them set caused the null pointer. Here's the method...

  private void setGoParams() {
    /**
     * These should be provided to you.
     */
    mGoApiKey = "<put your key here>";
    mGoSecret = "<put your secret here>";

    /**
     * App ID found in developer portal app settings.
     * App secret found in developer portal app settings.
     */
    mOAuthClientId = "<put your Client ID here>";
    mOAuthClientSecret = "<put your secret here>";

    /**
     * Update the URLs accordingly based on the environment you want to point to
     * e.g. sandbox.dev.clover.com or www.clover.com
     */
    mOAuthEnv = "www.clover.com";
    mOAuthUrl = "https://clover.com/oauth/authorize?client_id=" + mOAuthClientId + "&response_type=code";
    mOAuthTokenUrl = "https://clover.com/oauth/authorize?client_id=" + mOAuthClientId + "&response_type=token";

    /**
     * This is used for demo purposes. You can generate an access token and hardcode it here so
     * that you can use the same access token repeatedly.
     */
    mGoAccessToken = "<put your token here>";


    /**
     * This is not required and is intended for demo purposes only. Each client needs to have their
     * own implementation of getting the access token using the code generated by Clover.
     */
    mOAuthApiKey = "<put your key here>";
  }

I'm pretty sure I have tracked them all down in my developer account, except for the first two - mGoApiKey and mGoSecret. The comment says "These should be provided to you."

Provided where or by whom?
DevKitClover Go
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

cdcilley avatar image
cdcilley answered ·
Actually, the issue was a programming error which caused the Example POS activity to crash - a call to get a Fragment returned null. I fixed it in my code and alerted the developers to the issue and the fix.

Once I got the app fixed and running, the keys are needed to actually connect the Dev Clover Go to the app.
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

fredrueda avatar image
fredrueda answered ·
yo have the similar cuestion
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Greg avatar image
Greg answered ·
Those keys will be provided by @kedar.deo or @varsha.a from the Go team for each client.
2 comments Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I've been cooking along while waiting to hear from @kedar.deo or @varsha.a.

Upon closer inspection, I see there is another variable, mGoAccessToken, for which there is cryptic information. The comments says:

This is used for demo purposes. You can generate an access token and hardcode it here so that you can use the same access token repeatedly.

I've been digging around in the Example code and find that mGoAccessToken is used in the com.clover.remote.client.clovergo.CloverGoDeviceConfiguration.Builder.

I can get the OAuth 2.0 token connection my application and a merchant, but it's not clear how to get this "Go" access token.

0 Likes 0 · ·

This isn't actually the correct answer.

0 Likes 0 · ·

Welcome to the
Clover Developer Community