Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- BPay handling to NSW GovPay provider

## [10.1.2] - 2026-05-07

### Added
Expand Down
50 changes: 46 additions & 4 deletions src/apps/services/payment-providers/NSWGovPayPaymentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import {
} from './receipt-items'
import { localisationService } from '../..'

class NSWGovPayPaymentProvider
implements PaymentProvider<SubmissionEventTypes.NSWGovPaySubmissionEvent>
{
class NSWGovPayPaymentProvider implements PaymentProvider<SubmissionEventTypes.NSWGovPaySubmissionEvent> {
constructor(
paymentSubmissionEvent: SubmissionEventTypes.NSWGovPaySubmissionEvent,
formSubmissionResult: FormSubmissionResult,
Expand Down Expand Up @@ -66,6 +64,9 @@ class NSWGovPayPaymentProvider
bankReference,
paymentMethod,
cardLast4Digits,
bPayBillerCode,
bPayCrn,
bPayProcessingDate,
amount,
surcharge,
surchargeGst,
Expand All @@ -77,6 +78,9 @@ class NSWGovPayPaymentProvider
completionReference?: string
bankReference?: string
paymentMethod?: string
bPayBillerCode?: string
bPayCrn?: string
bPayProcessingDate?: string
cardLast4Digits?: string
amount?: string
surcharge?: string
Expand Down Expand Up @@ -133,6 +137,30 @@ class NSWGovPayPaymentProvider
generateCreditCardMaskReceiptItem(
cardLast4Digits ? `xxxx xxxx xxxx ${cardLast4Digits}` : null,
),
generateReceiptItem({
className: 'ob-payment-receipt__bpay-biller-code',
valueClassName: 'cypress-payment-receipt-bpay-biller-code',
icon: 'account_balance',
label: 'BPay Biller Code',
value: bPayBillerCode,
allowCopyToClipboard: true,
}),
generateReceiptItem({
className: 'ob-payment-receipt__bpay-crn',
valueClassName: 'cypress-payment-receipt-bpay-crn',
icon: 'account_balance',
label: 'BPay Reference',
value: bPayCrn,
allowCopyToClipboard: true,
}),
generateReceiptItem({
className: 'ob-payment-receipt__bpay-processing-date',
valueClassName: 'cypress-payment-receipt-bpay-processing-date',
icon: 'account_balance',
label: 'BPay Processing Date',
value: formatBPayProcessingDate(bPayProcessingDate),
allowCopyToClipboard: false,
}),
generateAmountReceiptItem(
typeof amount === 'string' ? parseFloat(amount) : undefined,
),
Expand Down Expand Up @@ -185,11 +213,25 @@ function getPaymentMethodLabel(paymentMethod: string | undefined) {
case 'PAYPAL': {
return 'PayPal'
}
case 'BPAY':
case 'BPAY': {
return 'BPay'
}
default: {
return paymentMethod
}
}
}

function formatBPayProcessingDate(bPayProcessingDate: string | undefined) {
if (bPayProcessingDate) {
const date = localisationService.generateDate({
daysOffset: undefined,
value: bPayProcessingDate,
})
if (date) {
return localisationService.formatDate(date)
}
}
}

export default NSWGovPayPaymentProvider
Loading
Loading