Skip to content

Commit

Permalink
[SLWP] Store cheque payment type separately.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Aug 16, 2023
1 parent 6c08860 commit dc0ab1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions perllib/Open311/Endpoint/Integration/UK/Kingston.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ around check_for_data_value => sub {

my $method = $args->{attributes}{LastPayMethod} || '';
return 2 if $name eq 'Payment Type' && $method eq 3; # DD
return 3 if $name eq 'Payment Type' && $method eq 4; # 'cheque' (or phone)

return $class->$orig($name, $args, $request, $parent_name);
};
Expand Down
1 change: 1 addition & 0 deletions perllib/Open311/Endpoint/Integration/UK/Sutton.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ around check_for_data_value => sub {

my $method = $args->{attributes}{LastPayMethod} || '';
return 2 if $name eq 'Payment Type' && $method eq 3; # DD
return 3 if $name eq 'Payment Type' && $method eq 4; # 'cheque' (or phone)

return $class->$orig($name, $args, $request, $parent_name);
};
Expand Down
8 changes: 8 additions & 0 deletions t/open311/endpoint/sutton.t
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ $soap_lite->mock(call => sub {
my @type = ${$data[1]->value}->value;
is $type[0]->value, 1009;
is $type[1]->value, 1;
} elsif ($client_ref eq 'LBS-2000123') {
is $event_type, EVENT_TYPE_SUBSCRIBE;
is $service_id, 409;
my @data = ${$params[0]->value}->value->value;
my @paper = ${$data[0]->value}->value;
is $paper[0]->value, 1009;
is $paper[1]->value, 3;
}
return SOAP::Result->new(result => {
EventGuid => '1234',
Expand Down Expand Up @@ -116,6 +123,7 @@ subtest "POST subscription request OK" => sub {
'attribute[Subscription_Details_Containers]' => 26, # Garden Bin
'attribute[Subscription_Details_Quantity]' => 1,
'attribute[Request_Type]' => 1,
'attribute[LastPayMethod]' => 4,
);
ok $res->is_success, 'valid request'
or diag $res->content;
Expand Down

0 comments on commit dc0ab1c

Please sign in to comment.