question

robsmitha avatar image
robsmitha asked robsmitha commented

How to pull the EXTRA_CREDIT value onActivityResult from the ACTION_MANUAL_REFUND intent?

We are using the ACTION_MANUAL_REFUND intent in our fully integrated app to start the manual refund activity.
Intent intent = new Intent(Intents.ACTION_MANUAL_REFUND);
startActivityForResult(intent, REQUEST_CODE_MANUALREFUND);
In the OnActivityResult method we are getting null when trying to pull out the EXTRA_CREDIT data from the intent. I've tried various methods to pull out this extra but they all come back null.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if(requestCode == REQUEST_CODE_MANUALREFUND) {
        try{
            GenericParcelable parcelableCredit = data.getParcelableExtra(Intents.EXTRA_CREDIT);
            String stringCredit = data.getStringExtra(Intents.EXTRA_CREDIT);
            Bundle bundleCredit = data.getBundleExtra(Intents.EXTRA_CREDIT);
            Serializable serializableCredit = data.getSerializableExtra(Intents.EXTRA_CREDIT);
            Credit credit = data.getParcelableExtra(Intents.EXTRA_CREDIT);
            //credit is null
            Log.d(TAG, "onActivityResult: " + credit);
        }
        catch (Exception e){
            e.printStackTrace();
        }
    }
}

Please let me know what I can do to get the EXTRA_CREDIT data in this scenario.

Thanks.
Refund
4 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.

robsmitha avatar image robsmitha commented ·

Anyone have insight they can share on this question?

0 Likes 0 ·
robsmitha avatar image robsmitha commented ·

Anyone have insight they can share on this question?
Credit credit = data.getParcelableExtra(Intents.EXTRA_CREDIT); comes back as null

resultCode is -1.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ robsmitha commented ·

I just tried your exact code and credit was correctly populated. I am not sure what would cause this if the resultCode is -1.

0 Likes 0 ·
robsmitha avatar image robsmitha David Marginian ♦♦ commented ·

Thanks for giving that a try, I think we're gonna use the ACTION_START_ORDER_MANAGE intent instead.

0 Likes 0 ·

1 Answer

David Marginian avatar image
David Marginian Deactivated answered robsmitha edited
intent.getParcelableExtra(Intents.EXTRA_CREDIT);
The above is what you are looking for. What is the resultCode?
1 comment
10 |2000

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

robsmitha avatar image robsmitha commented ·

Thanks @David Marginian.

resultCode is -1.

0 Likes 0 ·

Welcome to the
Clover Developer Community