summaryrefslogtreecommitdiff
path: root/postgresqleu/transferwise
AgeCommit message (Collapse)Author
9 daysAdd support for auto-booking transferwise cashbackMagnus Hagander
Transferwise re-invented interest and call it cashback (it's the same as interest..), and we already knew how to classify these transactions. So instead of leaving them as pending, automatically book them against a predefined account.
2025-07-02Add django admin view for transferwise payoutsMagnus Hagander
2025-07-02Attempt to make transferwise payouts half-completeMagnus Hagander
Due to the new transferwise restrictions, creating payouts would crash. This change attempts to make it complete the parts that work and leave the rest for a manual approval in the transferwise web interface, hopefully keeping the rest of the system working. When half way complete, send a notification to the user to go complete it manually.
2025-06-16Negate *all* wise transactions based on "Sent by ..." in textMagnus Hagander
Turns out we need to do this both for primary ands secondary amounts (which makes sense). Clarify the comment a bit further after more research that still shows Wise API returns that incoming payments are actually outgoing. Sigh.
2025-06-16Include "balance cashback" as text on transactionsMagnus Hagander
It's just for display and they're easier to identify this way.
2025-06-13Fix accidental reference to old style transferwise APIMagnus Hagander
Clearly missed one field in the update, that was still referencing the old API structure.
2025-06-11New transferwise APIs no longer allow downloading statementsMagnus Hagander
So remove the scheduled job that handles them, as well as the database table that stores them.
2025-06-11Update transferwise integration for new APIsMagnus Hagander
Unfortunately, Wise decided one is no longer allowed to access information about ones own transactions when in Europe, unless registered as a European payment provider. This is of course stupid, but what can we do. Attempt to re-implement the transferwise support over their new activities API. Unfortunately there are likely bugs still hiding around, since for example amounts are now returned in some self-invented html-like markup like '<positive> 2,000 EUR</positive>' instead of as a number like before (and sometimes they are returned as <positive> with a negative number inside). But we have to start somewhere... Unfortunately, it seems there's a permanent loss of funcionality in that the account number (IBAN) of the sender is no longer available anywhere in the API. This means that in practice, automatic refunds of transfers are no longer possible. (This information appears to also no longer be available on their website). We keep the refund functionality itself in the system for now, as we might want to extend it later with the ability to refund while manually specifying an IBAN number.
2025-02-28Write the body of a failed transferwise request to stderrMagnus Hagander
2024-07-30Fix invalid option passingMagnus Hagander
2024-07-30Allow overriding how far back to fetch Wise transactionsMagnus Hagander
2024-03-20Attempt to properly identify wise accounts with wrong primary currencyMagnus Hagander
Our check only worked properly if the primary currency was the one we used, and it seems wise can open a new balance and just chance the primary currency on us, so update the check.
2024-03-14Empty desription can sometimes be 'No information'Magnus Hagander
It seems on some records, wise returns 'No information', and on some it returns '', so explicitly check for both these inthe backoff functionality.
2024-03-12Delay further UNKNOWN transferwise transactionsMagnus Hagander
If we receive a transaction with type UNKNOWN and an empty description, delay processing it for up to 2 hours. It seems some data is simply not available immediately. The 2 hours is a guess on how long, and hopefully a decent mix between working and delay.
2024-03-12Increase transferwise webhook delay from 30 seconds to 5 minutesMagnus Hagander
Apparently it takes longer to get our data sometimes
2023-10-03Handle explicit sender name=NULL from WiseMagnus Hagander
Seemsfor card cashback (unlike account cashback) they explicitly set the sender to null (instead of just leaving it out), so we need to turn that into an empty string before trying to save it into a not null field.
2023-09-18Handle Wise transactinos with NULL as payment referenceMagnus Hagander
We perviously hadnled empty references and missing referenes, but not if they both existed and were NULL.
2023-06-14Exempt wise and stripe webhooks from global authMagnus Hagander
2023-06-14Fix typoMagnus Hagander
2023-05-18Don't crash on transferwise returned payments with no feesMagnus Hagander
2023-02-21Make regexp for BIC codes from Wise more forgivingMagnus Hagander
BIC codes can somehow be 8-11 chars in wise sender records. We still don't care about the BIC code, just the IBAN, so just make the regexp for getting it a bit more forgiving.
2023-02-11Only add accounting row for tw payout fees if there are any feesMagnus Hagander
Preivous code incorrectly assumed there would be at least some fee to the payouts, so it would cause a crash if it was free. Their docs still say it shouldn't be free, but their API disagrees, so make the addition of the fee entry conditional.
2022-08-22Process IBAN numbers from new combined BIC+IBAN transferwise responseMagnus Hagander
Sometimes (newer entries?) transferwise adds both the BIC and the IBAN code, and do so in the same field. This is undocumented and not even incuded in their examples, but seems to be persistent enough to process so we get working account numbers in more cases.
2021-08-01Handle http 400 errors indicating failure to validate iban with wiseMagnus Hagander
2021-04-26Don't crash on transferwise transactions with empty payment referenceMagnus Hagander
This can happen for non-bank transfers. We should just record it and leave it as an entry to deal with manually.
2020-07-13Remove unused importsMagnus Hagander
2020-07-06Add missing fileMagnus Hagander
Missed completely in 03938de8ae7cfac271e01d83457e844fdd3f12d0. Oops.
2020-07-06Implement TransferWise strong customer authenticationMagnus Hagander
This becomes a requirement on Oct 1 to support statement fetching (which we use both to update accounting and to fetch monthly statements) and for funding transfer requests (which we use for refunds and payouts). Initially it's optional and has to be enabled separately in the transferwise account. This method uses a RSA public/secret keypair (stored on the invoice payment method, so this needs to be generated before the requirement can be enabled, and the public part of the key needs to be uploaded) to sign a token when making the request. Note that the actual request itself is not signed, only the login. Fixes #56, though the funding is not fully tested yet due to the sandbox not containing all functionality and no payments being queued up in production.
2020-04-07Make sure name in TW sending has at least two partsMagnus Hagander
Apparently it's forbidden to create recipients with only one name, there has to be at least two parts separated by a space (but can be more than two parts). If this happens, just duplicate the name with a space in between, as the name of the recipient is actually completely irrelevent.
2020-04-01Specify on_delete for all ForeignKey and OneToOneFieldsMagnus Hagander
This was already done once in 8289e05cd but had not been properly maintained.
2020-03-31Create abstraction for getting "today"Magnus Hagander
This will work differently for conferences and non-conferences once we add proper timezone support, so abstract it out into a separate couple of functions. For now they both return the same thing, but this will change in a later commit. In passing, fix missing datetime.now() -> timezone.now() conversions.
2020-03-29Remove date parameter to create_accounting_entryMagnus Hagander
This should always be set to todays date, so set it in the function instaed. This changes the behaviour of the paypal plugin to actually use todays date rather than a date parsed out from the notification. In theory this could change the accounting entry date in case the notification is so delayed it ends up on a different day, but either one could be argued to be equally correct in this case, and using the date of creation of the transaction makes tracking things a lot easier. While at it, clean up some imports that have been missed earlier.
2020-03-24Disallow commas in transferwise counterpart namesMagnus Hagander
It seems there are more combinations in names that are OK to receive from but not OK to send to... Since the name isn't compared to anything, just replace the comma with a space. (This is similar to 954fb04c4 which disallowed digits)
2020-03-12Replace datetime.now() with timezone.now()Magnus Hagander
As a step on the way to better timezone support, use the django function timezone.now() instead of datetime.now(). As long as we haven't enabled timezones globally this becomes a no-op and does exactly what it did before, but once timezones are enabled it will generate datetimes that are aware of this. No functionality change but gets a lot of boiler-plate out of the way making the verification of the rest of the timezone work easier.
2020-03-11Fix wrong sign on fee of refund as wellMagnus Hagander
2020-03-11Fix reversed sign on tw refundsMagnus Hagander
2020-01-08Style and minor fixes pointed out by newer version of pep8Magnus Hagander
2019-09-06Remove silly variable reassignment-to-selfMagnus Hagander
2019-09-06Add function to send TransferWise monthly statements to treasurerMagnus Hagander
TransferWise doesn't send statements automatically, and downloading them is limited by the single-user-per-account-system. But since their API allows downloading of a PDF statement between arbitrary dates, use that to download the statements once per month and email them as an attachment. The function is optional and turned on/off on a per-paymentmethod basis.
2019-09-06Blacklist strange cases of bank accounts on other endMagnus Hagander
It appears some banks can actually pass along an accountnumber being Unknownbankaccount, which will then (of course) fail to validate.
2019-09-06Limit TW payment references to 200 charactersMagnus Hagander
It really makes no sense beyond that, so just limit it when loading to make sure the system doesn't crash. If the sender can't manage to get the important parts into the first 200 characters, it will just have to be handled manually.
2019-07-09Remove TREASURER_EMAIL references from code, leaving in templatesMagnus Hagander
TREASURER_EMAIL is supposed to be used in templates, but actively by the code, but usage in the wrong way had snuck in. Remove that, and to deal with that add a field to TransferWise configuration for notification_receiver. While at it, put a comment in the config file explaining what it's for.
2019-06-28Don't send email when no actual payout has been triggeredMagnus Hagander
2019-06-28Add explicit validation of payout amounts vs transaction listMagnus Hagander
2019-06-28Properly account for fee amount in bank matcherMagnus Hagander
2019-06-28Fix sign reversal in accounting entryMagnus Hagander
2019-06-28Fix another missing import in another moduleMagnus Hagander
2019-06-28Add another missing importMagnus Hagander
2019-06-28Add missing importMagnus Hagander
2019-06-28Fix incorrectly copy/pasted syntax for accessing payment configMagnus Hagander