danieleades / monzo-lib

monzo API client library, in pure rust
16 stars 4 forks source link

Add transaction decline reason 'Authentication rejected by cardholder' #51

Closed BreD1810 closed 2 years ago

BreD1810 commented 2 years ago

Before this change, I was getting the following on a transaction:

Error: Serde(Error("unknown variant `AUTHENTICATION_REJECTED_BY_CARDHOLDER`, expected one of `INSUFFICIENT_FUNDS`, `CARD_INACTIVE`, `CARD_BLOCKED`, `INVALID_CVC`, `SCA_NOT_AUTHENTICATED_CARD_NOT_PRESENT`, `STRONG_CUSTOMER_AUTHENTICATION_REQUIRED`, `OTHER`", line: 1, column: 28437))
codecov[bot] commented 2 years ago

Codecov Report

Merging #51 (d2b14a2) into main (018d8ef) will increase coverage by 0.36%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   45.86%   46.22%   +0.36%     
==========================================
  Files          19       19              
  Lines         894      900       +6     
==========================================
+ Hits          410      416       +6     
  Misses        484      484              
Impacted Files Coverage Δ
src/endpoints/transactions.rs 99.46% <100.00%> (+<0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 018d8ef...d2b14a2. Read the comment docs.

danieleades commented 2 years ago

thanks for this. changes look good.

I've been toying with the idea of adding a 'catch-all' enum variant for any unrecognised case, to prevent panicking. The tricky thing there is that there's already an Other case (which the API defines), so that might be slightly confusing.