sumup / sumup-android-sdk

Sample App for the SumUp Android SDK
Other
100 stars 28 forks source link

After a successful transaction, TransactionInfo is null #195

Open a5k-x opened 1 year ago

a5k-x commented 1 year ago

After a successful transaction, the intent TransactionInfo is null

`... if (data != null && resultCode == SumUpAPI.Response.ResultCode.SUCCESSFUL) {

TransactionInfo transactionInfo = data.getParcelableExtra(SumUpAPI.Response.TX_INFO); ...}`

In what cases can a payment be successfully completed, but payment data is not received? This does not happen often, maybe in this case it is worth adding a similar method to the android sdk as /checkouts/:id

jnorkus commented 1 year ago

I am seeing a similar issue but in my case the whole bundle returned by getExtras() is null. Sometimes the transaction is successful, sometimes failed, sometimes it's not even created in the backend at all.

towsif-hossain commented 10 months ago

Facing similar issue, bundle extras is null but the payment actually went through successfully when I cross checked on SumUp Dashboard.

LocaFoxNick commented 7 months ago

Any feedback on this? @zaid-abdullah ? (Sorry, didn't know who else's attention to reach for)

This issue has occurred three times in 8 days (that I know of) for one user,

The device model is: SM-X200 The android version is: 33 The SumUp SDK version is: 4.0.3 Target SDK is: 31

I'm in the process of obtaining the SumUp device nad model number, and the firmware version to - I'll provide these when I get them

I can provide additional information in private, such as the transaction date/time and the transaction id if it helps.

Our logs indicate that extras.getString(SumUpAPI.Response.MESSAGE) was "Transaction successful."

but

int resultCode = extras.getInt(SumUpAPI.Response.RESULT_CODE);
TransactionInfo info = (TransactionInfo) extras.get(SumUpAPI.Response.TX_INFO);
String msg = extras.getString(SumUpAPI.Response.MESSAGE);

if (resultCode == SumUpAPI.Response.ResultCode.SUCCESSFUL && info != null) {
   // not hit
} else if (resultCode == SumUpAPI.Response.ResultCode.ERROR_INVALID_TOKEN) {
   // not hit
} else if (resultCode == SumUpAPI.Response.ResultCode.ERROR_NOT_LOGGED_IN) {
    // not hit
} else if (resultCode == SumUpAPI.Response.ResultCode.ERROR_NO_CONNECTIVITY && transaction != null) {
    // not hit
} else if (resultCode == SumUpAPI.Response.ResultCode.ERROR_TRANSACTION_FAILED && (msg == null || !msg.equalsIgnoreCase(TRANSACTION_FAILED_RESPONSE_MSG)) && transaction != null) {
   // not hit
}
else {
     // Hit - failure
}
okirmis commented 2 months ago

Just to contribute to the discussion: we are facing a similar issue. Not a great situation at all for a payment service.

LocaFoxNick commented 2 months ago

Hi @okirmis , we've been in contact with SumUp about this. They've acknowledged that this is a issue, though the proposed solution is that when we lack the transaction info on success, we should use the SumUp API to obtain the information. It became apparent throughout the emails that using the SumUp API rather than the BT SDK is the way forward, and this also seems to be what other providers are doing aswell