Skip to content

Commit

Permalink
refactor: record a list of all transaction IDs completed for the call
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrickson-tyler committed Aug 25, 2024
1 parent 9c0b8c9 commit 9eeddba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/lambda/c3-submit-payment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,19 @@ export async function handler(event) {
: response.transaction.bankAccountNumber;
const endingDigits = maskedNumber.slice(-4);

// Update the list of all transaction IDs.
const previousTransactionIds = contactAttributes.TransactionIds
? JSON.parse(contactAttributes.TransactionIds)
: [];
const newTransactionIds = [
...previousTransactionIds,
response.transaction.id,
];

return {
TransactionApproved: response.transactionApproved,
TransactionId: response.transaction.id,
TransactionIds: JSON.stringify(newTransactionIds),
TransactionMeta: response.transactionMeta,
PaymentMethodEndingDigits: endingDigits,
};
Expand Down

0 comments on commit 9eeddba

Please sign in to comment.