question

saru-fivestars avatar image
saru-fivestars asked saru-fivestars answered

clover app crashes in refund flow.

We are encountering an issue where the clover transaction app will crash during refund flow


So far this only occurs in the staging platform on version 1.0-246 of the transaction app.

To be clear.

Clover 2018 - staging crashes- the version of the transaction app is 1.0-246
Clover 2018 - Production is OK - the version of the transaction app is 1.0-244

Clover mini - staging crashes- the version of the transaction app is 1.0-246
Clover mini - Production is OK - the version of the transaction app is 1.0-244

Clover Solo - staging is OK. the version of the transaction app is 1.0-246
Clover PRO - Staging is OK - the version of the transaction app is 1.0-246

error :

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2222, result=-1, data=Intent { (has extras) }} to activity {com.clover.transactions/com.clover.transactions.LegacyTransactionDetailActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘long java.lang.Long.longValue()’ on a null object reference

Happy to provide more logs as this is happing on staging dev units and we have access via ADB.

FYI. this is similar to an issue we had with the payments app crashing with the same error.

Ideally, we DONT want build 246 to be pushed to production 018 as it will break the entire install base.





Clover Station 2018
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated edited

Can you provide steps to reproduce this? Are you launching the transactions app via Intent (if so, can you provide details) or opening it manually on the device? If launching via intent, can you reproduce the issue if you manually launch the transactions app?

10 |2000

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

saru-fivestars avatar image
saru-fivestars answered saru-fivestars edited

yes, we use intent..

<intent-filter>
    <action android:name="clover.intent.action.REFUND" />

    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>


To be clear it's the refund section of the app that crashes.


To complete the refund we use:


val data = Intent().apply {
    putExtra(Intents.EXTRA_ORDER_ID, orderId)
    putExtra(Intents.EXTRA_PAYMENT_ID, paymentId)
    putExtra(Intents.EXTRA_LINE_ITEM_IDS, lineItemIds)
    putExtra(Intents.EXTRA_AMOUNT, amount)
    putExtra(Intents.EXTRA_CLIENT_ID, clientId)
}

setResult(AppCompatActivity.RESULT_OK, data)
finish()


To replicate, it's as per this video.

https://www.dropbox.com/s/1lgll0w6tcbvfri/non%20ECI%20on%20mini.MOV?dl=0


5 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.

David Marginian avatar image David Marginian ♦♦ commented ·

Ok, in the future please include this level of detail in your original post. Have you tried ACTION_REFUND per our documentation - https://clover.github.io/clover-android-sdk/com/clover/sdk/v1/Intents.html? Are you certain the values you are passing to the intent are valid?

0 Likes 0 ·
saru-fivestars avatar image saru-fivestars David Marginian ♦♦ commented ·
the dev team is checking.. not sure how this would explain the issue being on individual devices on specific versions of the transaction app.
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ saru-fivestars commented ·

It appears your merchant is set to use the legacy activity via configuration. However, the legacy activity should not be crashing and I am filing a bug for that. Please double-check your inputs to the intent as it appears you may be passing in an invalid value.

0 Likes 0 ·
Show more comments
saru-fivestars avatar image
saru-fivestars answered

more crash information Part 1.


2021-08-11 23:12:41.620 7086-7086/? D/RefundActivity: completeRefund() orderId: 36VWHHMSTJY2Y paymentId: PT4PHFDDM6PH2, lineItems: [] amount: 400, clientId: aa0847658b674be18a206891456dde6d


------------------------------------------------------


2021-08-11 23:12:41.722 6716-6716/? E/AndroidRuntime: FATAL EXCEPTION: main

Process: com.clover.transactions, PID: 6716

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2222, result=-1, data=Intent { (has extras) }} to activity {com.clover.transactions/com.clover.transactions.LegacyTransactionDetailActi$

at android.app.ActivityThread.deliverResults(ActivityThread.java:4090)

at android.app.ActivityThread.handleSendResult(ActivityThread.java:4133)

at android.app.ActivityThread.-wrap20(ActivityThread.java)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1534)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:154)

at android.app.ActivityThread.main(ActivityThread.java:6121)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)

10 |2000

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

saru-fivestars avatar image
saru-fivestars answered

more information part 2

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘long java.lang.Long.longValue()’ on a null object reference

at com.clover.transactions.LegacyTransactionDetailActivity.constructAndIssueRefund(LegacyTransactionDetailActivity.java:3209)

at com.clover.transactions.LegacyTransactionDetailActivity.onActivityResult(LegacyTransactionDetailActivity.java:676)

at android.app.Activity.dispatchActivityResult(Activity.java:6986)

at android.app.ActivityThread.deliverResults(ActivityThread.java:4086)

at android.app.ActivityThread.handleSendResult(ActivityThread.java:4133)

at android.app.ActivityThread.-wrap20(ActivityThread.java)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1534)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:154)

at android.app.ActivityThread.main(ActivityThread.java:6121)

at java.lang.reflect.Method.invoke(Native Method)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)


10 |2000

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

saru-fivestars avatar image
saru-fivestars answered

Also, we tried switching the device to a different merchant in the same developer's account, just in case, this "merchant" was as you said set to legacy in the configuration. The new CUID is (same as the solo you configured a few weeks ago.) but the crash happens in this merchant as well.

AH030R5J8NX81


Could it be an issue with every merchant in our sandbox account and so not happening on production devices?

10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated edited

We have the crash data thank you. I have created an issue for the payments team. But I think this won't be a problem in production because NA merchants will default to the new (non legacy activity).

10 |2000

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

saru-fivestars avatar image
saru-fivestars answered

Also, to replicate, these are the arguments we are passing:


2021-08-11 23:12:41.620 7086-7086/? D/RefundActivity: completeRefund() orderId: 36VWHHMSTJY2Y paymentId: PT4PHFDDM6PH2, lineItems: [] amount: 400, clientId: aa0847658b674be18a206891456dde6d

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community