Skip to content

Commit

Permalink
[Waste] Configure separate bulky SCP customer ref.
Browse files Browse the repository at this point in the history
  • Loading branch information
neprune committed Nov 9, 2023
1 parent 1d6c3f3 commit e250f21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion perllib/FixMyStreet/Roles/SCP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ sub waste_cc_get_redirect_url {
$p->update;

my $fund_code = $payment->config->{scp_fund_code};
my $customer_ref = $payment->config->{customer_ref};

my $backUrl;
if ($back eq 'bulky') {
Expand All @@ -36,6 +37,9 @@ sub waste_cc_get_redirect_url {
if (my $bulky_fund_code = $payment->config->{bulky_scp_fund_code}) {
$fund_code = $bulky_fund_code;
}
if (my $bulky_customer_ref = $payment->config->{bulky_customer_ref}) {
$customer_ref = $bulky_customer_ref;
}
} else {
$backUrl = $c->uri_for_action("/waste/$back", [ $c->stash->{property}{id} ]) . '';
}
Expand All @@ -45,7 +49,7 @@ sub waste_cc_get_redirect_url {

my @items = ({
amount => $amount,
reference => $payment->config->{customer_ref},
reference => $customer_ref,
description => $p->title,
lineId => $self->waste_cc_payment_line_item_ref($p),
});
Expand Down
3 changes: 2 additions & 1 deletion t/app/controller/waste_bromley_bulky.t
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ FixMyStreet::override_config {
form_name => 'rbk_user_form',
staff_form_name => 'rbk_staff_form',
customer_ref => 'customer-ref',
bulky_customer_ref => 'bulky-customer-ref',
},
},
},
Expand Down Expand Up @@ -280,7 +281,7 @@ FixMyStreet::override_config {

is $sent_params->{fund_code}, 20, 'bulky fund code used';
is $sent_params->{items}[0]{amount}, 3000, 'correct amount used';
is $sent_params->{items}[0]{reference}, 'customer-ref';
is $sent_params->{items}[0]{reference}, 'bulky-customer-ref';
is $sent_params->{items}[0]{lineId}, $new_report->id;

$new_report->discard_changes;
Expand Down

0 comments on commit e250f21

Please sign in to comment.