From 18fdbb66b1747dd35a3f65463c831536a2cca04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Mon, 9 Dec 2024 14:50:53 +0000 Subject: [PATCH] chore: Remove redundant `getPayNode()` function --- src/requests/payment-request.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/requests/payment-request.ts b/src/requests/payment-request.ts index e74c04b7..b1f20865 100644 --- a/src/requests/payment-request.ts +++ b/src/requests/payment-request.ts @@ -102,7 +102,7 @@ export async function createPaymentRequest( console.error(`Unable to generate fee breakdown for session ${sessionId}`); } - const paymentAmountPounds = await getPaymentAmount(payNode, session); + const paymentAmountPounds = await getPaymentAmount(session); if (!paymentAmountPounds) throw new Error("Payment amount not found in passport"); @@ -225,19 +225,11 @@ async function getPayNode( /** * Find the payment amount from the the passport */ -async function getPaymentAmount( - payNode: PayNode, - session: Session, -): Promise { - const amountKey = getPaymentAmountKey(payNode); +async function getPaymentAmount(session: Session): Promise { + const amountKey = "application.fee.payable"; return new Passport(session.data.passport).number([amountKey]); } -function getPaymentAmountKey(payNode: PayNode) { - const defaultPaymentKey = "application.fee.payable"; - return payNode.data.fn || defaultPaymentKey; -} - export async function _markPaymentRequestAsPaid( client: GraphQLClient, paymentRequestId: string,