question

Danielle Cox avatar image
Danielle Cox asked Danielle Cox commented

EXTRA_AMOUNT

It appears from Intents: public static final String EXTRA_AMOUNT = "clover.intent.extra.AMOUNT";

but in my code the acount extras shows: com.clover.intent.extra.AMOUNT

I have: compile 'com.clover.sdk:clover-android-sdk:latest.release'


Any idea why the define is different than what is being sent?

Thanks in advance! Danielle

2 comments
10 |2000

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

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

In your code where? Can you provide a link to the AAR or JAR that you are using?

0 Likes 0 ·
Danielle Cox avatar image Danielle Cox commented ·

I am using clover-sdk-137-sources.jar and in it the variable shows clover. ... however, if I use Log.d and look at the bundle key it is com.clover. ...

This is also backed up by my hard coding using it to "com.clover. ..." but if I inspect the attempt to use Intents.ACTIONPAYMENTPROCESSED it does not include the "com." portion

0 Likes 0 ·

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered Danielle Cox commented

I downloaded clover-sdk-137-sources.jar, and I see this in Intents.java,

  /** {@link Long}, a monetary amount */
  public static final String EXTRA_AMOUNT = "clover.intent.extra.AMOUNT";

That would seem to contradict what you are stating above.

2 comments
10 |2000

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

Danielle Cox avatar image Danielle Cox commented ·

I see that in the jar as well. However when I run my code and I run
Log.d(name, String.format("%s %s (%s)", key, value.toString(), value.getClass().getName()));

The key shows up as "com.clover.intent.extra.amount" and to get the amount out, I have to use Long amount = intent.getExtras().getLong("com.clover.intent.extra.AMOUNT");

This is from an ACTIONPAYMENTPROCESSED intent.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

The docs for ACTION_PAYMENT_PROCESSED do not list EXTRA_AMOUNT as one of the included extras. The com.clover.* value you are seeing is an implementation detail. Be aware that if it's not documented, it's subject to change. If you need the amount, you can use the passed order ID and payment ID in conjunction with OrderConnector to look it up. That being said, I agree it would have been handy included the amount for convenience.

0 Likes 0 ·

Welcome to the
Clover Developer Community