mitodl / mitxonline

BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Transaction was not successful. Transaction ID: Reason Code:104 Message:Duplicate detected: tra... #1092

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 2 years ago

I don't have the exact steps to reproduce, but this happened after I had started an order, gotten onto a Cybersource form, and then clicked the cancel button.

After I did that, I wasn't able to start the order over again.

Sentry Issue: MITXONLINE-2DD

Transaction was not successful. Transaction ID:  Reason Code:104  Message:Duplicate detected: transaction may have already been processed.
rachellougee commented 2 years ago

@jkachel Will your PR fix this issue when canceling an order on CyberSource form?

jkachel commented 2 years ago

@jkachel Will your PR fix this issue when canceling an order on CyberSource form?

1095 does not address this, no. The fix for that will be in a separate PR.

rachellougee commented 2 years ago

I can't reproduce this on my local. I was able to cancel the order on Cybersource form, and I got 'payment was cancelled' banner message after that. I can start the order again

jkachel commented 2 years ago

I haven't been able to reproduce this either - locally, on RC, or on production. I've tried (mostly on RC) a bunch of different combinations of having the cart open in several tabs, directly going to the checkout interstitial page with the cart open in another tab, cancelling in different points, etc. That said, it looks like CyberSource doesn't include an order number identifier in the payload when that particular error occurs (there should be a req_reference_number, which there isn't) so I'm not sure we're getting an actual order back when the MITxOnline API processes the result, which may be why continuing on fails. Will look into that.

asadali145 commented 2 years ago

I believe I am the one responsible for some of the errors on sentry. I don't know about the exact steps for this. But what I found out was that when you place an order Cybersource uses the order reference number(that we send) to authenticate the session. This error is returned when we send the same order reference within 15m to Cybersource.

This might be another one due to the caching of /checkout/to_payment/. Caching is removed for the mentioned URL under https://github.com/mitodl/mitxonline/pull/1132. So, I don't think this is reproducible anymore.

One flow that I can think of is:

pdpinch commented 1 year ago

I reviewed the last two weeks of this error, and according to log there were just two causes:

Reason Code:102 Message:Unrecognized country code: 'C2' in bill_country seems like a user error. I don't think we need to do anything else.

Message:Duplicate detected: transaction may have already been processed. If it really is a duplicate, I think we are doing the right thing by logging and otherwise not doing anything else.

I'm going to close this issue for now. If we see the error again, I'll consider reopening it.