Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bexley] Garden subscription flow, front to payment. #5325

Open
wants to merge 2 commits into
base: bexley-ww-pre-work-refactor-2
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/App/Controller/Waste.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ sub setup_garden_sub_params : Private {
my $service_id;
if (my $service = $c->cobrand->garden_current_subscription) {
$service_id = $service->{service_id};
} else {
} elsif ($c->cobrand->can('garden_service_id')) { # XXX TODO Does Bexley need its own? Or is this actually Echo only?
$service_id = $c->cobrand->garden_service_id;
}
$c->set_param('email_renewal_reminders_opt_in', $data->{email_renewal_reminders} eq 'Yes' ? 'Y' : 'N') if $data->{email_renewal_reminders};
Expand Down
5 changes: 3 additions & 2 deletions perllib/FixMyStreet/Cobrand/Bexley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ use warnings;
use Time::Piece;
use DateTime;
use Moo;
with 'FixMyStreet::Roles::Open311Multi';
with 'FixMyStreet::Cobrand::Bexley::Waste';
with 'FixMyStreet::Roles::Open311Multi',
'FixMyStreet::Cobrand::Bexley::Garden',
'FixMyStreet::Cobrand::Bexley::Waste';

sub council_area_id { 2494 }
sub council_area { 'Bexley' }
Expand Down
40 changes: 40 additions & 0 deletions perllib/FixMyStreet/Cobrand/Bexley/Garden.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
=head1 NAME

FixMyStreet::Cobrand::Bexley::Garden - code specific to Bexley WasteWorks GGW

=cut

package FixMyStreet::Cobrand::Bexley::Garden;

use Moo::Role;
with 'FixMyStreet::Roles::Cobrand::SCP',
'FixMyStreet::Roles::Cobrand::Paye';

sub garden_service_name { 'garden waste collection service' }

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L13 was not covered by tests

# TODO No current subscription look up here
#
sub garden_current_subscription { undef }

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L17 was not covered by tests

=item * You can order a maximum of five bins

=cut

sub waste_garden_maximum { 5 }

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L23 was not covered by tests

=item * Garden waste has different price for the first bin

=cut

# TODO Check
sub waste_cc_payment_sale_ref {
my ($self, $p) = @_;
return "GGW" . $p->get_extra_field_value('uprn');

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

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Garden.pm#L31-L32

Added lines #L31 - L32 were not covered by tests
}

sub waste_cc_payment_line_item_ref {
my ($self, $p) = @_;
return $p->id;

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

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bexley/Garden.pm#L36-L37

Added lines #L36 - L37 were not covered by tests
}

1;
2 changes: 1 addition & 1 deletion perllib/Integrations/SCP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ sub pay {
'scpbase:lgItemDetails' => ixhash(
'scpbase:fundCode' => $args->{fund_code},
'scpbase:additionalReference' => $_->{lineId},
'scpbase:narrative' => $args->{uprn},
'scpbase:narrative' => $args->{uprn}, # Needs to differ for Bexley
'scpbase:accountName' => {
'scpbase:surname' => $args->{name},
},
Expand Down
Loading
Loading