Skip to content
Snippets Groups Projects
Unverified Commit 363c9e4a authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

:bug: (gocardless) fix sync when additionalInformation field is null (#2238)

parent e745a407
No related branches found
No related tags found
No related merge requests found
...@@ -309,14 +309,15 @@ async function normalizeGoCardlessTransactions(transactions, acctId) { ...@@ -309,14 +309,15 @@ async function normalizeGoCardlessTransactions(transactions, acctId) {
// that it matters whether the amount is a positive or negative zero. // that it matters whether the amount is a positive or negative zero.
if (trans.amount > 0 || Object.is(Number(trans.amount), 0)) { if (trans.amount > 0 || Object.is(Number(trans.amount), 0)) {
const nameParts = []; const nameParts = [];
nameParts.push( const name =
title( trans.debtorName ||
trans.debtorName || trans.remittanceInformationUnstructured ||
trans.remittanceInformationUnstructured || (trans.remittanceInformationUnstructuredArray || []).join(', ') ||
(trans.remittanceInformationUnstructuredArray || []).join(', ') || trans.additionalInformation;
trans.additionalInformation,
), if (name) {
); nameParts.push(title(name));
}
if (trans.debtorAccount && trans.debtorAccount.iban) { if (trans.debtorAccount && trans.debtorAccount.iban) {
nameParts.push( nameParts.push(
'(' + '(' +
...@@ -329,14 +330,15 @@ async function normalizeGoCardlessTransactions(transactions, acctId) { ...@@ -329,14 +330,15 @@ async function normalizeGoCardlessTransactions(transactions, acctId) {
payee_name = nameParts.join(' '); payee_name = nameParts.join(' ');
} else { } else {
const nameParts = []; const nameParts = [];
nameParts.push( const name =
title( trans.creditorName ||
trans.creditorName || trans.remittanceInformationUnstructured ||
trans.remittanceInformationUnstructured || (trans.remittanceInformationUnstructuredArray || []).join(', ') ||
(trans.remittanceInformationUnstructuredArray || []).join(', ') || trans.additionalInformation;
trans.additionalInformation,
), if (name) {
); nameParts.push(title(name));
}
if (trans.creditorAccount && trans.creditorAccount.iban) { if (trans.creditorAccount && trans.creditorAccount.iban) {
nameParts.push( nameParts.push(
'(' + '(' +
......
---
category: Bugfix
authors: [MatissJanis]
---
GoCardless: fix sync not working if `additionalInformation` fallback field is null
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment