Skip to content

Commit 6b6d396

Browse files
committed
fix(PaymentField): convert payment amount to pence for payment processing
1 parent 393f3da commit 6b6d396

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/server/plugins/engine/components/PaymentField.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ export class PaymentField extends FormComponent {
142142
const slug = `/${model.basePath}`
143143

144144
// 2. Call paymentService.createPayment()
145+
// GOV.UK Pay expects amount in pence, so multiply pounds by 100
146+
const amountInPence = Math.round(data.amount * 100)
145147
const payment = await paymentService.createPayment(
146-
data.amount,
148+
amountInPence,
147149
data.description,
148150
uuid,
149151
data.reference,

0 commit comments

Comments
 (0)