bunqCommunity / bunqDesktop

The unofficial, free and open source desktop application for the bunq API
https://bunqdesk.top
MIT License
272 stars 53 forks source link

card refunds are shown as negative value #533

Closed smrqdt closed 4 years ago

smrqdt commented 4 years ago

Bug report

found in 0.9.8 AppImage, confirmed in nightly

Card payment refunds are shown as negative number. As they are credit bookings they should be positive. The colour is somehow correct.

Screenshots: Screenshot from 2019-07-20 17-17-24

Screenshot from 2019-07-20 17-32-47

I have a second card refund which shows the same fault.

firstred commented 4 years ago

If we can figure out under which conditions we can treat the transaction as a normal "funds received" action, then it should be possible to fix this issue. There are transactions where the entire amount is treated as a Mastercard action with the type CLEARING_REFUND and still a negative value: Screenshot from 2020-02-03 18-00-12

Here's the anonymized response which belongs to the screenshot above:

{
  "Response": [
    {
      "MasterCardAction": {
        "id": 1234,
        "created": "2020-01-01 00:00:00.000000",
        "updated": "2020-01-01 00:00:00.000000",
        "monetary_account_id": 1234,
        "card_id": 1234,
        "card_authorisation_id_response": null,
        "amount_local": {"currency": "EUR", "value": "79.95"},
        "amount_converted": {"currency": "EUR", "value": "79.95"},
        "amount_billing": {"currency": "EUR", "value": "79.95"},
        "amount_original_local": {"currency": "EUR", "value": "79.95"},
        "amount_original_billing": {"currency": "EUR", "value": "79.95"},
        "amount_fee": {"currency": "EUR", "value": "0.00"},
        "decision": "ALLOWED",
        "payment_status": "CREDIT_TRANSFER",
        "decision_description": "",
        "decision_description_translated": "",
        "description": "Bol.com Utrecht, 000\n",
        "authorisation_status": "CLEARING_REFUND",
        "authorisation_type": "CLEARING_REFUND",
        "settlement_status": "SETTLED",
        "clearing_status": "FIRST_PRESENTMENT_COMPLETE",
        "maturity_date": "2020-02-01",
        "city": "Utrecht",
        "alias": {},
        "counterparty_alias": {},
        "label_card": {},
        "token_status": null,
        "reservation_expiry_time": null,
        "clearing_expiry_time": null,
        "allow_chat": false,
        "pan_entry_mode_user": "UNSAFE_MAGNETIC_STRIPE",
        "secure_code_id": null,
        "wallet_provider_id": null,
        "request_reference_split_the_bill": [],
        "applied_limit": "CARD_LIMIT_POS_ICC"
      }
    }
  ]
}
firstred commented 4 years ago

This is a response of a transaction that has been entirely refunded, but the original amount is shown as 0.00 in bunqDesktop:

{
  "MasterCardAction": {
    "id": 12345678,
    "created": "2020-01-01 00:00:00.000000",
    "updated": "2020-01-01 00:00:00.000000",
    "monetary_account_id": 123456,
    "card_id": 123456,
    "card_authorisation_id_response": "123456",
    "amount_local": {"currency": "EUR", "value": "0.00"},
    "amount_converted": {"currency": "EUR", "value": "0.00"},
    "amount_billing": {"currency": "EUR", "value": "0.00"},
    "amount_original_local": {"currency": "EUR", "value": "13.95"},
    "amount_original_billing": {"currency": "EUR", "value": "13.95"},
    "amount_fee": {"currency": "EUR", "value": "0.00"},
    "decision": "ALLOWED_REVERSED",
    "payment_status": "PAYMENT_REVERSAL_SUCCESSFUL",
    "decision_description": "Transaction canceled.",
    "decision_description_translated": "Transaction canceled.",
    "description": "UBER   * PENDING 123-123-1234, NL\n",
    "authorisation_status": "REVERSED",
    "authorisation_type": "NORMAL_AUTHORISATION",
    "settlement_status": "OPEN",
    "clearing_status": "PENDING",
    "maturity_date": "2020-02-01",
    "city": "123-123-1234",
    "alias": {},
    "counterparty_alias": {},
    "label_card": {},
    "token_status": null,
    "reservation_expiry_time": null,
    "clearing_expiry_time": "2020-02-01 00:00:00.000000",
    "allow_chat": false,
    "pan_entry_mode_user": "E_COMMERCE",
    "secure_code_id": null,
    "wallet_provider_id": null,
    "request_reference_split_the_bill": [],
    "applied_limit": "CARD_LIMIT_POS_ICC"
  }
}