Skip to content

Commit

Permalink
[Bexley][WW] Populate direct debit fields to pass to Agile
Browse files Browse the repository at this point in the history
  • Loading branch information
nephila-nacrea committed Feb 19, 2025
1 parent 6e0997b commit b12661d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions perllib/FixMyStreet/Cobrand/Bexley/Garden.pm
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,22 @@ sub waste_setup_direct_debit {
$report->set_extra_metadata('direct_debit_customer_id', $customer->{Id});
$report->set_extra_metadata('direct_debit_contract_id', $contract->{Id});
$report->set_extra_metadata('direct_debit_reference', $contract->{DirectDebitRef});

# To send to Agile
my $parser = DateTime::Format::Strptime->new( pattern => '%d/%m/%Y' );

Check warning on line 199 in perllib/FixMyStreet/Cobrand/Bexley/Garden.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Garden.pm#L199

Added line #L199 was not covered by tests
my $start_date_str
= $parser->format_datetime( $c->stash->{payment_date} );

Check warning on line 201 in perllib/FixMyStreet/Cobrand/Bexley/Garden.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Garden.pm#L201

Added line #L201 was not covered by tests
$report->update_extra_field(
{ name => 'direct_debit_reference',
value => $contract->{DirectDebitRef},
}
);
$report->update_extra_field(

Check warning on line 207 in perllib/FixMyStreet/Cobrand/Bexley/Garden.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Garden.pm#L206-L207

Added lines #L206 - L207 were not covered by tests
{ name => 'direct_debit_start_date',
value => $start_date_str,
}
);

$report->update;

return 1;
Expand Down

0 comments on commit b12661d

Please sign in to comment.