Skip to content
Open
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
6 changes: 5 additions & 1 deletion perllib/FixMyStreet/Roles/Cobrand/Paye.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@ around waste_cc_get_redirect_url => sub {
lineId => $self->waste_cc_payment_admin_fee_line_item_ref($p),
};
}
my $email = $p->get_extra_metadata('contributed_as')
&& ($p->get_extra_metadata('contributed_as') eq 'another_user' || $p->get_extra_metadata('contributed_as') eq 'anonymous_user')
? ''
: $p->user->email;
my %args = (
returnUrl => $c->uri_for_action('/waste/pay_complete', [ $p->id, $redirect_id ] ) . '',
backUrl => $backUrl,
ref => $self->waste_cc_payment_sale_ref($p),
request_id => $p->id,
description => $p->title,
name => $p->name,
email => $p->user->email,
email => $email,
uprn => $p->uprn,
address1 => shift @parts,
address2 => shift @parts,
Expand Down
1 change: 1 addition & 0 deletions t/app/controller/waste_bexley_bulky.t
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ FixMyStreet::override_config {
like $mech2->res->previous->header('Location'), qr/paye.example.org/;

my ($token, $report, $report_id) = get_report_from_redirect($sent_params->{returnUrl});
is $sent_params->{email}, $user->email, 'user email address used for paye';
is $sent_params->{items}[0]{reference}, 'bulky-customer-ref';
is $sent_params->{narrative}, "Bulky waste - $report_id";
is $call_params->{'temp:request'}{sale}{receiptDetails}{name}{surname}, 'Bob Marge';
Expand Down
1 change: 1 addition & 0 deletions t/app/controller/waste_bexley_garden.t
Original file line number Diff line number Diff line change
Expand Up @@ -3017,6 +3017,7 @@ FixMyStreet::override_config {

my ($token, $report, $report_id) = get_report_from_redirect($sent_params->{returnUrl});

is $sent_params->{email}, '', 'Blank email when staff make report';
is $sent_params->{narrative}, "Garden Waste Service Payment - Reference: " . $report_id . " Contract: 10001",
'Custom narrative was used for paye.net payment';
};
Expand Down
Loading