Skip to content

Commit

Permalink
[Waste] [Paye] Allow subject type to be configured.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jan 14, 2025
1 parent ba9bc34 commit fbbb05a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions perllib/Integrations/Paye.pm
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ sub credentials {

my $ref = $args->{ref} . ':' . time;
my $hmac = Digest::HMAC->new(MIME::Base64::decode($self->config->{paye_hmac}), "Crypt::Digest::SHA256");
$hmac->add(join('!', 'CapitaPortal', $self->config->{paye_siteID}, $ref, $ts, 'Original', $self->config->{paye_hmac_id}));

my $subject_type = $self->config->{paye_subjectType} || 'CapitaPortal';
$hmac->add(join('!', $subject_type, $self->config->{paye_siteID}, $ref, $ts, 'Original', $self->config->{paye_hmac_id}));

return ixhash(
'common:subject' => ixhash(
'common:subjectType' => 'CapitaPortal',
'common:subjectType' => $subject_type,
'common:identifier' => $self->config->{paye_siteID},
'common:systemCode' => 'APN',
),
Expand Down

0 comments on commit fbbb05a

Please sign in to comment.